Author: cmailleux
Date: Wed May 23 10:25:13 2007
New Revision: 17357

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17357&repname=
=3Djahia
Log:
Avoid call if user is null

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiSO=
APInvalidatorService.java

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi=
/EsiSOAPInvalidatorService.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/esi/EsiSOAPInvalidatorService.java=
&rev=3D17357&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiSO=
APInvalidatorService.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiSO=
APInvalidatorService.java Wed May 23 10:25:13 2007
@@ -182,15 +182,19 @@
 =

                 // Display status code
                 if (logger.isDebugEnabled()) logger.debug("Response status=
 code: " + result);
-
-                responseXML =3D post.getResponseBodyAsString(); //TODO: mi=
ght wanna use streams here, but not essential since responses are small
+                if(logger.isDebugEnabled())
+                    responseXML =3D post.getResponseBodyAsString(); //TODO=
: might wanna use streams here, but not essential since responses are small
 =

                 if (result!=3D200) {
                     success =3D false;
+                    if (logger.isDebugEnabled())
                     logger.error("[esi]:  ESI Invalidation SOAP Message Er=
ror due to resultCode : "+result
                         + "\n ---- Host : " + invServerAddr
                         + "\n ---- Sent Soap Request: \n" + soapRequest
                         + "\n ---- Soap Response: \n" + responseXML);
+                    else logger.error("[esi]:  ESI Invalidation SOAP Messa=
ge Error due to resultCode : "+result
+                        + "\n ---- Host : " + invServerAddr
+                        + "\n ---- Sent Soap Request: \n" + soapRequest);
                 }
 =

             } catch (IOException e) {
@@ -202,7 +206,7 @@
                             + "\n ---- Soap Response: \n" + responseXML);
                 else
                     logger.warn("[esi]:  ESI Invalidation SOAP IO Error ["=
 + e
-                            + "], Soap Response [" + responseXML +"]");
+                            + "]");
                 success =3D false;
             } catch (Exception e) {
                 if (logger.isDebugEnabled())
@@ -212,7 +216,7 @@
                             + "\n ---- Soap Response from ESI server: \n" =
+ responseXML);
                 else
                     logger.warn("[esi]:  ESI Invalidation SOAP Error [" + e
-                            + "], Soap Response [" + responseXML +"]");
+                            + "]");
                 success =3D false;
             }
             finally {
@@ -487,9 +491,12 @@
      */
     public boolean SOAPInvalidateAllUserEntries(ProcessingContext pc, Jahi=
aUser jahiaUser) {
         //TODO: need to support invalidation of user Session on ESI server=
, when using aclGrouped shared templates
-        HashSet users =3D new HashSet(1);
-        users.add(jahiaUser);
-        return SOAPInvalidateAllUserEntries( pc, users );
+        if (jahiaUser !=3D null) {
+            HashSet users =3D new HashSet(1);
+            users.add(jahiaUser);
+            return SOAPInvalidateAllUserEntries(pc, users);
+        }
+        else return false;
     }
 =

     /**
@@ -552,6 +559,19 @@
         }
         return false; //nothing to invalidate
     }
+
+    public boolean SOAPInvalidateWebDAVFile(String uri) {
+        //TODO: need to support invalidation of user Session on ESI server=
, when using aclGrouped shared templates
+        String invMessage =3D ServicesRegistry.getInstance().getEsiInvalid=
ationWriterService()
+                .getWebDAVFileInvalidationString (uri);
+        if (invMessage!=3Dnull) {
+            String soapRequest =3D ServicesRegistry.getInstance().getEsiIn=
validationWriterService().addSOAPXMLWrapper(invMessage);
+            if (logger.isDebugEnabled())
+                logger.debug("[esi]:  SOAP Invalidation Message SOAPInvali=
dateAllUserEntries : \n" + soapRequest );
+            return Transmit(soapRequest);
+        }
+        return false; //nothing to invalidate
+    }
 }
 =

 =


_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to