org.rhq.enterprise.agent
Class AgentUpdateInformation

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

public class AgentUpdateInformation
extends Object

Encapsulates all the version information known about the agent update and the current agent.

Author:
John Mazzitelli

Constructor Summary
AgentUpdateInformation(Properties updateProps)
          Builds the information object.
 
Method Summary
 String getAgentBuild()
           
 String getAgentVersion()
           
 String getUpdateBuild()
           
 String getUpdateMd5()
           
 String getUpdateVersion()
           
 boolean isAgentOutOfDate()
          Returns true if the current agent's version is lower than the update's version.
 boolean isAgentOutOfDateStrict()
          Returns true if the current agent's version is lower than the update's version.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentUpdateInformation

public AgentUpdateInformation(Properties updateProps)
Builds the information object.

Parameters:
updateProps - properties known about the agent update. This information must be retrieved from the server.
Method Detail

isAgentOutOfDate

public boolean isAgentOutOfDate()
Returns true if the current agent's version is lower than the update's version. This method does not compare build numbers - see isAgentOutOfDateStrict() for that.

Returns:
true if the agent's version is older than the update's version

isAgentOutOfDateStrict

public boolean isAgentOutOfDateStrict()
Returns true if the current agent's version is lower than the update's version. If they are equal, the agent's build number is compared to the update's build number and true will be returned if the agent's build number is less than the update's build number. If either build number could not be determined or is invalid, they will be ignored which causes this method to return false since the version strings must be equal for this method to even look at the build numbers. To compare only version strings and ignore build numbers, see isAgentOutOfDate().

Returns:
true if the agent's version/build is older than the update's version/build

getAgentVersion

public String getAgentVersion()

getAgentBuild

public String getAgentBuild()

getUpdateVersion

public String getUpdateVersion()

getUpdateBuild

public String getUpdateBuild()

getUpdateMd5

public String getUpdateMd5()

toString

public String toString()
Overrides:
toString in class Object


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