public interface AgentManagerLocal
AgentManagerBean SLSB.| Modifier and Type | Method and Description |
|---|---|
void |
agentIsAlive(org.rhq.core.domain.resource.Agent agent)
This method should only be called when it is confirmed that an agent is alive.
|
void |
agentIsShuttingDown(String agentName)
This method is called whenever an agent is going down.
|
void |
backfillAgentInNewTransaction(org.rhq.core.domain.auth.Subject subject,
String agentName,
int agentId)
Call this method to set the agent DOWN and mark it 'backfilled'.
|
void |
checkForSuspectAgents()
Call this method to see if there are agents that we might suspect are down.
|
void |
createAgent(org.rhq.core.domain.resource.Agent agent)
Persists a new agent.
|
void |
deleteAgent(org.rhq.core.domain.resource.Agent agent)
Deletes an existing agent.
|
void |
destroyAgentClient(org.rhq.core.domain.resource.Agent agent)
Throws away any known agent client that has been cached.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.Agent> |
findAgentsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.AgentCriteria criteria)
Fetches the agents based on provided criteria.
|
org.rhq.core.domain.resource.Agent |
getAgentByAddressAndPort(String address,
int port)
Given an agent's address and port, this will look up and return the
Agent associated with that address
and port. |
org.rhq.core.domain.resource.Agent |
getAgentByAgentToken(String token)
Given an agent token string, this will look up and return the
Agent associated with that token. |
org.rhq.core.domain.resource.Agent |
getAgentByID(int agentId)
Given an agent id, this will look up and return the
Agent with that id. |
org.rhq.core.domain.resource.Agent |
getAgentByName(String agentName)
Given an agent name, this will look up and return the
Agent with that name. |
org.rhq.core.domain.resource.Agent |
getAgentByResourceId(org.rhq.core.domain.auth.Subject subject,
int resourceId)
Given a resource ID, this will return the agent responsible for servicing that resource.
|
AgentClient |
getAgentClient(org.rhq.core.domain.resource.Agent agent)
Returns an agent client that can be used to send commands to the specified JON agent.
|
AgentClient |
getAgentClient(org.rhq.core.domain.auth.Subject subject,
int resourceId)
Returns an agent client that can be used to send commands to the JON agent that managed the specified resource.
|
int |
getAgentCount()
Returns the total number of agents that are in inventory.
|
File |
getAgentDownloadDir()
Deprecated.
|
Integer |
getAgentIdByName(String agentName)
Given an agent name, this will return the agent id.
|
Integer |
getAgentIdByResourceId(int resourceId)
Given a resource ID, this will return the agent id responsible for servicing that resource.
|
Integer |
getAgentIdByScheduleId(int scheduleId)
Given a schedule ID, this will return the agent responsible for servicing that scheduleId.
|
org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.Agent> |
getAgentsByServer(org.rhq.core.domain.auth.Subject subject,
Integer serverId,
org.rhq.core.domain.util.PageControl pageControl)
Deprecated.
Use
findAgentsByCriteria() instead |
File |
getAgentUpdateBinaryFile()
Returns the path on the server's file system where the agent update binary is found.
|
File |
getAgentUpdateVersionFile()
Returns the path on the server's file system where the agent update version file is found.
|
Properties |
getAgentUpdateVersionFileContent()
Returns the content of the agent update version file, which simply consists
of some name/value pairs.
|
List<org.rhq.core.domain.resource.Agent> |
getAllAgents()
Deprecated.
Use
findAgentsByCriteria() instead |
PingRequest |
handlePingRequest(PingRequest request)
Process a ping request from an agent, performing any requested actions and returning any requested data.
|
boolean |
isAgentBackfilled(int agentId)
Returns
true if the agent is "suspect" and has been backfilled. |
boolean |
isAgentVersionSupported(AgentVersion agentVersion)
Determines if the given agent version is supported by this server.
|
Boolean |
pingAgentByResourceId(org.rhq.core.domain.auth.Subject subject,
int resourceId)
Returns
true indicating successful ping of agent. |
void |
setAgentBackfilled(int agentId,
boolean backfilled) |
org.rhq.core.domain.resource.Agent |
updateAgent(org.rhq.core.domain.resource.Agent agent)
Updates an existing agent.
|
void backfillAgentInNewTransaction(org.rhq.core.domain.auth.Subject subject,
String agentName,
int agentId)
subject - agentName - agentId - void createAgent(org.rhq.core.domain.resource.Agent agent)
agent - void destroyAgentClient(org.rhq.core.domain.resource.Agent agent)
agent - the agent whose client is to be destroyed.org.rhq.core.domain.resource.Agent updateAgent(org.rhq.core.domain.resource.Agent agent)
agent - the agent to be updated, with the new data in itvoid deleteAgent(org.rhq.core.domain.resource.Agent agent)
agent - @NotNull AgentClient getAgentClient(@NotNull org.rhq.core.domain.resource.Agent agent)
agent - a JON agent@NotNull AgentClient getAgentClient(org.rhq.core.domain.auth.Subject subject, int resourceId)
resourceId - the ID of the resource whose agent is to be returnedList<org.rhq.core.domain.resource.Agent> getAllAgents()
findAgentsByCriteria() insteadorg.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.Agent> getAgentsByServer(org.rhq.core.domain.auth.Subject subject,
Integer serverId,
org.rhq.core.domain.util.PageControl pageControl)
findAgentsByCriteria() insteadserverId - the server to filter the agent list by. pass null to view unfiltered results.int getAgentCount()
org.rhq.core.domain.resource.Agent getAgentByName(String agentName)
Agent with that name. If no agent with the given
name exists, null is returned.
This method is very efficient if you want to find a single agent by its name.
If you need to get more than one agent, you could use findAgentsByCriteria.agentName - null if there is no agent with the given nameorg.rhq.core.domain.resource.Agent getAgentByID(int agentId)
Agent with that id. If no agent with the given
name exists, null is returned.
This method is very efficient if you want to find a single agent by its ID.
If you need to get more than one agent, you could use findAgentsByCriteria.agentId - null if there is no agent with the given idorg.rhq.core.domain.resource.Agent getAgentByAgentToken(String token)
Agent associated with that token. If the
given token is invalid, null is returned.
This method is very efficient if you want to find a single agent by its token.
If you need to get more than one agent, you could use findAgentsByCriteria.token - the agent tokennull if there is no agent with the
given tokenorg.rhq.core.domain.resource.Agent getAgentByAddressAndPort(String address, int port)
Agent associated with that address
and port. If no agent is found, null is returned.
This method is very efficient if you want to find a single agent by its endpoint.
If you need to get more than one agent, you could use findAgentsByCriteria.address - the address that the agent is bound toport - the port at the given address that the agent is listening onnull if there is no agent with the
given tokenorg.rhq.core.domain.resource.Agent getAgentByResourceId(org.rhq.core.domain.auth.Subject subject,
int resourceId)
subject - resourceId - null if the resource ID was invalidInteger getAgentIdByResourceId(int resourceId)
resourceId - null if the resource ID was invalidInteger getAgentIdByName(String agentName)
agentName - null if there is no agent with the given nameInteger getAgentIdByScheduleId(int scheduleId)
scheduleId - null if the schedule ID was invalidvoid agentIsShuttingDown(String agentName)
This will usually be triggered when an agent explicitly tells us that it is shutting down. See
CoreServerService.agentIsShuttingDown(String).
agentName - the name of the agent that is going downvoid agentIsAlive(org.rhq.core.domain.resource.Agent agent)
agent - the agent that is confirmed alive and wellvoid checkForSuspectAgents()
CheckForSuspectedAgentsJob.boolean isAgentVersionSupported(AgentVersion agentVersion)
true if this server can talk to any agent of the given version.agentVersion - the version of the agent to verifytrue if this server can support an agent with the given version; if the server
knows it cannot communicate successfully with an agent of that version, false
will be returnedFile getAgentUpdateVersionFile() throws Exception
Exception - if the file could not be created or foundProperties getAgentUpdateVersionFileContent() throws Exception
Exception - if cannot read the agent update version fileFile getAgentUpdateBinaryFile() throws Exception
Exception - if the binary file does not exist@Deprecated File getAgentDownloadDir() throws Exception
Exceptionvoid setAgentBackfilled(int agentId,
boolean backfilled)
boolean isAgentBackfilled(int agentId)
true if the agent is "suspect" and has been backfilled. A "suspect agent" means one that the
server suspects is down. When an agent is suspect, all of its resources, including the platform, will be
backfilled with DOWN availabilities.agentId - the id of the agenttrue if the agent is a suspect agent and has been backfilledBoolean pingAgentByResourceId(org.rhq.core.domain.auth.Subject subject, int resourceId)
true indicating successful ping of agent. Exposed so server could
initiate N requests so gwt clients wont face Single Origin Policy issues.agentId - the id of the agenttrue if the agent was successfully pinged.PingRequest handlePingRequest(PingRequest request)
request - org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.Agent> findAgentsByCriteria(org.rhq.core.domain.auth.Subject subject,
org.rhq.core.domain.criteria.AgentCriteria criteria)
subject - callercriteria - the criteriaCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.