public class ApacheServerComponent extends Object implements AugeasRHQComponent, ResourceComponent<PlatformComponent>, MeasurementFacet, OperationFacet, ConfigurationFacet, CreateChildResourceFacet
| Constructor and Description |
|---|
ApacheServerComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
conditionalRestart()
Conditionally restarts the server based on the settings in the plugin configuration of the server.
|
static String |
convertStringToBMX(String string) |
CreateResourceReport |
createResource(CreateResourceReport report) |
void |
deleteEmptyFile(AugeasTree tree,
AugeasNode deletedNode)
This method checks whether the supplied node that has been deleted from the tree didn't leave
the file it was contained in empty.
|
void |
finishChildResourceCreate(CreateResourceReport report)
This method is akin to
finishConfigurationUpdate(ConfigurationUpdateReport) but should
be used in the createResource(CreateResourceReport) method. |
void |
finishConfigurationUpdate(ConfigurationUpdateReport report)
This method is supposed to be called from
updateResourceConfiguration(ConfigurationUpdateReport)
of this resource and any child resources. |
HttpdAddressUtility |
getAddressUtility() |
AugeasComponent |
getAugeas() |
org.rhq.core.domain.measurement.AvailabilityType |
getAvailability() |
String |
getBMXUrl() |
ConfigurationTimestamp |
getConfigurationTimestamp() |
File |
getControlScriptPath()
Return the absolute path of this Apache server's control script (e.g.
|
ApacheBinaryInfo |
getCurrentBinaryInfo() |
ProcessInfo |
getCurrentProcessInfo() |
File |
getExecutablePath()
Return the absolute path of this Apache server's executable (e.g.
|
File |
getHttpdConfFile()
Returns the httpd.conf file
|
Map<String,String> |
getModuleNames() |
File |
getServerRoot()
Return the absolute path of this Apache server's server root (e.g.
|
String |
getServerUrl() |
SNMPSession |
getSNMPSession()
Returns an SNMP session that can be used to communicate with this server's SNMP agent.
|
static SNMPSession |
getSNMPSession(SNMPClient snmpClient,
org.rhq.core.domain.configuration.Configuration pluginConfig) |
boolean |
getUseBMX() |
void |
getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> schedules) |
OperationResult |
invokeOperation(String name,
org.rhq.core.domain.configuration.Configuration params) |
boolean |
isAugeasEnabled() |
org.rhq.core.domain.configuration.Configuration |
loadResourceConfiguration() |
static Map<String,String> |
parseBMXInput(String vHost,
String bmxUrl) |
ApacheDirectiveTree |
parseFullConfiguration() |
ApacheDirectiveTree |
parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings) |
ApacheDirectiveTree |
parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings,
boolean keepConditional) |
void |
start(ResourceContext<PlatformComponent> resourceContext) |
void |
stop() |
void |
updateResourceConfiguration(ConfigurationUpdateReport report) |
public static final String CONFIGURATION_NOT_SUPPORTED_ERROR_MESSAGE
public static final String PLUGIN_CONFIG_PROP_SERVER_ROOT
public static final String PLUGIN_CONFIG_PROP_EXECUTABLE_PATH
public static final String PLUGIN_CONFIG_PROP_CONTROL_SCRIPT_PATH
public static final String PLUGIN_CONFIG_PROP_URL
public static final String PLUGIN_CONFIG_PROP_BMX_URL
public static final String PLUGIN_CONFIG_PROP_HTTPD_CONF
public static final String AUGEAS_HTTP_MODULE_NAME
public static final String PLUGIN_CONFIG_PROP_SNMP_AGENT_HOST
public static final String PLUGIN_CONFIG_PROP_SNMP_AGENT_PORT
public static final String PLUGIN_CONFIG_PROP_SNMP_AGENT_COMMUNITY
public static final String PLUGIN_CONFIG_PROP_SNMP_REQUEST_TIMEOUT
public static final String PLUGIN_CONFIG_PROP_SNMP_REQUEST_RETRIES
public static final String PLUGIN_CONFIG_PROP_ERROR_LOG_FILE_PATH
public static final String PLUGIN_CONFIG_PROP_ERROR_LOG_EVENTS_ENABLED
public static final String PLUGIN_CONFIG_PROP_ERROR_LOG_MINIMUM_SEVERITY
public static final String PLUGIN_CONFIG_PROP_ERROR_LOG_INCLUDES_PATTERN
public static final String PLUGIN_CONFIG_PROP_VHOST_FILES_MASK
public static final String PLUGIN_CONFIG_PROP_VHOST_CREATION_POLICY
public static final String PLUGIN_CONFIG_PROP_RESTART_AFTER_CONFIG_UPDATE
public static final String PLUGIN_CONFIG_VHOST_IN_SINGLE_FILE_PROP_VALUE
public static final String PLUGIN_CONFIG_VHOST_PER_FILE_PROP_VALUE
public static final String PLUGIN_CONFIG_CUSTOM_MODULE_NAMES
public static final String PLUGIN_CONFIG_MODULE_MAPPING
public static final String PLUGIN_CONFIG_MODULE_NAME
public static final String PLUGIN_CONFIG_MODULE_SOURCE_FILE
public static final String AUXILIARY_INDEX_PROP
public static final String SERVER_BUILT_TRAIT
public static final String AUGEAS_ENABLED
public static final String DEFAULT_EXECUTABLE_PATH
public static final String DEFAULT_ERROR_LOG_PATH
public void start(ResourceContext<PlatformComponent> resourceContext) throws Exception
start in interface ResourceComponent<PlatformComponent>Exceptionpublic void stop()
stop in interface ResourceComponent<PlatformComponent>public String getBMXUrl()
public boolean getUseBMX()
public org.rhq.core.domain.measurement.AvailabilityType getAvailability()
getAvailability in interface AvailabilityFacetpublic void getValues(org.rhq.core.domain.measurement.MeasurementReport report,
Set<org.rhq.core.domain.measurement.MeasurementScheduleRequest> schedules)
throws Exception
getValues in interface MeasurementFacetExceptionpublic static Map<String,String> parseBMXInput(String vHost, String bmxUrl) throws Exception
Exception@Nullable public OperationResult invokeOperation(@NotNull String name, @NotNull org.rhq.core.domain.configuration.Configuration params) throws Exception
invokeOperation in interface OperationFacetExceptionpublic org.rhq.core.domain.configuration.Configuration loadResourceConfiguration()
throws Exception
loadResourceConfiguration in interface ConfigurationFacetExceptionpublic void updateResourceConfiguration(ConfigurationUpdateReport report)
updateResourceConfiguration in interface ConfigurationFacetpublic AugeasComponent getAugeas() throws AugeasTreeException
getAugeas in interface AugeasRHQComponentAugeasTreeExceptionpublic CreateResourceReport createResource(CreateResourceReport report)
createResource in interface CreateChildResourceFacet@NotNull public SNMPSession getSNMPSession() throws Exception
Exception - on failure to initialize the SNMP session@NotNull public static SNMPSession getSNMPSession(SNMPClient snmpClient, org.rhq.core.domain.configuration.Configuration pluginConfig) throws Exception
Exception@NotNull public File getServerRoot()
@NotNull public File getExecutablePath()
@Nullable public String getServerUrl()
public File getHttpdConfFile()
@NotNull public File getControlScriptPath()
@NotNull public ConfigurationTimestamp getConfigurationTimestamp()
public void finishConfigurationUpdate(ConfigurationUpdateReport report)
updateResourceConfiguration(ConfigurationUpdateReport)
of this resource and any child resources.
Based on the plugin configuration of this resource, the Apache instance is either restarted or left as is.report - the report is updated with the error message and status is set to failure if the restart fails.public void finishChildResourceCreate(CreateResourceReport report)
finishConfigurationUpdate(ConfigurationUpdateReport) but should
be used in the createResource(CreateResourceReport) method.report - the report is updated with the error message and status is set to failure if the restart fails.public void conditionalRestart()
throws Exception
Exception - if the restart fails.public void deleteEmptyFile(AugeasTree tree, AugeasNode deletedNode)
tree - TODOdeletedNode - the node that has been deleted from the tree.public ProcessInfo getCurrentProcessInfo()
public ApacheBinaryInfo getCurrentBinaryInfo()
public HttpdAddressUtility getAddressUtility()
public ApacheDirectiveTree parseFullConfiguration()
public ApacheDirectiveTree parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings)
public ApacheDirectiveTree parseRuntimeConfiguration(boolean suppressUnknownModuleWarnings, boolean keepConditional)
public boolean isAugeasEnabled()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.