|
EAC Toolkit 3.2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.soleng.eac.toolkit.base.EacElement com.endeca.soleng.eac.toolkit.base.Provisionable com.endeca.soleng.eac.toolkit.component.Component
public class Component
Component is the provisionable object from which all components inherit. This object exposes methods for interacting with the EAC's component control web service to start, stop and request the status of components.
Field Summary |
---|
Fields inherited from class com.endeca.soleng.eac.toolkit.base.EacElement |
---|
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir |
Constructor Summary | |
---|---|
Component()
|
Method Summary | |
---|---|
void |
archiveLogDir()
Creates a backup of the components log directory (i.e. |
com.endeca.eac.client.ComponentType |
buildEacStub()
Builds a ComponentType object to send to the EAC. |
void |
cleanDir(java.lang.String dir)
Cleans all contents for the target directory, if the specified path is not null or empty. |
Utility |
constructArchiveLogDir()
Construct utility for archiving the log directory or, if number of archives is configured to be "-1" (indicating the user wants to clear the log directory, but not archive the logs), this method constructs a utility to clean the log directory. |
CleanDirUtility |
constructCleanDir(java.lang.String dir)
Construct utility for cleaning the specified directory. |
java.util.Map<java.lang.String,java.lang.String> |
getCustomDirectories()
|
protected java.util.List<java.lang.String> |
getDirProperties()
Retrieves a list of properties assumed to be custom directory definitions, based on the convention that the property name ends with "dir" or "Dir." |
Host |
getHost()
|
java.lang.String |
getHostId()
|
long |
getLongPropertyValueOrDefault(java.lang.String propName,
long defaultValue)
|
long |
getMaxMissedStatusChecksAllowed()
|
long |
getMaxWaitTimeSeconds()
|
long |
getMinWaitTimeSeconds()
|
int |
getNumLogBackups()
Retrieves the number of log archives configured as a property in the app configuration. |
int |
getNumMissedStatusChecks()
|
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
|
java.lang.String |
getProperty(java.lang.String propName)
Retrieves the value of the property with the specified name from the provisioned component. |
long |
getSlowPollingIntervalMs()
|
long |
getStandardPollingIntervalMs()
|
com.endeca.eac.client.StateType |
getStatus()
Retrieves the status of the component. |
void |
incrementMissedStatusQueries()
|
protected void |
initializeEacStub(com.endeca.eac.client.ComponentType stub)
|
boolean |
isActive()
Returns true if the component is active (i.e. |
boolean |
isDefined()
Checks whether the component is defined in the EAC. |
boolean |
isDefinitionChanged()
Compares the definition of the component in the EAC to the local definition. |
boolean |
isFailed()
Returns true if the component failed when it was run most recently. |
boolean |
isHotUpdateDefinitionChange()
Method to test whether a definition change requires stopping the component or whether it can be performed as a "hot update." This implementation assumes that the only hot update that's possible is a change to the properties. |
boolean |
isSkipTestingForFilesDuringCleanup()
Retrieves the boolean indicating whether directory cleanup should use the default behavior of first testing for non-empty directory contents, or if that test should be skipped. |
void |
removeDefinition()
Removes the EAC provisioning of this component. |
void |
setCustomDirectories(java.util.Map<java.lang.String,java.lang.String> customDirectories)
|
void |
setDefinition()
Sets the EAC provisioning of this component, building the definition from the information in this object. |
void |
setDefinition(com.endeca.eac.client.ComponentType componentType)
Sets the EAC provisioning of this component to the ComponentType WSDL stub object passed as a parameter. |
void |
setHost(Host host)
|
void |
setHostId(java.lang.String hostId)
|
void |
setNumMissedStatusChecks(int numMissedStatusQueries)
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
|
void |
start()
Starts the component. |
void |
stop()
Stops the component. |
void |
updateDefinition()
Updates the EAC provisioning of this component. |
void |
updateEacDefinition()
Updates the EAC provisioning of this component, building the definition from this object. |
void |
updateEacDefinition(com.endeca.eac.client.ComponentType componentType)
Updates the EAC provisioning of this component with the specified component type. |
boolean |
waitForFinished()
Waits for the component to finish, by polling for its status every second, until the maximum wait time has elapsed. |
Methods inherited from class com.endeca.soleng.eac.toolkit.base.Provisionable |
---|
getAppDefinitionFromEac, getCachedAppDefinition, getProvisioningPort, invalidateCachedAppDefinition, setCachedAppDefinition |
Methods inherited from class com.endeca.soleng.eac.toolkit.base.EacElement |
---|
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setElementId, setLockManager, setLogDir, setSslEnabled, setWorkingDir |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Component()
Method Detail |
---|
public void start() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
start the component.public void stop() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
stop the component.public com.endeca.eac.client.StateType getStatus() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
check the status of the component.public boolean waitForFinished() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
check the status of the component.public boolean isActive() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
check the status of the component.public boolean isFailed() throws EacCommunicationException, EacComponentControlException
EacCommunicationException
- If a communication error occurs while
requesting the status of the component from the EAC.
EacComponentControlException
- If an error occurs while trying to
check the status of the component.public void archiveLogDir() throws AppConfigurationException, EacCommunicationException, EacComponentControlException, java.lang.InterruptedException
AppConfigurationException
- If there is insufficient or invalid configuration
for the utility..
EacCommunicationException
- If a communication error occurs while
running the backup.
EacComponentControlException
- If an error occurs while running the
backup.
java.lang.InterruptedException
- If the thread is interrupted while waiting for
the backup to finish.public Utility constructArchiveLogDir() throws AppConfigurationException
AppConfigurationException
public void cleanDir(java.lang.String dir) throws AppConfigurationException, EacCommunicationException, EacComponentControlException
dir
- Directory to clean.
AppConfigurationException
EacCommunicationException
EacComponentControlException
public CleanDirUtility constructCleanDir(java.lang.String dir) throws AppConfigurationException
dir
- Directory to clean.
AppConfigurationException
protected java.util.List<java.lang.String> getDirProperties()
public java.lang.String getProperty(java.lang.String propName)
propName
- Name of the property whose value will be retrieved.
public boolean isDefinitionChanged() throws EacCommunicationException, EacProvisioningException
isDefinitionChanged
in class Provisionable
EacCommunicationException
- If a communication error occurs while
retrieving the provisioning port.
EacProvisioningException
- If an error occurs while trying to retrieve
the component definition from the EAC.public boolean isDefined() throws EacCommunicationException, EacProvisioningException
isDefined
in class Provisionable
EacCommunicationException
- If a communication error occurs while
retrieving the provisioning port.
EacProvisioningException
- If an error occurs while trying to retrieve
the component definition from the EAC.public void updateDefinition() throws EacCommunicationException, EacComponentControlException, EacProvisioningException
updateDefinition
in class Provisionable
EacComponentControlException
- If an error occurs while trying to
start, stop or check the status of the component.
EacCommunicationException
- If a communication error occurs while
retrieving the provisioning port.
EacProvisioningException
public boolean isHotUpdateDefinitionChange() throws EacCommunicationException, EacProvisioningException
EacProvisioningException
EacCommunicationException
public void removeDefinition() throws EacCommunicationException, EacComponentControlException
removeDefinition
in class Provisionable
EacComponentControlException
- If an error occurs while trying to
stop the component.
EacCommunicationException
- If a communication error occurs while
retrieving the provisioning port.public void setDefinition() throws EacCommunicationException
setDefinition
in class Provisionable
EacCommunicationException
- If a communication error occurs while
removing the component.public void setDefinition(com.endeca.eac.client.ComponentType componentType) throws EacCommunicationException
componentType
- Definition to set in the EAC.
EacCommunicationException
- If a communication error occurs while
removing the component.public void updateEacDefinition() throws EacCommunicationException, EacProvisioningException
EacCommunicationException
EacProvisioningException
public void updateEacDefinition(com.endeca.eac.client.ComponentType componentType) throws EacCommunicationException, EacProvisioningException
EacCommunicationException
EacProvisioningException
public com.endeca.eac.client.ComponentType buildEacStub()
protected void initializeEacStub(com.endeca.eac.client.ComponentType stub)
public int getNumLogBackups()
public boolean isSkipTestingForFilesDuringCleanup()
public java.util.Map<java.lang.String,java.lang.String> getCustomDirectories()
public void setCustomDirectories(java.util.Map<java.lang.String,java.lang.String> customDirectories)
public java.util.Map<java.lang.String,java.lang.String> getProperties()
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
public java.lang.String getHostId()
public void setHostId(java.lang.String hostId)
public Host getHost()
public void setHost(Host host)
public long getLongPropertyValueOrDefault(java.lang.String propName, long defaultValue)
public long getMaxMissedStatusChecksAllowed()
public long getStandardPollingIntervalMs()
public long getSlowPollingIntervalMs()
public long getMinWaitTimeSeconds()
public long getMaxWaitTimeSeconds()
public int getNumMissedStatusChecks()
public void setNumMissedStatusChecks(int numMissedStatusQueries)
public void incrementMissedStatusQueries()
|
EAC Toolkit 3.2.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@VERSION PRODUCT: EAC Toolkit (eacToolkit) VERSION: 3.2.1 BUILD: NONE ARCH_OS: n/a DATE: 2011-11-10T16:21:05-0500