mcardle     2005/08/30 18:31:47 CEST

  Modified files:
    core/src/java/org/jahia/settings SettingsBean.java 
  Log:
    * added support for invalidation on a multi-IP/multi-port Esi server
    * added support for automatic boot time cleanup of the ESI server cache
    * added support to view referenced contentIDs in each fragment
    * some refactoring
  
  Revision  Changes    Path
  1.20      +61 -45    jahia/core/src/java/org/jahia/settings/SettingsBean.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/settings/SettingsBean.java.diff?r1=1.19&r2=1.20&f=h
  
  
  
  Index: SettingsBean.java
  ===================================================================
  RCS file: 
/home/cvs/repository/jahia/core/src/java/org/jahia/settings/SettingsBean.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SettingsBean.java 25 Aug 2005 18:34:01 -0000      1.19
  +++ SettingsBean.java 30 Aug 2005 16:31:46 -0000      1.20
  @@ -1,4 +1,4 @@
  -// $Id: SettingsBean.java,v 1.19 2005/08/25 18:34:01 mcardle Exp $
  +// $Id: SettingsBean.java,v 1.20 2005/08/30 16:31:46 mcardle Exp $
   //
   //                                   ____.
   //                       __/\ ______|    |__/\.     _______
  @@ -35,8 +35,6 @@
   import java.util.NoSuchElementException;
   import java.util.Properties;
   import java.util.Map;
  -import javax.servlet.ServletConfig;
  -import javax.servlet.ServletContext;
   
   import org.jahia.data.constants.JahiaConstants;
   import org.jahia.exceptions.JahiaException;
  @@ -46,6 +44,7 @@
   import org.jahia.utils.properties.PropertiesManager;
   import org.xml.sax.EntityResolver;
   import org.jahia.utils.PathResolver;
  +import org.jahia.services.esi.EsiInvalidation;
   import org.apache.commons.collections.FastHashMap;
   
   public class SettingsBean {
  @@ -142,14 +141,17 @@
       // ESI cache activation / deactivation
       final public static String ESI_CACHE_ACTIVATED = "esiCacheActivated";
   
  -    // ESI server public access port
  -    private String esiServerPort;
  +    // ESI server public access port(s)
  +    private String esiServerPorts;
  +
  +    // ESI server IP(s)
  +    private String esiServerIPs;
   
       // ESI server SOAP invalidation port
       private String esiInvalidationPort;
   
  -    // ESI server IP
  -    private String esiServerIP;
  +    // ESI server SOAP invalidation IP
  +    private String esiInvalidationIP;
   
       // ESI server invalidation login name
       private String esiCacheServerLogin;
  @@ -157,18 +159,19 @@
       // ESI server invalidation login password
       private String esiCacheServerPassword;
   
  -    // Jahia server IP(s)
  -    private String jahiaServerIP;
  -
  -    // Jahia server Port(s)
  -    private String jahiaServerPort;
  -
       // Should the cache of the remote ESI (for the current Jahia instance 
only) be cleared at boottime
       private boolean esiCleanupCacheAtBootTime ;
   
       // ESI Display an HTML fieldset box around fragment tags (useful for 
debugging purposes only)
       private boolean esiDisplayFragmentDelimiters ;
   
  +    // ESI, Display the referenced content IDs in each Template/Fragment
  +    private boolean  esiDisplayContentIDs;
  +
  +    // ESI invalidation messages can be either send via HTML reponse 
piggy-backing ( i.e.
  +    // they are appended to Jahia HTML responses) or via a direct SOAP 
transmission to the ESI
  +    // server (default):
  +    private boolean esiUsePiggyBackInvalidation;
   
       // Output cache expiration delay in milliseconds
       private long outputCacheDefaultExpirationDelay;
  @@ -425,14 +428,17 @@
               }
   
               if (lookupBoolean(ESI_CACHE_ACTIVATED)) {
  -               // ESI server public access port
  -               esiServerPort = getString( "esiServerPort");
  +               // ESI server public access port(s)
  +               esiServerPorts = getString( "esiServerPorts");
  +
  +               // ESI server IP(s)
  +               esiServerIPs = getString("esiServerIPs");
   
                  // ESI server SOAP invalidation port
                  esiInvalidationPort = getString("esiInvalidationPort");
   
  -               // ESI server IP
  -               esiServerIP = getString("esiServerIP");
  +                // ESI server SOAP invalidation IP
  +               esiInvalidationIP = getString("esiInvalidationIP");
   
                  // ESI server invalidation login name
                  esiCacheServerLogin = getString("esiCacheServerLogin");
  @@ -443,17 +449,17 @@
                  // Should the cache of the remote ESI (for the current Jahia 
instance only) be cleared at boottime
                  esiCleanupCacheAtBootTime = 
getBoolean("esiCleanupCacheAtBootTime", false);
   
  -                //non need for these if esiCleanupCacheAtBootTime isn't 
active
  -                if (esiCleanupCacheAtBootTime) {
  -                    // Jahia server IP(s)
  -                    jahiaServerIP = getString("jahiaServerIP");
  +               // ESI, Display an HTML fieldset box around fragment tags 
(useful for debugging purposes only)
  +               esiDisplayFragmentDelimiters =getBoolean 
("esiDisplayFragmentDelimiters", false);
   
  -                    // Jahia server Port(s)
  -                    jahiaServerPort = getString("jahiaServerPort");
  -                }
  +                // ESI, Display the referenced content IDs in each 
Template/Fragment
  +               esiDisplayContentIDs =getBoolean ("esiDisplayContentIDs", 
false);
   
  -                // ESI Display an HTML fieldset box around fragment tags 
(useful for debugging purposes only)
  -               esiDisplayFragmentDelimiters =getBoolean 
("esiDisplayFragmentDelimiters", false);
  +               //Use PiggyBacking or SOAP invalidation?
  +                esiUsePiggyBackInvalidation = getBoolean 
("esiUsePiggyBackInvalidation", false);
  +
  +                //Parse esiServerIPs and esiServerPorts values
  +                EsiInvalidation.initJahiaServerAddresses();
               }
   
               // activation / deactivation of site ID in URL
  @@ -1185,27 +1191,33 @@
       }
   
       /**
  -     * Used to get ESI server public access port
  +     * Used to get ESI server SOAP invalidation port
        *
        */
  -    public String getEsiServerPort() {
  -        return esiServerPort;
  +    public String getEsiInvalidationPort() {
  +        return esiInvalidationPort;
  +    }
  +     /**
  +     * Used to get ESI server SOAP invalidation IP
  +     *
  +     */
  +    public String getEsiInvalidationIP() {
  +        return esiInvalidationIP;
       }
  -
       /**
  -     * Used to get ESI server SOAP invalidation port
  +     * Used to get ESI server IP(s)
        *
        */
  -    public String getEsiInvalidationPort() {
  -        return esiInvalidationPort;
  +    public String getEsiServerIPs () {
  +        return esiServerIPs;
       }
   
       /**
  -     * Used to get ESI server IP
  +     * Used to get ESI server public access port(s)
        *
        */
  -    public String getEsiServerIP () {
  -        return esiServerIP;
  +    public String getEsiServerPorts() {
  +        return esiServerPorts;
       }
   
       /**
  @@ -1233,29 +1245,33 @@
       }
   
        /**
  -     *  returns Jahia server IP(s)
  +     * Used to get Display the referenced content IDs in each 
Template/Fragment
        *
        */
  -    public String getJahiaServerIP () {
  -        return jahiaServerIP;
  +    public boolean getEsiDisplayContentIDs () {
  +        return esiDisplayContentIDs;
       }
   
  +
       /**
  +     * true if the cache of the remote ESI (for the current Jahia instance 
only) should be cleared at boottime
        *
  -     * returns Jahia server Port(s)
        */
  -     public String getJahiaServerPort () {
  -        return jahiaServerPort;
  +     public boolean getEsiCleanupCacheAtBootTime () {
  +        return esiCleanupCacheAtBootTime;
       }
   
       /**
  -     * true if the cache of the remote ESI (for the current Jahia instance 
only) should be cleared at boottime
  +     *  returns true if ESI invalidation messages are send via HTML reponse 
piggy-backing ( i.e.
  +     * they are appended to Jahia HTML responses) or via a direct SOAP 
transmission to the ESI
  +     * server (default)
        *
        */
  -     public boolean getEsiCleanupCacheAtBootTime () {
  -        return esiCleanupCacheAtBootTime;
  +    public boolean getEsiUsePiggyBackInvalidation () {
  +        return esiUsePiggyBackInvalidation;
       }
   
  +
       /*
       public ServletConfig getConfig() {
           return config;
  

Reply via email to