atg.endeca.assembler.configuration
Class AssemblerApplicationConfiguration

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.endeca.assembler.configuration.AssemblerApplicationConfiguration
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class AssemblerApplicationConfiguration
extends GenericService

Configuration extensions specific to configuration Endeca application-related information for the assembler.

Created: August 28 2012


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
AssemblerApplicationConfiguration()
           
 
Method Summary
protected  void addDefaultToMdexHostAndPort(boolean pOverride)
          Add the default key to MdexHostAndPort based on the default
 void createWorkbenchContentSourcesFromPrototype()
          New, create workbench content sources from our prototype one.
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 ApplicationConfiguration getApplicationConfiguration()
          Returns property applicationConfiguration.
 java.lang.String getApplicationKey(DynamoHttpServletRequest pRequest)
          Get the current Endeca (Workbench) application to which requests should be routed.
 java.util.Map<java.lang.String,java.lang.String> getApplicationKeyToMdexHostAndPort()
          Returns property applicationKeyToMdexHostAndPort.
 java.util.Locale getApplicationLocale(DynamoHttpServletRequest pRequest)
          Return locale of the current Endeca application give the locale of the current user.
 java.lang.String getApplicationName(DynamoHttpServletRequest pRequest)
          Get the current Endeca (Workbench) application name, given the request.
 java.lang.String getCurrentApplicationKey()
          Get the current Endeca (Workbench) application to which requests should be routed.
 java.util.Locale getCurrentApplicationLocale()
          Return locale of the current Endeca application give the locale of the current user.
 java.lang.String getCurrentApplicationName()
          Get the current Endeca (Workbench) application name.
 java.lang.String getCurrentInitializingWorkbenchContentSourceApplicationName()
          Return the currentInitializingWorkbenchContentSourceApplicationName property.
protected  HostAndPort getCurrentMdexHostAndPort()
          Return the current mdex host and port object.
 java.lang.String getCurrentMdexHostName()
          Return host name for the MDEX to be used for the current Endeca application.
 int getCurrentMdexPort()
          Return port number for the MDEX to be used for the current Endeca application.
 java.lang.String getDefaultMdexHostName()
          Returns property defaultMdexHostName.
 int getDefaultMdexPort()
          Returns property defaultMdexPort.
 java.lang.String getDynamicWorkbenchContentSourceBasePath()
          Returns property dynamicWorkbenchContentSourceBasePath.
 java.util.Map<java.lang.String,HostAndPort> getParsedApplicationKeyToMdexHostAndPort()
          Return the parsed map form of applicationKeyToMdexHostAndPort.
 java.lang.String getPrototypeWorkbenchContentSourcePath()
          Returns property prototypeWorkbenchContentSourcePath.
 RequestRoutingObjectAdapter getRoutingObjectAdapter()
          Returns property requestRoutingObjectAdapter.
 java.lang.String getWorkbenchHostName()
          Returns property workbenchHostName.
 int getWorkbenchPort()
          Returns property workbenchPort.
protected  boolean isDefaultMdexHostNameSet()
          Whether the default MDEX host name was explicitly set to a non-null value.
 void setApplicationConfiguration(ApplicationConfiguration pApplicationConfiguration)
          Sets property applicationConfiguration.
 void setApplicationKeyToMdexHostAndPort(java.util.Map<java.lang.String,java.lang.String> pApplicationKeyToMdexHostAndPort)
          Sets property applicationKeyToMdexHostAndPort.
 void setDefaultMdexHostName(java.lang.String pDefaultMdexHostName)
          Sets property defaultMdexHostName.
 void setDefaultMdexPort(int pDefaultMdexPort)
          Sets property defaultMdexPort.
 void setDynamicWorkbenchContentSourceBasePath(java.lang.String pDynamicWorkbenchContentSourceBasePath)
          Sets property dynamicWorkbenchContentSourceBasePath.
 void setPrototypeWorkbenchContentSourcePath(java.lang.String pPrototypeWorkbenchContentSourcePath)
          Sets property prototypeWorkbenchContentSourcePath.
 void setRoutingObjectAdapter(RequestRoutingObjectAdapter pRoutingObjectAdapter)
          Sets property routingObjectAdapter.
protected  boolean shouldCreateWorkbenchContentSourcesFromPrototype()
          Whether we should call createWorkbenchContentSourcesFromPrototype() on component startup.
protected  boolean verifyApplicationKeyToMdexHostAndPort()
          Verify that each application has an entriy in applicationKeyToMdexHostAndPort.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

AssemblerApplicationConfiguration

public AssemblerApplicationConfiguration()
Method Detail

getWorkbenchHostName

public java.lang.String getWorkbenchHostName()
Returns property workbenchHostName. The host name of the Endeca Workbench server.


getWorkbenchPort

public int getWorkbenchPort()
Returns property workbenchPort. The port number of the Endeca Workbench server.


setApplicationKeyToMdexHostAndPort

public void setApplicationKeyToMdexHostAndPort(java.util.Map<java.lang.String,java.lang.String> pApplicationKeyToMdexHostAndPort)
Sets property applicationKeyToMdexHostAndPort. Map from application key to MDEX host and port.


getApplicationKeyToMdexHostAndPort

public java.util.Map<java.lang.String,java.lang.String> getApplicationKeyToMdexHostAndPort()
Returns property applicationKeyToMdexHostAndPort. Map from application key to MDEX host and port.


getParsedApplicationKeyToMdexHostAndPort

public java.util.Map<java.lang.String,HostAndPort> getParsedApplicationKeyToMdexHostAndPort()
Return the parsed map form of applicationKeyToMdexHostAndPort.


setApplicationConfiguration

public void setApplicationConfiguration(ApplicationConfiguration pApplicationConfiguration)
Sets property applicationConfiguration. Reference to Endeca Application configuration that provides application name and language configuration.


getApplicationConfiguration

public ApplicationConfiguration getApplicationConfiguration()
Returns property applicationConfiguration. Reference to Endeca Application configuration that provides application name and language configuration.


setRoutingObjectAdapter

public void setRoutingObjectAdapter(RequestRoutingObjectAdapter pRoutingObjectAdapter)
Sets property routingObjectAdapter. Our adapter for getting our current routing object (and locale) from DynamoHttpServletRequest.


getRoutingObjectAdapter

public RequestRoutingObjectAdapter getRoutingObjectAdapter()
Returns property requestRoutingObjectAdapter. Our adapter for getting our current routing object (and locale) from DynamoHttpServletRequest.


getCurrentInitializingWorkbenchContentSourceApplicationName

public java.lang.String getCurrentInitializingWorkbenchContentSourceApplicationName()
Return the currentInitializingWorkbenchContentSourceApplicationName property.


setPrototypeWorkbenchContentSourcePath

public void setPrototypeWorkbenchContentSourcePath(java.lang.String pPrototypeWorkbenchContentSourcePath)
Sets property prototypeWorkbenchContentSourcePath. Nucleus path to a prototype workbench content source.


getPrototypeWorkbenchContentSourcePath

public java.lang.String getPrototypeWorkbenchContentSourcePath()
Returns property prototypeWorkbenchContentSourcePath. Nucleus path to a prototype workbench content source.


setDynamicWorkbenchContentSourceBasePath

public void setDynamicWorkbenchContentSourceBasePath(java.lang.String pDynamicWorkbenchContentSourceBasePath)
Sets property dynamicWorkbenchContentSourceBasePath. Base path for dynamically created, Endeca application specific WorkbenchContentSource objects.


getDynamicWorkbenchContentSourceBasePath

public java.lang.String getDynamicWorkbenchContentSourceBasePath()
Returns property dynamicWorkbenchContentSourceBasePath. Base path for dynamically created, Endeca application specific WorkbenchContentSource objects.


setDefaultMdexHostName

public void setDefaultMdexHostName(java.lang.String pDefaultMdexHostName)
Sets property defaultMdexHostName. The hostname of the default MDEX to use.


getDefaultMdexHostName

public java.lang.String getDefaultMdexHostName()
Returns property defaultMdexHostName. The hostname of the default MDEX to use.


isDefaultMdexHostNameSet

protected boolean isDefaultMdexHostNameSet()
Whether the default MDEX host name was explicitly set to a non-null value.


setDefaultMdexPort

public void setDefaultMdexPort(int pDefaultMdexPort)
Sets property defaultMdexPort. The port of the default MDEX to use.


getDefaultMdexPort

public int getDefaultMdexPort()
Returns property defaultMdexPort. The port of the default MDEX to use.


getApplicationKey

public java.lang.String getApplicationKey(DynamoHttpServletRequest pRequest)
Get the current Endeca (Workbench) application to which requests should be routed.

Parameters:
pRequest - the current dynamo request.

getCurrentApplicationKey

public java.lang.String getCurrentApplicationKey()
Get the current Endeca (Workbench) application to which requests should be routed. Note that getApplicationKey() should be used if a DynamoHttpServletRequest is available to use as a parameter.

Parameters:
pRequest - the current dynamo request.

getApplicationName

public java.lang.String getApplicationName(DynamoHttpServletRequest pRequest)
Get the current Endeca (Workbench) application name, given the request.

Parameters:
pRequest - the current dynamo request.

getCurrentApplicationName

public java.lang.String getCurrentApplicationName()
Get the current Endeca (Workbench) application name. Note that getApplicationName() should be used if a DynamoHttpServletRequest is available to use as a parameter.

Parameters:
pRequest - the current dynamo request.

getApplicationLocale

public java.util.Locale getApplicationLocale(DynamoHttpServletRequest pRequest)
Return locale of the current Endeca application give the locale of the current user.


getCurrentApplicationLocale

public java.util.Locale getCurrentApplicationLocale()
Return locale of the current Endeca application give the locale of the current user. Please note thet getApplicationLocale() should be used if the current DynamoHttpServletRequest is available.


shouldCreateWorkbenchContentSourcesFromPrototype

protected boolean shouldCreateWorkbenchContentSourcesFromPrototype()
Whether we should call createWorkbenchContentSourcesFromPrototype() on component startup.

Returns:
true if our ApplicationConfiguration is configured for more than a single application.

createWorkbenchContentSourcesFromPrototype

public void createWorkbenchContentSourcesFromPrototype()
New, create workbench content sources from our prototype one.


getCurrentMdexHostName

public java.lang.String getCurrentMdexHostName()
Return host name for the MDEX to be used for the current Endeca application. The result returned depends on applicationKeyToMdexHostAndPort having been configured with an entry for the current application key.

Returns:
the found HostAndPort, or null if none is configured.

getCurrentMdexPort

public int getCurrentMdexPort()
Return port number for the MDEX to be used for the current Endeca application. The result returned depends on applicationKeyToMdexHostAndPort having been configured with an entry for the current application key.

Returns:
the found HostAndPort, or null if none is configured.

getCurrentMdexHostAndPort

protected HostAndPort getCurrentMdexHostAndPort()
Return the current mdex host and port object. The result returned depends on applicationKeyToMdexHostAndPort having been configured with an entry for the current application key.

Returns:
the found HostAndPort, or null if none is configured.

verifyApplicationKeyToMdexHostAndPort

protected boolean verifyApplicationKeyToMdexHostAndPort()
Verify that each application has an entriy in applicationKeyToMdexHostAndPort.

Returns:
true if all entries are present, false otherwise.

addDefaultToMdexHostAndPort

protected void addDefaultToMdexHostAndPort(boolean pOverride)
Add the default key to MdexHostAndPort based on the default

Parameters:
pOverride - whether to override an existing value.

doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up