org.rhq.enterprise.communications.command.impl.identify
Class Identification

java.lang.Object
  extended by org.rhq.enterprise.communications.command.impl.identify.Identification
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AgentIdentification, ServerIdentification

public abstract class Identification
extends Object
implements Serializable

Identification information that is common for both types of remote endpoints: an agent or server.

Author:
John Mazzitelli
See Also:
Serialized Form

Field Summary
static String TYPE_AGENT
          The type string that identifies the remote endpoint as an Agent.
static String TYPE_SERVER
          The type string that identifies the remote endpoint as a Server.
 
Constructor Summary
Identification(String type, String locator)
          Constructor for Identification.
 
Method Summary
 boolean equals(Object obj)
          Determines equality based solely on the type and locator.
 String getInvokerLocator()
          Returns the locator endpoint of the remoting server that is being identified.
 long getTimestamp()
          Returns the epoch milliseconds of the identified endpoint.
 String getType()
          Returns the type of the remoting server that is being identified.
 int hashCode()
          Determines hash based solely on the type and locator.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_AGENT

public static final String TYPE_AGENT
The type string that identifies the remote endpoint as an Agent.

See Also:
Constant Field Values

TYPE_SERVER

public static final String TYPE_SERVER
The type string that identifies the remote endpoint as a Server.

See Also:
Constant Field Values
Constructor Detail

Identification

public Identification(String type,
                      String locator)
               throws IllegalArgumentException
Constructor for Identification.

Parameters:
type - indicates if this is an Agent or Server
locator - the locator endpoint of remoting server
Throws:
IllegalArgumentException - if either parameter is null
Method Detail

getInvokerLocator

public String getInvokerLocator()
Returns the locator endpoint of the remoting server that is being identified.

Returns:
locator URL as a String

getType

public String getType()
Returns the type of the remoting server that is being identified. This is one of TYPE_AGENT or TYPE_SERVER.

Returns:
type

getTimestamp

public long getTimestamp()
Returns the epoch milliseconds of the identified endpoint. This is the time at the point when this object was created.

Returns:
epoch millis

equals

public boolean equals(Object obj)
Determines equality based solely on the type and locator.

Overrides:
equals in class Object

hashCode

public int hashCode()
Determines hash based solely on the type and locator.

Overrides:
hashCode in class Object


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