|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.hq.appdef.server.session.AppdefSessionUtil
org.hyperic.hq.appdef.server.session.AppdefSessionEJB
org.hyperic.hq.appdef.server.session.AgentManagerEJBImpl
public class AgentManagerEJBImpl
Field Summary |
---|
Fields inherited from class org.hyperic.hq.appdef.server.session.AppdefSessionEJB |
---|
_ctx, _ic |
Constructor Summary | |
---|---|
AgentManagerEJBImpl()
|
Method Summary | |
---|---|
void |
checkAgentAuth(java.lang.String agentToken)
Find an agent by the token which is Required for the agent to send when it connects. |
Agent |
createLegacyAgent(java.lang.String address,
java.lang.Integer port,
java.lang.String authToken,
java.lang.String agentToken,
java.lang.String version)
Create a new Agent object. |
Agent |
createNewTransportAgent(java.lang.String address,
java.lang.Integer port,
java.lang.String authToken,
java.lang.String agentToken,
java.lang.String version,
boolean unidirectional)
Create a new Agent object. |
void |
disconnectAgent(AgentConnections.AgentConnection a)
|
void |
ejbActivate()
|
void |
ejbCreate()
|
void |
ejbPassivate()
|
void |
ejbRemove()
|
Agent |
findAgent(java.lang.Integer id)
|
java.util.List |
findAgents(PageInfo pInfo)
Get a paged list of agents in the system. |
java.util.List |
findAgentsByIP(java.lang.String ip)
|
Agent |
getAgent(AppdefEntityID aID)
Find an agent which can service the given entity ID |
Agent |
getAgent(java.lang.Integer id)
Get an Agent by id. |
Agent |
getAgent(java.lang.String agentToken)
Find an agent by agent token. |
Agent |
getAgent(java.lang.String ip,
int port)
Find an agent listening on a specific IP & port |
AgentConnections.AgentConnection |
getAgentConnection(java.lang.String method,
java.lang.String connIp,
java.lang.Integer agentId)
|
int |
getAgentCount()
Get a count of all the agents in the system |
int |
getAgentCountUsed()
Get a count of the agents which are actually used (i.e. |
java.util.Map |
getAgentMap(java.util.Collection aeids)
|
protected AgentReportStatusDAO |
getAgentReportStatusDAO()
|
java.util.List |
getAgents()
Get a list of all the agents in the system |
protected AgentTypeDAO |
getAgentTypeDAO()
|
java.util.Collection |
getConnectedAgents()
|
java.lang.String |
getCurrentAgentBundle(AuthzSubject subject,
AppdefEntityID aid)
Return the bundle that is currently running on a give agent. |
ResourceTree |
getEntitiesForAgent(AuthzSubject subject,
java.lang.String agentToken)
Get a list of all the entities which can be serviced by an Agent. |
int |
getNumConnectedAgents()
|
static org.hyperic.hq.appdef.shared.AgentManagerLocal |
getOne()
|
long |
getTotalConnectedAgents()
|
boolean |
isAgentTokenUnique(java.lang.String agentToken)
Determine if the agent token is already assigned to another agent. |
long |
pingAgent(AuthzSubject subject,
Agent agent)
Pings the specified agent. |
long |
pingAgent(AuthzSubject subject,
AppdefEntityID id)
Pings the specified agent. |
void |
removeAgent(Agent agent)
|
void |
removeAgentStatus(Agent agent)
|
void |
restartAgent(AuthzSubject subject,
AppdefEntityID aid)
Restarts the specified agent using the Java Service Wrapper. |
void |
setSessionContext(javax.ejb.SessionContext ctx)
|
void |
transferAgentBundle(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String bundleFileName)
Transfer an agent bundle residing on the HQ server to an agent. |
void |
transferAgentBundleAsync(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String bundleFileName)
Transfer asynchronously an agent bundle residing on the HQ server to an agent. |
void |
transferAgentPlugin(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String plugin)
Transfer an agent plugin residing on the HQ server to an agent. |
void |
transferAgentPluginAsync(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String plugin)
Transfer an agent plugin residing on the HQ server to an agent. |
Agent |
updateLegacyAgent(java.lang.String ip,
int port,
java.lang.String authToken,
java.lang.String agentToken,
java.lang.String version)
Update an existing Agent given an IP and port. |
Agent |
updateLegacyAgent(java.lang.String agentToken,
java.lang.String ip,
int port)
Update an existing agent's IP and port based on an agent token. |
Agent |
updateLegacyAgent(java.lang.String agentToken,
java.lang.String ip,
int port,
java.lang.String authToken,
java.lang.String version)
Update an existing Agent given the old agent token. |
Agent |
updateNewTransportAgent(java.lang.String ip,
int port,
java.lang.String authToken,
java.lang.String agentToken,
java.lang.String version,
boolean unidirectional)
Update an existing Agent given an IP and port. |
Agent |
updateNewTransportAgent(java.lang.String agentToken,
java.lang.String ip,
int port,
boolean unidirectional)
Update an existing agent's IP and port based on an agent token. |
Agent |
updateNewTransportAgent(java.lang.String agentToken,
java.lang.String ip,
int port,
java.lang.String authToken,
java.lang.String version,
boolean unidirectional)
Update an existing Agent given the old agent token. |
void |
upgradeAgent(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String bundleFileName)
Upgrade an agent synchronously including agent restart. |
void |
upgradeAgentAsync(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String bundleFileName)
Upgrade an agent asynchronously including agent restart. |
void |
upgradeAgentBundle(AuthzSubject subject,
AppdefEntityID aid,
java.lang.String bundleFileName)
Upgrade to the specified agent bundle residing on the HQ agent. |
Methods inherited from class org.hyperic.hq.appdef.server.session.AppdefSessionUtil |
---|
findResourceType, findResourceType, getAgentDAO, getAIQManagerLocal, getApplicationDAO, getApplicationManager, getConfigManager, getConfigResponseDAO, getCPropManager, getPlatformDAO, getPlatformManager, getPlatformTypeDAO, getResourceManager, getServerDAO, getServerManager, getServerTypeDAO, getServiceDAO, getServiceManager, getServiceTypeDAO |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AgentManagerEJBImpl()
Method Detail |
---|
public void removeAgentStatus(Agent agent)
public void removeAgent(Agent agent)
public ResourceTree getEntitiesForAgent(AuthzSubject subject, java.lang.String agentToken) throws AgentNotFoundException, PermissionException
AgentNotFoundException
PermissionException
public java.util.List findAgents(PageInfo pInfo)
pInfo
- a pager object, with an AgentSortField
sort field
Agent
spublic java.util.List getAgents()
public int getAgentCount()
public int getAgentCountUsed()
public java.util.Map getAgentMap(java.util.Collection aeids)
aeids
- Collection
of AppdefEntityID
s
Agent
to Collection
of ${AppdefEntityID}spublic Agent createNewTransportAgent(java.lang.String address, java.lang.Integer port, java.lang.String authToken, java.lang.String agentToken, java.lang.String version, boolean unidirectional) throws AgentCreateException
AgentCreateException
public Agent createLegacyAgent(java.lang.String address, java.lang.Integer port, java.lang.String authToken, java.lang.String agentToken, java.lang.String version) throws AgentCreateException
AgentCreateException
public Agent updateNewTransportAgent(java.lang.String agentToken, java.lang.String ip, int port, java.lang.String authToken, java.lang.String version, boolean unidirectional) throws AgentNotFoundException
AgentNotFoundException
public Agent updateLegacyAgent(java.lang.String agentToken, java.lang.String ip, int port, java.lang.String authToken, java.lang.String version) throws AgentNotFoundException
AgentNotFoundException
public Agent updateNewTransportAgent(java.lang.String ip, int port, java.lang.String authToken, java.lang.String agentToken, java.lang.String version, boolean unidirectional) throws AgentNotFoundException
AgentNotFoundException
public Agent updateLegacyAgent(java.lang.String ip, int port, java.lang.String authToken, java.lang.String agentToken, java.lang.String version) throws AgentNotFoundException
AgentNotFoundException
public java.util.List findAgentsByIP(java.lang.String ip)
public Agent updateNewTransportAgent(java.lang.String agentToken, java.lang.String ip, int port, boolean unidirectional) throws AgentNotFoundException
agentToken
- Token that the agent uses to connect to HQip
- The new IP addressport
- The new port
AgentNotFoundException
public Agent updateLegacyAgent(java.lang.String agentToken, java.lang.String ip, int port) throws AgentNotFoundException
agentToken
- Token that the agent uses to connect to HQip
- The new IP addressport
- The new port
AgentNotFoundException
public void checkAgentAuth(java.lang.String agentToken) throws AgentUnauthorizedException
AgentUnauthorizedException
public AgentConnections.AgentConnection getAgentConnection(java.lang.String method, java.lang.String connIp, java.lang.Integer agentId)
public void disconnectAgent(AgentConnections.AgentConnection a)
public java.util.Collection getConnectedAgents()
public int getNumConnectedAgents()
public long getTotalConnectedAgents()
public Agent getAgent(java.lang.String ip, int port) throws AgentNotFoundException
AgentNotFoundException
public Agent getAgent(java.lang.String agentToken) throws AgentNotFoundException
agentToken
- the agent token to look for
AgentNotFoundException
public boolean isAgentTokenUnique(java.lang.String agentToken)
agentToken
- The agent token.
true
if the agent token is unique;
false
if it is already assigned to an agent.public Agent findAgent(java.lang.Integer id)
public Agent getAgent(java.lang.Integer id)
public Agent getAgent(AppdefEntityID aID) throws AgentNotFoundException
AgentNotFoundException
public java.lang.String getCurrentAgentBundle(AuthzSubject subject, AppdefEntityID aid) throws PermissionException, AgentNotFoundException, AgentRemoteException, AgentConnectionException
subject
- The subject issuing the request.aid
- The agent id.
PermissionException
- if the subject does not have proper permissions
to issue the query.
AgentNotFoundException
- if no agent exists with the given agent id.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.public void upgradeAgentAsync(AuthzSubject subject, AppdefEntityID aid, java.lang.String bundleFileName) throws PermissionException, java.io.FileNotFoundException, AgentNotFoundException, ConfigPropertyException, java.lang.InterruptedException
subject
- The subject issuing the request.aid
- The agent id.bundleFileName
- The agent bundle name.
PermissionException
- if the subject does not have proper permissions
to issue an agent upgrade.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.
java.lang.InterruptedException
- if enqueuing the Zevent is interrupted.public void upgradeAgent(AuthzSubject subject, AppdefEntityID aid, java.lang.String bundleFileName) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, java.io.FileNotFoundException, ConfigPropertyException, java.io.IOException
subject
- The subject issuing the request.aid
- The agent id.bundleFileName
- The agent bundle name.
PermissionException
- if the subject does not have proper permissions
to issue an agent upgrade command.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.public void transferAgentBundleAsync(AuthzSubject subject, AppdefEntityID aid, java.lang.String bundleFileName) throws PermissionException, AgentNotFoundException, java.io.FileNotFoundException, ConfigPropertyException, java.lang.InterruptedException
subject
- The subject issuing the request.aid
- The agent id.bundleFileName
- The agent bundle name.
PermissionException
- if the subject does not have proper permissions
to issue an agent bundle transfer.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.
java.lang.InterruptedException
- if enqueuing the Zevent is interrupted.public void transferAgentBundle(AuthzSubject subject, AppdefEntityID aid, java.lang.String bundleFileName) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, java.io.FileNotFoundException, java.io.IOException, ConfigPropertyException
subject
- The subject issuing the request.aid
- The agent id.bundleFileName
- The agent bundle name.
PermissionException
- if the subject does not have proper permissions
to issue an agent bundle transfer.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.public void transferAgentPlugin(AuthzSubject subject, AppdefEntityID aid, java.lang.String plugin) throws PermissionException, AgentConnectionException, AgentNotFoundException, AgentRemoteException, java.io.FileNotFoundException, java.io.IOException, ConfigPropertyException
subject
- The subject issuing the request.aid
- The agent id.plugin
- The plugin name.
PermissionException
- if the subject does not have proper permissions
to issue an agent plugin transfer.
java.io.FileNotFoundException
- if the plugin is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
public void transferAgentPluginAsync(AuthzSubject subject, AppdefEntityID aid, java.lang.String plugin) throws PermissionException, java.io.FileNotFoundException, AgentNotFoundException, java.lang.InterruptedException
subject
- The subject issuing the request.aid
- The agent id.plugin
- The plugin name.
PermissionException
- if the subject does not have proper permissions
to issue an agent plugin transfer.
java.io.FileNotFoundException
- if the plugin is not found on the HQ server.
AgentNotFoundException
- if no agent exists with the given agent id.
java.lang.InterruptedException
- if enqueuing the Zevent is interrupted.public void upgradeAgentBundle(AuthzSubject subject, AppdefEntityID aid, java.lang.String bundleFileName) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, java.io.FileNotFoundException, java.io.IOException, ConfigPropertyException
subject
- The subject issuing the request.aid
- The agent id.bundleFileName
- The agent bundle name.
PermissionException
- if the subject does not have proper permissions
to issue an agent bundle transfer.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.public void restartAgent(AuthzSubject subject, AppdefEntityID aid) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, java.io.FileNotFoundException, java.io.IOException, ConfigPropertyException
subject
- The subject issuing the request.aid
- The agent id.
PermissionException
- if the subject does not have proper permissions
to issue an agent bundle transfer.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.public long pingAgent(AuthzSubject subject, AppdefEntityID id) throws AgentNotFoundException, PermissionException, AgentConnectionException, java.io.IOException, ConfigPropertyException, AgentRemoteException
AgentNotFoundException
PermissionException
AgentConnectionException
java.io.IOException
ConfigPropertyException
AgentRemoteException
pingAgent(org.hyperic.hq.authz.server.session.AuthzSubject, org.hyperic.hq.appdef.Agent)
public long pingAgent(AuthzSubject subject, Agent agent) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, java.io.IOException, ConfigPropertyException
subject
- The subject issuing the request.aid
- The agent id.
PermissionException
- if the subject does not have proper permissions
to issue an agent bundle transfer.
java.io.FileNotFoundException
- if the agent bundle is not found on the HQ server.
java.io.IOException
- if an I/O error occurs, such as failing to calculate
the file MD5 checksum.
AgentRemoteException
- if an exception occurs on the remote agent side.
AgentConnectionException
- if the connection to the agent fails.
AgentNotFoundException
- if no agent exists with the given agent id.
ConfigPropertyException
- if the server configuration cannot be retrieved.public static org.hyperic.hq.appdef.shared.AgentManagerLocal getOne()
public void ejbCreate() throws javax.ejb.CreateException
javax.ejb.CreateException
public void ejbRemove()
ejbRemove
in interface javax.ejb.SessionBean
public void ejbActivate()
ejbActivate
in interface javax.ejb.SessionBean
public void ejbPassivate()
ejbPassivate
in interface javax.ejb.SessionBean
public void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext
in interface javax.ejb.SessionBean
setSessionContext
in class AppdefSessionEJB
protected AgentTypeDAO getAgentTypeDAO()
protected AgentReportStatusDAO getAgentReportStatusDAO()
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |