org.vfny.geoserver.global
Class ApplicationState

java.lang.Object
  extended byorg.vfny.geoserver.global.ApplicationState
All Implemented Interfaces:
org.apache.struts.action.PlugIn

public class ApplicationState
extends java.lang.Object
implements org.apache.struts.action.PlugIn

This class represents the state of the GeoServer appliaction.

ApplicationState used by the state.jsp tile as a single view on the state of the GeoServer application. This class may be extended in the future to provide runtime statistics.

This class is not a bean - content is updated based on methods. As an example consider the following State diagram:


Field Summary
static java.lang.String WEB_CONTAINER_KEY
          The key used to store this value in the Web Container
 
Constructor Summary
ApplicationState()
           
 
Method Summary
 void destroy()
          Clean up the Configuration State during application exit.
 int getDataBad()
           
 int getDataDisabled()
           
 int getDataGood()
           
 java.lang.Exception getDataStoreError(java.lang.String key)
           
 java.util.List getDataStoreErrorKeys()
          Flattened for your JSP pleasure
 java.util.Map getDataStoreErrors()
          DataStore Exceptions by dataStoreId:typeName
 java.util.List getDataStoreErrorValues()
          Flattened for your JSP pleasure
 java.lang.Exception getNameSpaceError(java.lang.String key)
           
 java.util.List getNameSpaceErrorKeys()
          Flattened for your JSP pleasure
 java.util.Map getNameSpaceErrors()
          Namespace Exceptions by prefix:typeName.
 java.util.List getNameSpaceErrorValues()
          Flattened for your JSP pleasure
 int getWfsBad()
          q: What foul manner of magic is this?
 int getWfsDisabled()
          q: This does not make a lot of sense - did you want to consult both ConfigChanged and GeoServer changed?
 java.lang.Exception getWFSError(java.lang.String key)
           
 java.util.List getWFSErrorKeys()
           
 java.util.Map getWFSErrors()
           
 int getWfsGood()
          Q: what is this supposed to do?
 int getWmsBad()
          Q: scary magic
 int getWmsDisabled()
          Q: scary magic
 java.lang.Exception getWMSError(java.lang.String key)
           
 java.util.List getWMSErrorKeys()
           
 java.util.Map getWMSErrors()
           
 int getWmsGood()
          Q: scary magic
 void init(org.apache.struts.action.ActionServlet actionServlet, org.apache.struts.config.ModuleConfig moduleConfig)
          Set up the ApplicationState during Application start up.
 boolean isConfigChanged()
          True if the user has changed the Configuration and not yet applied them.
 boolean isDataChanged()
           
 boolean isDataEdited()
           
 boolean isGeoServerChanged()
          True if the user has changed GeoServer and not yet saved the changes.
 boolean isValidationChanged()
           
 boolean isValidationEdited()
           
 boolean isWfsChanged()
           
 boolean isWfsEdited()
           
 boolean isWmsChanged()
           
 boolean isWmsEdited()
           
 void notifiySaveXML()
          Notification that Global has been saved to XML config files.
 void notifyConfigChanged()
          Notification that the User has changed the Configuration
 void notifyLoadXML()
          Notification that Global has been updated from XML config files
 void notifyToGeoServer()
          Notification that Global has been updated from Configuration
 void setConfigChanged(boolean edited)
           
 void setDataChanged(boolean dataChanged)
           
 void setDataEdited(boolean dataEdited)
           
 void setGeoServerChanged(boolean changed)
           
 void setValidationChanged(boolean validationChanged)
           
 void setValidationEdited(boolean validationEdited)
           
 void setWfsChanged(boolean wfsChanged)
           
 void setWfsEdited(boolean wfsEdited)
           
 void setWmsChanged(boolean wmsChanged)
           
 void setWmsEdited(boolean wmsEdited)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEB_CONTAINER_KEY

public static final java.lang.String WEB_CONTAINER_KEY
The key used to store this value in the Web Container

See Also:
Constant Field Values
Constructor Detail

ApplicationState

public ApplicationState()
Method Detail

destroy

public void destroy()
Clean up the Configuration State during application exit.

Since this class just holds data, no resources need to be released.

Specified by:
destroy in interface org.apache.struts.action.PlugIn
See Also:
PlugIn.destroy()

init

public void init(org.apache.struts.action.ActionServlet actionServlet,
                 org.apache.struts.config.ModuleConfig moduleConfig)
          throws javax.servlet.ServletException
Set up the ApplicationState during Application start up.

ApplicationState simply registers itself with the WEB_CONTAINER_KEY ("GeoServer.ApplicationState") during start up.

Specified by:
init in interface org.apache.struts.action.PlugIn
Parameters:
actionServlet - ActionServlet representing the Application
moduleConfig - Configuration used to set up this plug in
Throws:
javax.servlet.ServletException
See Also:
PlugIn.init(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

isConfigChanged

public boolean isConfigChanged()
True if the user has changed the Configuration and not yet applied them.

Returns:
true if Configuration needs changing.

setConfigChanged

public void setConfigChanged(boolean edited)

isGeoServerChanged

public boolean isGeoServerChanged()
True if the user has changed GeoServer and not yet saved the changes.

Returns:
true if GeoServer has been changed (but not saved)

setGeoServerChanged

public void setGeoServerChanged(boolean changed)

notifyLoadXML

public void notifyLoadXML()
Notification that Global has been updated from XML config files


notifyToGeoServer

public void notifyToGeoServer()
Notification that Global has been updated from Configuration


notifiySaveXML

public void notifiySaveXML()
Notification that Global has been saved to XML config files.


notifyConfigChanged

public void notifyConfigChanged()
Notification that the User has changed the Configuration


getWfsGood

public int getWfsGood()
Q: what is this supposed to do?


getWfsBad

public int getWfsBad()
q: What foul manner of magic is this?


getWfsDisabled

public int getWfsDisabled()
q: This does not make a lot of sense - did you want to consult both ConfigChanged and GeoServer changed?


getWmsGood

public int getWmsGood()
Q: scary magic


getWmsBad

public int getWmsBad()
Q: scary magic


getWmsDisabled

public int getWmsDisabled()
Q: scary magic


getDataGood

public int getDataGood()

getDataBad

public int getDataBad()

getDataDisabled

public int getDataDisabled()

getDataStoreError

public java.lang.Exception getDataStoreError(java.lang.String key)

getNameSpaceError

public java.lang.Exception getNameSpaceError(java.lang.String key)

getWFSError

public java.lang.Exception getWFSError(java.lang.String key)

getWMSError

public java.lang.Exception getWMSError(java.lang.String key)

getNameSpaceErrors

public java.util.Map getNameSpaceErrors()
Namespace Exceptions by prefix:typeName.

This only includes problems! If this map is null or isEmpty status is "ready".

Returns:

getNameSpaceErrorKeys

public java.util.List getNameSpaceErrorKeys()
Flattened for your JSP pleasure


getNameSpaceErrorValues

public java.util.List getNameSpaceErrorValues()
Flattened for your JSP pleasure


getDataStoreErrors

public java.util.Map getDataStoreErrors()
DataStore Exceptions by dataStoreId:typeName

This only includes problems! If this map is null or isEmpty status is "ready".

Returns:

getDataStoreErrorKeys

public java.util.List getDataStoreErrorKeys()
Flattened for your JSP pleasure


getDataStoreErrorValues

public java.util.List getDataStoreErrorValues()
Flattened for your JSP pleasure


getWFSErrors

public java.util.Map getWFSErrors()

getWFSErrorKeys

public java.util.List getWFSErrorKeys()

getWMSErrors

public java.util.Map getWMSErrors()

getWMSErrorKeys

public java.util.List getWMSErrorKeys()

isDataChanged

public boolean isDataChanged()
Returns:
Returns the dataChanged.

setDataChanged

public void setDataChanged(boolean dataChanged)
Parameters:
dataChanged - The dataChanged to set.

isDataEdited

public boolean isDataEdited()
Returns:
Returns the dataEdited.

setDataEdited

public void setDataEdited(boolean dataEdited)
Parameters:
dataEdited - The dataEdited to set.

isValidationChanged

public boolean isValidationChanged()
Returns:
Returns the validationChanged.

setValidationChanged

public void setValidationChanged(boolean validationChanged)
Parameters:
validationChanged - The validationChanged to set.

isValidationEdited

public boolean isValidationEdited()
Returns:
Returns the validationEdited.

setValidationEdited

public void setValidationEdited(boolean validationEdited)
Parameters:
validationEdited - The validationEdited to set.

isWfsChanged

public boolean isWfsChanged()
Returns:
Returns the wfsChanged.

setWfsChanged

public void setWfsChanged(boolean wfsChanged)
Parameters:
wfsChanged - The wfsChanged to set.

isWfsEdited

public boolean isWfsEdited()
Returns:
Returns the wfsEdited.

setWfsEdited

public void setWfsEdited(boolean wfsEdited)
Parameters:
wfsEdited - The wfsEdited to set.

isWmsChanged

public boolean isWmsChanged()
Returns:
Returns the wmsChanged.

setWmsChanged

public void setWmsChanged(boolean wmsChanged)
Parameters:
wmsChanged - The wmsChanged to set.

isWmsEdited

public boolean isWmsEdited()
Returns:
Returns the wmsEdited.

setWmsEdited

public void setWmsEdited(boolean wmsEdited)
Parameters:
wmsEdited - The wmsEdited to set.