org.rhq.enterprise.agent
Class AgentUpdateVersion

java.lang.Object
  extended by org.rhq.enterprise.agent.AgentUpdateVersion

public class AgentUpdateVersion
extends Object

Checks to see if there is an software update for the agent and if so, retrieves the information on it.

Author:
John Mazzitelli

Constructor Summary
AgentUpdateVersion(AgentMain agent)
           
 
Method Summary
 AgentUpdateInformation getAgentUpdateInformation()
          Returns the last known agent update version information.
 URL getVersionUrl()
          Returns the URL that will be accessed to obtain the agent update version information.
 void refresh()
          Forces this object to refresh the agent update information by asking the server for the data again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentUpdateVersion

public AgentUpdateVersion(AgentMain agent)
Method Detail

getVersionUrl

public URL getVersionUrl()
                  throws Exception
Returns the URL that will be accessed to obtain the agent update version information.

Returns:
version URL
Throws:
Exception - if for some reason a valid URL could not be obtained

getAgentUpdateInformation

public AgentUpdateInformation getAgentUpdateInformation()
                                                 throws Exception
Returns the last known agent update version information. Note that the agent update information is cached; if you want this object to ask the server again for the version information, call refresh(). This method will, however, call refresh() for you if the information has not been retrieved at all yet.

Returns:
version information of both the update and the current agent
Throws:
Exception - if agent has disabled updates or it failed to get the update version information

refresh

public void refresh()
             throws Exception
Forces this object to refresh the agent update information by asking the server for the data again. This always sends a request to the server in order to force the update information to be retrieved again. After this method is called, you can retrieve the new information by calling the method getAgentUpdateInformation().

Throws:
Exception - if agent has disabled updates or it failed to get the update version information


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