org.rhq.enterprise.server.core.comm
Interface ServerCommunicationsServiceMBean

All Superinterfaces:
ServiceContainerMetricsMBean
All Known Implementing Classes:
ServerCommunicationsService

public interface ServerCommunicationsServiceMBean
extends ServiceContainerMetricsMBean

The interface to the MBean that manages the server-side communications services. Note that this also includes the ServiceContainerMetricsMBean interface. In order to put all of our comm subsystem metrics and configuration in a single service resource that our plugin can expose, we'll pass through those metrics from that MBean through our interface, too.

Author:
John Mazzitelli

Field Summary
static ObjectName OBJECT_NAME
          The object name that the MBean service will be registered under.
 
Fields inherited from interface org.rhq.enterprise.communications.ServiceContainerMetricsMBean
OBJECTNAME_METRICS
 
Method Summary
 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 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.
 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.
 Properties getConfigurationOverrides()
          Returns a set of properties that will override the configuration preferences.
 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.
 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()
          Same as getMaintenanceModeAtStartup().
 boolean isStarted()
           
 boolean pingEndpoint(String endpoint, long timeoutMillis)
          This will perform an ad-hoc, low-level ping to the given endpoint.
 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 setConfigurationOverrides(Properties overrides)
          This allows you to explicitly override configuration preferences found in the configuration file.
 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()
          Starts the communications services used by the server to send and receive messages to/from agents.
 void stop()
          Stops the service which will stop all server-side services.
 
Methods inherited from interface org.rhq.enterprise.communications.ServiceContainerMetricsMBean
clear, getAverageExecutionTimeReceived, getCallTimeDataReceived, getNumberDroppedCommandsReceived, getNumberFailedCommandsReceived, getNumberNotProcessedCommandsReceived, getNumberSuccessfulCommandsReceived, getNumberTotalCommandsReceived
 

Field Detail

OBJECT_NAME

static final ObjectName OBJECT_NAME
The object name that the MBean service will be registered under.

Method Detail

getConfigurationFile

String getConfigurationFile()
Returns the location of the configuration file where all preferences are defined for the server-side services. The file location can be either a URL, a local file system path or a path within this service's classloader.

Returns:
configuration file location

setConfigurationFile

void setConfigurationFile(String location)
Defines the location of the configuration file where all preferences are defined for the server-side services. The file location can be either a URL, a local file system path or a path within this service's classloader.

Parameters:
location -

getPreferencesNodeName

String getPreferencesNodeName()
Returns the preferences node name used to identify the configuration set to use. See the Java Preferences API for the definition of a preference node name.

Returns:
the name of the Java Preferences node where the server's configuration lives

setPreferencesNodeName

void setPreferencesNodeName(String node)
Defines the preferences node name used to identify the configuration set to use. See the Java Preferences API for the definition of a preference node name.

If this isn't specified, a suitable default will be used.

Parameters:
node - the name of the Java Preferences node where the server's configuration will or already lives

getConfigurationOverrides

Properties getConfigurationOverrides()
Returns a set of properties that will override the configuration preferences. If this returns null, then the configuration preferences takes effect as-is.

Returns:
configuration setting overrides (may be null)

setConfigurationOverrides

void setConfigurationOverrides(Properties overrides)
This allows you to explicitly override configuration preferences found in the configuration file. If this isn't set, then the settings specified by the configuration preferences file take effect as-is. These overrides can be set in the bootstrap deployment file (and thus allow you to be able to use any app-server specific settings, like ${jboss.server.data.dir}, in the configuration preference values).

Parameters:
overrides - configuration settings that override the configuration preferences (may benull)

reloadConfiguration

ServerConfiguration reloadConfiguration()
                                        throws Exception
This will clear any and all current configuration preferences and then reload the configuration file.

Returns:
the new server configuration
Throws:
Exception - if failed to clear and reload the configuration

getConfiguration

ServerConfiguration getConfiguration()
Returns the configuration of the server-side communication components. If the configuration has not yet been loaded, this will return null.

Returns:
the server configuration

startCommunicationServices

void startCommunicationServices()
                                throws Exception
Starts the communications services used by the server to send and receive messages to/from agents.

Throws:
Exception - if failed to start the server-side services successfully

stop

void stop()
          throws Exception
Stops the service which will stop all server-side services. Incoming messages will no longer be able to be received after this method is called.

Throws:
Exception - if failed to stop the server-side services

isStarted

boolean isStarted()
Returns:
true if communication services have been started. False if not initialized or stopped.

safeGetServiceContainer

ServiceContainer safeGetServiceContainer()
Returns the service container that houses all the server-side communications services. Will create a service container for the comm services if one has not yet been created. This is typically only called to add or remove listeners prior to comm service startup. Use isStarted() as necessary.

Returns:
service container object

getServiceContainer

ServiceContainer getServiceContainer()
Returns the service container that houses all the server-side communications services. Will return 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.

Returns:
service container object

getStartedServerEndpoint

String getStartedServerEndpoint()
If the server is currently listening for requests, this will return the endpoint the agents should use to connect to it. If the server's underlying communications services are not deployed and running, this returns null.

Returns:
the server's remote endpoint that agents use to connect to the server

getKnownAgentClient

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. An agent can become known if it has been auto discovered.

Parameters:
agent - the agent whose client is to be returned
Returns:
the agent client; will be null if that agent is not known

destroyKnownAgentClient

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. This is normally called when an agent has been completely removed from inventory.

Parameters:
agent - the agent whose client is to be destroyed

getAllKnownAgents

List<org.jboss.remoting.InvokerLocator> getAllKnownAgents()
This returns a list of all known agents that the server is in communications with.

Returns:
the list of agents (which may or may not be empty)

addStartedAgent

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. This should be called only when you know an agent has started.

Parameters:
agent - the agent (which has the endpoint of the agent that has started and its name)

removeDownedAgent

void removeDownedAgent(String endpoint)
Given an agent 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.

Parameters:
endpoint - the endpoint of the agent that has gone down

pingEndpoint

boolean pingEndpoint(String endpoint,
                     long timeoutMillis)
This will perform an ad-hoc, low-level ping to the given endpoint. This is usually reserved for those callers that need to confirm that an endpoint exists and can be communicated with, before being added as an official agent endpoint.

Parameters:
endpoint - the endpoint to ping
timeoutMillis - the timeout, in milliseconds, to wait for the ping to return
Returns:
true if connectivity to the given endpoint was verified; false if for some reason the endpoint could not be pinged

getGlobalConcurrencyLimit

Integer getGlobalConcurrencyLimit()
Gets the global concurrency limit. This is the amount of messages that the server will allow to be processed concurrently - the type of message doesn't matter, this is the global maximum of any and all messages that are allowed to be concurrently accepted.

Returns:
number of concurrent calls allowed

setGlobalConcurrencyLimit

void setGlobalConcurrencyLimit(Integer maxConcurrency)
Sets the global concurrency limit. This is the amount of messages that the server will allow to be processed concurrently - the type of message doesn't matter, this is the global maximum of any and all messages that are allowed to be concurrently accepted.

Parameters:
maxConcurrency -

getInventoryReportConcurrencyLimit

Integer getInventoryReportConcurrencyLimit()
Gets the concurrency limit for inventory reports. This is the amount of inventory reports that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setInventoryReportConcurrencyLimit

void setInventoryReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for inventory reports. This new number is the amount of inventory reports that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getAvailabilityReportConcurrencyLimit

Integer getAvailabilityReportConcurrencyLimit()
Gets the concurrency limit for availability reports. This is the amount of availability reports that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setAvailabilityReportConcurrencyLimit

void setAvailabilityReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for availability reports. This new number is the amount of availability reports that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getInventorySyncConcurrencyLimit

Integer getInventorySyncConcurrencyLimit()
Gets the concurrency limit for inventory sync requests. This is the amount of inventory sync requests that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setInventorySyncConcurrencyLimit

void setInventorySyncConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for inventory sync requests. This new number is the amount of inventory sync requests that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getContentReportConcurrencyLimit

Integer getContentReportConcurrencyLimit()
Gets the concurrency limit for content reports. This is the amount of content reports that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setContentReportConcurrencyLimit

void setContentReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for content reports. This new number is the amount of content reports that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getContentDownloadConcurrencyLimit

Integer getContentDownloadConcurrencyLimit()
Gets the concurrency limit for content downloads. This is the amount of downloads that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setContentDownloadConcurrencyLimit

void setContentDownloadConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for content downloads. This new number is the amount of downloads that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getMeasurementReportConcurrencyLimit

Integer getMeasurementReportConcurrencyLimit()
Gets the concurrency limit for measurement reports. This is the amount of measurement reports that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setMeasurementReportConcurrencyLimit

void setMeasurementReportConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for measurement reports. This new number is the amount of measurement reports that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getMeasurementScheduleRequestConcurrencyLimit

Integer getMeasurementScheduleRequestConcurrencyLimit()
Gets the concurrency limit for measurement reports. This is the amount of measurement reports that the server will allow to be processed concurrently.

Returns:
number of concurrent calls allowed

setMeasurementScheduleRequestConcurrencyLimit

void setMeasurementScheduleRequestConcurrencyLimit(Integer maxConcurrency)
Sets the new concurrency limit for measurement schedule requests. This new number is the amount of measurement schedule requests that the server will allow to be processed concurrently.

Parameters:
maxConcurrency -

getMaintenanceModeAtStartup

Boolean getMaintenanceModeAtStartup()
Returns true 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.

Returns:
true if the server should always start up in MM

isMaintenanceModeAtStartup

Boolean isMaintenanceModeAtStartup()
Same as getMaintenanceModeAtStartup().

Returns:
true if server starts up in MM

setMaintenanceModeAtStartup

void setMaintenanceModeAtStartup(Boolean flag)
Sets the flag to indicate if the server should always start up in maintenance mode. See getMaintenanceModeAtStartup() for more.

Parameters:
flag -


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.