org.rhq.enterprise.server.agentclient.impl
Class AgentClientImpl

java.lang.Object
  extended by org.rhq.enterprise.server.agentclient.impl.AgentClientImpl
All Implemented Interfaces:
AgentClient

public class AgentClientImpl
extends Object
implements AgentClient

Provides the mechanism by which you obtain remote interface proxies to a particular agent. Using those remote proxies, you can send commands to an agent.

Author:
John Mazzitelli

Constructor Summary
AgentClientImpl(org.rhq.core.domain.resource.Agent agent, ClientCommandSender sender)
          Constructor for AgentClientImpl.
 
Method Summary
 org.rhq.core.domain.resource.Agent getAgent()
          Returns the agent domain object which provides the information about the agent.
 BundleAgentService getBundleAgentService()
           
 ConfigurationAgentService getConfigurationAgentService()
           
 ContentAgentService getContentAgentService()
           
 DiscoveryAgentService getDiscoveryAgentService()
           
 DriftAgentService getDriftAgentService()
           
 MeasurementAgentService getMeasurementAgentService()
           
 OperationAgentService getOperationAgentService()
           
 ResourceFactoryAgentService getResourceFactoryAgentService()
           
 SupportAgentService getSupportAgentService()
           
 boolean ping(long timeoutMillis)
          Returns true if the agent is up and this client can communicate with it.
 void startSending()
          Puts this agent client in "sending mode" which enables this client to begin sending messages to the agent.
 void stopSending()
          Stops the agent client from sending messages.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentClientImpl

public AgentClientImpl(org.rhq.core.domain.resource.Agent agent,
                       ClientCommandSender sender)
Constructor for AgentClientImpl.

Parameters:
agent - the agent that this client will communicate with
sender - the object that is used to send commands to the given agent
Throws:
IllegalArgumentException - if agent or sender is null
Method Detail

getAgent

public org.rhq.core.domain.resource.Agent getAgent()
Description copied from interface: AgentClient
Returns the agent domain object which provides the information about the agent.

Specified by:
getAgent in interface AgentClient
Returns:
agent information

toString

public String toString()
Overrides:
toString in class Object

startSending

public void startSending()
Description copied from interface: AgentClient
Puts this agent client in "sending mode" which enables this client to begin sending messages to the agent. Calling this method will immediately begin sending messages that were flagged as guaranteed delivery and have yet to be successfully sent (that is, messages spooled will be flushed out to the agent).

Specified by:
startSending in interface AgentClient

stopSending

public void stopSending()
Description copied from interface: AgentClient
Stops the agent client from sending messages. Any messages sent asynchronously with guaranteed delivery will be spooled and sent the next time an agent client is started.

Specified by:
stopSending in interface AgentClient

ping

public boolean ping(long timeoutMillis)
Description copied from interface: AgentClient
Returns true if the agent is up and this client can communicate with it. This will return false if, for any reason, the agent cannot be pinged (which could mean the agent is down, or a network problem has occurred that prohibits the client from reaching the agent).

Specified by:
ping in interface AgentClient
Parameters:
timeoutMillis - the amount of time, in milliseconds, the caller wants to wait before considering the agent down
Returns:
true if the agent can be pinged; false if this client cannot communicate with the agent for some reason

getBundleAgentService

public BundleAgentService getBundleAgentService()
Specified by:
getBundleAgentService in interface AgentClient

getContentAgentService

public ContentAgentService getContentAgentService()
Specified by:
getContentAgentService in interface AgentClient

getResourceFactoryAgentService

public ResourceFactoryAgentService getResourceFactoryAgentService()
Specified by:
getResourceFactoryAgentService in interface AgentClient

getDiscoveryAgentService

public DiscoveryAgentService getDiscoveryAgentService()
Specified by:
getDiscoveryAgentService in interface AgentClient

getMeasurementAgentService

public MeasurementAgentService getMeasurementAgentService()
Specified by:
getMeasurementAgentService in interface AgentClient

getOperationAgentService

public OperationAgentService getOperationAgentService()
Specified by:
getOperationAgentService in interface AgentClient

getConfigurationAgentService

public ConfigurationAgentService getConfigurationAgentService()
Specified by:
getConfigurationAgentService in interface AgentClient

getSupportAgentService

public SupportAgentService getSupportAgentService()
Specified by:
getSupportAgentService in interface AgentClient

getDriftAgentService

public DriftAgentService getDriftAgentService()
Specified by:
getDriftAgentService in interface AgentClient


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