modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentManagerLocal.java | 14 ++++++---- 1 file changed, 9 insertions(+), 5 deletions(-)
New commits: commit 93fb46966bfce20ec918191ec78408d20ce6b010 Author: John Mazzitelli mazz@redhat.com Date: Thu Feb 21 10:35:59 2013 -0500
don't deprecate these methods - criteria is nice, but these specific methods are very efficient and can be used when we need to eek out as much performance as possible. no need to go through the criteria API just to get a single agent using very targeted WHERE conditions.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentManagerLocal.java index 842d5d8..7e2c3b9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentManagerLocal.java @@ -134,47 +134,51 @@ public interface AgentManagerLocal { /** * Given an agent name, this will look up and return the {@link Agent} with that name. If no agent with the given * name exists, <code>null</code> 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 <code>findAgentsByCriteria</code>. + * * @param agentName * * @return the agent whose name matches the given name; <code>null</code> if there is no agent with the given name - * @deprecated Use <code>findAgentsByCriteria()</code> instead */ Agent getAgentByName(String agentName);
/** * Given an agent id, this will look up and return the {@link Agent} with that id. If no agent with the given * name exists, <code>null</code> 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 <code>findAgentsByCriteria</code>. * * @param agentId * * @return the agent whose id matches the given id; <code>null</code> if there is no agent with the given id - * @deprecated Use <code>findAgentsByCriteria()</code> instead */ Agent getAgentByID(int agentId);
/** * Given an agent token string, this will look up and return the {@link Agent} associated with that token. If the * given token is invalid, <code>null</code> 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 <code>findAgentsByCriteria</code>. * * @param token the agent token * * @return the agent whose agent token matches the given token; <code>null</code> if there is no agent with the * given token - * @deprecated Use <code>findAgentsByCriteria()</code> instead */ Agent getAgentByAgentToken(String token);
/** * Given an agent's address and port, this will look up and return the {@link Agent} associated with that address * and port. If no agent is found, <code>null</code> 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 <code>findAgentsByCriteria</code>. * * @param address the address that the agent is bound to * @param port the port at the given address that the agent is listening on * * @return the agent to be known at the given address and port; <code>null</code> if there is no agent with the * given token - * @deprecated Use <code>findAgentsByCriteria()</code> instead */ Agent getAgentByAddressAndPort(String address, int port);
rhq-commits@lists.fedorahosted.org