public class ServerCommunicationsService extends Object implements ServerCommunicationsServiceMBean, MBeanRegistration
ServiceContainer. The main purpose for the
existence of this class is to bootstrap the comm services for the Server so remote CLI and Agent clients
can talk to the server.OBJECT_NAMEOBJECTNAME_METRICS| Constructor and Description |
|---|
ServerCommunicationsService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStartedAgent(org.rhq.core.domain.resource.Agent agent)
Given an
agent (which includes its remote endpoint and name), this will see if it is not yet a
known agent and if so, will add it. |
void |
clear() |
void |
destroyKnownAgentClient(org.rhq.core.domain.resource.Agent agent)
This will stop the client, remove it from the cache and clean up any resources used by the client.
|
List<org.jboss.remoting.InvokerLocator> |
getAllKnownAgents()
This returns a list of all known agents that the server is in communications with.
|
Integer |
getAvailabilityReportConcurrencyLimit()
Gets the concurrency limit for availability reports.
|
long |
getAverageExecutionTimeReceived() |
Map<String,CommandProcessorMetrics.Calltime> |
getCallTimeDataReceived() |
ServerConfiguration |
getConfiguration()
Returns the configuration of the server-side communication components.
|
String |
getConfigurationFile()
Returns the location of the configuration file where all preferences are defined for the server-side services.
|
String |
getConfigurationOverridesFile() |
Integer |
getConfigurationUpdateConcurrencyLimit()
Gets the concurrency limit for configuration updates.
|
Integer |
getContentDownloadConcurrencyLimit()
Gets the concurrency limit for content downloads.
|
Integer |
getContentReportConcurrencyLimit()
Gets the concurrency limit for content reports.
|
Integer |
getGlobalConcurrencyLimit()
Gets the global concurrency limit.
|
Integer |
getInventoryReportConcurrencyLimit()
Gets the concurrency limit for inventory reports.
|
Integer |
getInventorySyncConcurrencyLimit()
Gets the concurrency limit for inventory sync requests.
|
AgentClient |
getKnownAgentClient(org.rhq.core.domain.resource.Agent agent)
Given an agent domain object, this will see if that agent is known by looking up its host and port from the list
of all
known agents and returns a client to that agent. |
Boolean |
getMaintenanceModeAtStartup()
Returns
true if the server should always start up in maintenance mode. |
Integer |
getMeasurementReportConcurrencyLimit()
Gets the concurrency limit for measurement reports.
|
Integer |
getMeasurementScheduleRequestConcurrencyLimit()
Gets the concurrency limit for measurement reports.
|
long |
getNumberDroppedCommandsReceived() |
long |
getNumberFailedCommandsReceived() |
long |
getNumberNotProcessedCommandsReceived() |
long |
getNumberSuccessfulCommandsReceived() |
long |
getNumberTotalCommandsReceived() |
String |
getPreferencesNodeName()
Returns the preferences node name used to identify the configuration set to use.
|
ServiceContainer |
getServiceContainer()
Returns the service container that houses all the server-side communications services.
|
String |
getStartedServerEndpoint()
If the server is currently listening for requests, this will return the endpoint the agents should use to connect
to it.
|
Boolean |
isMaintenanceModeAtStartup()
|
boolean |
isStarted() |
boolean |
pingEndpoint(String endpoint,
long timeoutMillis)
This will perform an ad-hoc, low-level ping to the given endpoint.
|
void |
postDeregister()
Cleans up the internal state of this service.
|
void |
postRegister(Boolean arg0)
This method does nothing - it is a no-op.
|
void |
preDeregister()
This method does nothing - it is a no-op.
|
ObjectName |
preRegister(MBeanServer mbs,
ObjectName name)
Sets up some internal state.
|
ServerConfiguration |
reloadConfiguration()
This will clear any and all current configuration preferences and then reload the
configuration file. |
void |
removeDownedAgent(String endpoint)
Given an
agent remote endpoint, this will see if it is a known agent and if so,
will remove it. |
ServiceContainer |
safeGetServiceContainer()
Returns the service container that houses all the server-side communications services.
|
void |
setAvailabilityReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for availability reports.
|
void |
setConfigurationFile(String location)
Defines the location of the configuration file where all preferences are defined for the server-side services.
|
void |
setConfigurationOverridesFile(String location)
This allows you to explicitly override configuration preferences found in the configuration file.
|
void |
setConfigurationUpdateConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for configuration updates.
|
void |
setContentDownloadConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for content downloads.
|
void |
setContentReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for content reports.
|
void |
setGlobalConcurrencyLimit(Integer maxConcurrency)
Sets the global concurrency limit.
|
void |
setInventoryReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for inventory reports.
|
void |
setInventorySyncConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for inventory sync requests.
|
void |
setMaintenanceModeAtStartup(Boolean flag)
Sets the flag to indicate if the server should always start up in maintenance mode.
|
void |
setMeasurementReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for measurement reports.
|
void |
setMeasurementScheduleRequestConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for measurement schedule requests.
|
void |
setPreferencesNodeName(String node)
Defines the preferences node name used to identify the configuration set to use.
|
void |
startCommunicationServices()
Actually starts the communications services.
|
void |
stop()
Synchronized to ensure that the stop operation completes atomically.
|
public ObjectName preRegister(MBeanServer mbs, ObjectName name) throws Exception
preRegister in interface MBeanRegistrationExceptionMBeanRegistration.preRegister(MBeanServer, ObjectName)public void postRegister(Boolean arg0)
postRegister in interface MBeanRegistrationMBeanRegistration.postRegister(java.lang.Boolean)public void startCommunicationServices()
throws Exception
startCommunicationServices in interface ServerCommunicationsServiceMBeanException - if failed to start the server-side services successfullyServerCommunicationsServiceMBean.startCommunicationServices()public void stop()
stop in interface ServerCommunicationsServiceMBeanServerCommunicationsServiceMBean.stop()public boolean isStarted()
isStarted in interface ServerCommunicationsServiceMBeanServerCommunicationsServiceMBean.isStarted()public void preDeregister()
throws Exception
preDeregister in interface MBeanRegistrationExceptionMBeanRegistration.preDeregister()public void postDeregister()
postDeregister in interface MBeanRegistrationMBeanRegistration.postDeregister()public String getConfigurationFile()
ServerCommunicationsServiceMBeangetConfigurationFile in interface ServerCommunicationsServiceMBeanpublic void setConfigurationFile(String location)
ServerCommunicationsServiceMBeansetConfigurationFile in interface ServerCommunicationsServiceMBeanpublic String getPreferencesNodeName()
ServerCommunicationsServiceMBeangetPreferencesNodeName in interface ServerCommunicationsServiceMBeanpublic void setPreferencesNodeName(String node)
ServerCommunicationsServiceMBeanIf this isn't specified, a suitable default will be used.
setPreferencesNodeName in interface ServerCommunicationsServiceMBeannode - the name of the Java Preferences node where the server's configuration will or already livespublic String getConfigurationOverridesFile()
getConfigurationOverridesFile in interface ServerCommunicationsServiceMBeanpublic void setConfigurationOverridesFile(String location)
ServerCommunicationsServiceMBeansetConfigurationOverridesFile in interface ServerCommunicationsServiceMBeanpublic ServerConfiguration reloadConfiguration() throws Exception
ServerCommunicationsServiceMBeanconfiguration file.reloadConfiguration in interface ServerCommunicationsServiceMBeanException - if failed to clear and reload the configurationpublic ServerConfiguration getConfiguration()
ServerCommunicationsServiceMBeannull.getConfiguration in interface ServerCommunicationsServiceMBeanpublic ServiceContainer safeGetServiceContainer()
ServerCommunicationsServiceMBeansafeGetServiceContainer in interface ServerCommunicationsServiceMBeanpublic ServiceContainer getServiceContainer()
ServerCommunicationsServiceMBean
null if the serviceContainer has not been initialized. It is possible for this to be non-null
prior to server-side comm services initialization. Use isStarted() as necessary.getServiceContainer in interface ServerCommunicationsServiceMBeanpublic String getStartedServerEndpoint()
ServerCommunicationsServiceMBean
null.getStartedServerEndpoint in interface ServerCommunicationsServiceMBeanpublic AgentClient getKnownAgentClient(org.rhq.core.domain.resource.Agent agent)
ServerCommunicationsServiceMBeanknown agents and returns a client to that agent. An agent can become known if
it has been auto discovered.getKnownAgentClient in interface ServerCommunicationsServiceMBeanagent - the agent whose client is to be returnednull if that agent is not knownpublic void destroyKnownAgentClient(org.rhq.core.domain.resource.Agent agent)
ServerCommunicationsServiceMBeandestroyKnownAgentClient in interface ServerCommunicationsServiceMBeanagent - the agent whose client is to be destroyedpublic List<org.jboss.remoting.InvokerLocator> getAllKnownAgents()
ServerCommunicationsServiceMBeangetAllKnownAgents in interface ServerCommunicationsServiceMBeanpublic void addStartedAgent(org.rhq.core.domain.resource.Agent agent)
ServerCommunicationsServiceMBeanagent (which includes its remote endpoint and name), this will see if it is not yet a
known agent and if so, will add it. This should be called only when you know an agent has started.addStartedAgent in interface ServerCommunicationsServiceMBeanagent - the agent (which has the endpoint of the agent that has started and its name)public void removeDownedAgent(String endpoint)
ServerCommunicationsServiceMBeanagent remote endpoint, this will see if it is a known agent and if so,
will remove it. This should be called only when you know an agent has gone down.removeDownedAgent in interface ServerCommunicationsServiceMBeanendpoint - the endpoint of the agent that has gone downpublic boolean pingEndpoint(String endpoint, long timeoutMillis)
ServerCommunicationsServiceMBeanpingEndpoint in interface ServerCommunicationsServiceMBeanendpoint - the endpoint to pingtimeoutMillis - the timeout, in milliseconds, to wait for the ping to returntrue if connectivity to the given endpoint was verified; false if for some
reason the endpoint could not be pingedpublic Integer getGlobalConcurrencyLimit()
ServerCommunicationsServiceMBeangetGlobalConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setGlobalConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetGlobalConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getInventoryReportConcurrencyLimit()
ServerCommunicationsServiceMBeangetInventoryReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setInventoryReportConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetInventoryReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getAvailabilityReportConcurrencyLimit()
ServerCommunicationsServiceMBeangetAvailabilityReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setAvailabilityReportConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetAvailabilityReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getInventorySyncConcurrencyLimit()
ServerCommunicationsServiceMBeangetInventorySyncConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setInventorySyncConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetInventorySyncConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getContentReportConcurrencyLimit()
ServerCommunicationsServiceMBeangetContentReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setContentReportConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetContentReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getContentDownloadConcurrencyLimit()
ServerCommunicationsServiceMBeangetContentDownloadConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setContentDownloadConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetContentDownloadConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getMeasurementReportConcurrencyLimit()
ServerCommunicationsServiceMBeangetMeasurementReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setMeasurementReportConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetMeasurementReportConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getMeasurementScheduleRequestConcurrencyLimit()
ServerCommunicationsServiceMBeangetMeasurementScheduleRequestConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setMeasurementScheduleRequestConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetMeasurementScheduleRequestConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Integer getConfigurationUpdateConcurrencyLimit()
ServerCommunicationsServiceMBeangetConfigurationUpdateConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic void setConfigurationUpdateConcurrencyLimit(Integer maxConcurrency)
ServerCommunicationsServiceMBeansetConfigurationUpdateConcurrencyLimit in interface ServerCommunicationsServiceMBeanpublic Boolean getMaintenanceModeAtStartup()
ServerCommunicationsServiceMBeantrue if the server should always start up in maintenance mode.
If false, the server will startup in the same state it was in when it
was shutdown.getMaintenanceModeAtStartup in interface ServerCommunicationsServiceMBeantrue if the server should always start up in MMpublic Boolean isMaintenanceModeAtStartup()
ServerCommunicationsServiceMBeanisMaintenanceModeAtStartup in interface ServerCommunicationsServiceMBeantrue if server starts up in MMpublic void setMaintenanceModeAtStartup(Boolean flag)
ServerCommunicationsServiceMBeanServerCommunicationsServiceMBean.getMaintenanceModeAtStartup() for more.setMaintenanceModeAtStartup in interface ServerCommunicationsServiceMBeanpublic void clear()
clear in interface ServiceContainerMetricsMBeanpublic long getNumberDroppedCommandsReceived()
getNumberDroppedCommandsReceived in interface ServiceContainerMetricsMBeanpublic long getNumberNotProcessedCommandsReceived()
getNumberNotProcessedCommandsReceived in interface ServiceContainerMetricsMBeanpublic long getNumberFailedCommandsReceived()
getNumberFailedCommandsReceived in interface ServiceContainerMetricsMBeanpublic long getNumberSuccessfulCommandsReceived()
getNumberSuccessfulCommandsReceived in interface ServiceContainerMetricsMBeanpublic long getNumberTotalCommandsReceived()
getNumberTotalCommandsReceived in interface ServiceContainerMetricsMBeanpublic long getAverageExecutionTimeReceived()
getAverageExecutionTimeReceived in interface ServiceContainerMetricsMBeanpublic Map<String,CommandProcessorMetrics.Calltime> getCallTimeDataReceived()
getCallTimeDataReceived in interface ServiceContainerMetricsMBeanCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.