|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.core.AgentManagerBean
public class AgentManagerBean
Manages the access to Agent objects.
Some of these methods need to execute as fast as possible. So, @ExcludeDefaultInterceptors has been added
to all methods that don't explicitly need a permission check (those without Subject as the first parameter).
| Constructor Summary | |
|---|---|
AgentManagerBean()
|
|
| Method Summary | |
|---|---|
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 |
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. |
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()
The directory on the server's file system where the agent update version file and binary file are found. |
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)
Methods with page control are typically accessed by the GUI, as such apply permission check. |
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()
Returns a collection of all agents currently in inventory. |
boolean |
isAgentBackfilled(int agentId)
Returns true if the agent is "suspect" and has been backfilled. |
boolean |
isAgentVersionSupported(AgentVersion agentVersionInfo)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AgentManagerBean()
| Method Detail |
|---|
public void createAgent(org.rhq.core.domain.resource.Agent agent)
AgentManagerLocal
createAgent in interface AgentManagerLocalpublic void deleteAgent(org.rhq.core.domain.resource.Agent agent)
AgentManagerLocal
deleteAgent in interface AgentManagerLocalpublic org.rhq.core.domain.resource.Agent updateAgent(org.rhq.core.domain.resource.Agent agent)
AgentManagerLocal
updateAgent in interface AgentManagerLocalagent - the agent to be updated, with the new data in it
public AgentClient getAgentClient(org.rhq.core.domain.resource.Agent agent)
AgentManagerLocal
getAgentClient in interface AgentManagerLocalagent - a JON agent
public AgentClient getAgentClient(org.rhq.core.domain.auth.Subject subject,
int resourceId)
AgentManagerLocal
getAgentClient in interface AgentManagerLocalresourceId - the ID of the resource whose agent is to be returned
public void agentIsShuttingDown(String agentName)
AgentManagerLocalThis will usually be triggered when an agent explicitly tells us that it is shutting down. See
CoreServerService.agentIsShuttingDown(String).
agentIsShuttingDown in interface AgentManagerLocalagentName - the name of the agent that is going downpublic void agentIsAlive(org.rhq.core.domain.resource.Agent agent)
AgentManagerLocal
agentIsAlive in interface AgentManagerLocalagent - the agent that is confirmed alive and wellpublic void checkForSuspectAgents()
AgentManagerLocalCheckForSuspectedAgentsJob.
checkForSuspectAgents in interface AgentManagerLocalpublic List<org.rhq.core.domain.resource.Agent> getAllAgents()
AgentManagerLocal
getAllAgents in interface AgentManagerLocal
public 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)
getAgentsByServer in interface AgentManagerLocalserverId - the server to filter the agent list by. pass null to view unfiltered results.
public int getAgentCount()
AgentManagerLocal
getAgentCount in interface AgentManagerLocalpublic org.rhq.core.domain.resource.Agent getAgentByAgentToken(String token)
AgentManagerLocalAgent associated with that token. If the
given token is invalid, null is returned.
getAgentByAgentToken in interface AgentManagerLocaltoken - the agent token
null if there is no agent with the
given tokenpublic org.rhq.core.domain.resource.Agent getAgentByName(String agentName)
AgentManagerLocalAgent with that name. If no agent with the given
name exists, null is returned.
getAgentByName in interface AgentManagerLocalnull if there is no agent with the given namepublic org.rhq.core.domain.resource.Agent getAgentByID(int agentId)
AgentManagerLocalAgent with that id. If no agent with the given
name exists, null is returned.
getAgentByID in interface AgentManagerLocalnull if there is no agent with the given id
public org.rhq.core.domain.resource.Agent getAgentByAddressAndPort(String address,
int port)
AgentManagerLocalAgent associated with that address
and port. If no agent is found, null is returned.
getAgentByAddressAndPort in interface AgentManagerLocaladdress - the address that the agent is bound toport - the port at the given address that the agent is listening on
null if there is no agent with the
given token
public org.rhq.core.domain.resource.Agent getAgentByResourceId(org.rhq.core.domain.auth.Subject subject,
int resourceId)
AgentManagerLocal
getAgentByResourceId in interface AgentManagerLocalnull if the resource ID was invalidpublic Integer getAgentIdByResourceId(int resourceId)
AgentManagerLocal
getAgentIdByResourceId in interface AgentManagerLocalnull if the resource ID was invalidpublic Integer getAgentIdByName(String agentName)
AgentManagerLocal
getAgentIdByName in interface AgentManagerLocalnull if there is no agent with the given namepublic Integer getAgentIdByScheduleId(int scheduleId)
AgentManagerLocal
getAgentIdByScheduleId in interface AgentManagerLocalnull if the schedule ID was invalidpublic boolean isAgentVersionSupported(AgentVersion agentVersionInfo)
AgentManagerLocaltrue if this server can talk to any agent of the given version.
isAgentVersionSupported in interface AgentManagerLocalagentVersionInfo - the version of the agent to verify
true 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 returned
public File getAgentUpdateVersionFile()
throws Exception
AgentManagerLocal
getAgentUpdateVersionFile in interface AgentManagerLocalException - if the file could not be created or found
public Properties getAgentUpdateVersionFileContent()
throws Exception
AgentManagerLocal
getAgentUpdateVersionFileContent in interface AgentManagerLocalException - if cannot read the agent update version file
public File getAgentUpdateBinaryFile()
throws Exception
AgentManagerLocal
getAgentUpdateBinaryFile in interface AgentManagerLocalException - if the binary file does not exist
public File getAgentDownloadDir()
throws Exception
AgentManagerLocal
getAgentDownloadDir in interface AgentManagerLocalException - if could not determine the location or it does not exist
public void setAgentBackfilled(int agentId,
boolean backfilled)
setAgentBackfilled in interface AgentManagerLocalpublic boolean isAgentBackfilled(int agentId)
AgentManagerLocaltrue 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.
isAgentBackfilled in interface AgentManagerLocalagentId - the id of the agent
true if the agent is a suspect agent and has been backfilled
public Boolean pingAgentByResourceId(org.rhq.core.domain.auth.Subject subject,
int resourceId)
AgentManagerLocaltrue indicating successful ping of agent. Exposed so server could
initiate N requests so gwt clients wont face Single Origin Policy issues.
pingAgentByResourceId in interface AgentManagerLocaltrue if the agent was successfully pinged.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||