ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.platform
Class VerifiableAgentNameImpl

java.lang.Object
  extended bycom.ibm.able.platform.VerifiableAgentNameImpl
All Implemented Interfaces:
javax.agent.AgentName, java.io.Serializable, VerifiableAgentName

public class VerifiableAgentNameImpl
extends java.lang.Object
implements VerifiableAgentName, java.io.Serializable

The implementation of a name created by the VerifiableAgentNamingService.

See Also:
VerifiableAgentNamingService, Serialized Form

Constructor Summary
VerifiableAgentNameImpl(java.lang.String theName, java.security.PublicKey thePublicKey, java.lang.String theAuthority, java.lang.String theKerbPrincipal, java.lang.String theLevel, VerifiableAgentName thePrevVan)
          Creates a VerifiableAgentName.
VerifiableAgentNameImpl(VerifiableAgentName theVan)
          Copy constructor that creates a new VerifiableAgentName based off of theVan.
 
Method Summary
 void acceptSerializer(javax.agent.JasSerializer serializer)
          Every AgentName is required to have this method.
 java.lang.String debugString()
          Returns a translated representation of this VerifiableAgentName.
 boolean equals(java.lang.Object o)
          Compares this VerifiableAgentName with another to determine if the reports are equal.
 java.lang.String getAuthority()
          Method getAuthority
 java.lang.String getKerbPrincipal()
          Method getKerbPrincipal
 java.lang.String getLevel()
          Method getLevel
 java.lang.String getName()
          Method getName
 VerifiableAgentName getPreviousVan()
          Method getName
 java.security.PublicKey getPublicKey()
          Method getPublicKey
 VerifiableAgentName getVanOfInitiator()
          This method will return the VAN of the initiator.
 int hashCode()
          Needed if these names will be keys in hash tables.
 void setPreviousVan(VerifiableAgentName thePrevVan)
          Method setPreviousVan
 java.lang.String toString()
          Returns a brief representation of this VerifiableAgentName.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VerifiableAgentNameImpl

public VerifiableAgentNameImpl(java.lang.String theName,
                               java.security.PublicKey thePublicKey,
                               java.lang.String theAuthority,
                               java.lang.String theKerbPrincipal,
                               java.lang.String theLevel,
                               VerifiableAgentName thePrevVan)
Creates a VerifiableAgentName.

Parameters:
theName - The unique name if this VerifiableAgentName.

thePublicKey - The PublicKey of this VerifiableAgentName.

theAuthority - The one who created this VerifiableAgentName.

theKerbPrincipal - The Kerberos Principal of this VerifiableAgentName.

theLevel - The authority level of this VerifiableAgentName.

thePrevVan - The Previous VerifiableAgentName for this VerifiableAgentName.

VerifiableAgentNameImpl

public VerifiableAgentNameImpl(VerifiableAgentName theVan)
Copy constructor that creates a new VerifiableAgentName based off of theVan.

Parameters:
theVan - The VerifiableAgentName that a new one is to be created from.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: VerifiableAgentName
Method getName

Specified by:
getName in interface VerifiableAgentName
Returns:
The name of this agent.

getAuthority

public java.lang.String getAuthority()
Description copied from interface: VerifiableAgentName
Method getAuthority

Specified by:
getAuthority in interface VerifiableAgentName
Returns:
The URI of the ANS that created this verifiable name

getPublicKey

public java.security.PublicKey getPublicKey()
Description copied from interface: VerifiableAgentName
Method getPublicKey

Specified by:
getPublicKey in interface VerifiableAgentName
Returns:
The public key of the agent who this name belongs to.

getKerbPrincipal

public java.lang.String getKerbPrincipal()
Description copied from interface: VerifiableAgentName
Method getKerbPrincipal

Specified by:
getKerbPrincipal in interface VerifiableAgentName
Returns:
The Kerberos Principal of this verifiable name.

getPreviousVan

public VerifiableAgentName getPreviousVan()
Description copied from interface: VerifiableAgentName
Method getName

Specified by:
getPreviousVan in interface VerifiableAgentName
Returns:
The previous VAN of this verifiable name

setPreviousVan

public void setPreviousVan(VerifiableAgentName thePrevVan)
Description copied from interface: VerifiableAgentName
Method setPreviousVan

Specified by:
setPreviousVan in interface VerifiableAgentName
Parameters:
thePrevVan - The previous VAN of this VAN.

getLevel

public java.lang.String getLevel()
Description copied from interface: VerifiableAgentName
Method getLevel

Specified by:
getLevel in interface VerifiableAgentName
Returns:
The security level of this VAN

getVanOfInitiator

public VerifiableAgentName getVanOfInitiator()
Description copied from interface: VerifiableAgentName
This method will return the VAN of the initiator.

VANs are used to nest each VAN along the chain of request. If A initiated something, and A asks B who asks C who asks D, then D must want decide to do this request or not. Many times D will want to know who initiated the request.

Specified by:
getVanOfInitiator in interface VerifiableAgentName
Returns:
The VAN of the initiator

acceptSerializer

public void acceptSerializer(javax.agent.JasSerializer serializer)
Every AgentName is required to have this method. However, I've not written a usable JasSerializer for this class. Instead, I made the class Serializable. JAS needs to run on MIDP devices, but this class doesn't, so there is no point in not using the preferred Java way to serialized.

Specified by:
acceptSerializer in interface javax.agent.AgentName
Parameters:
serializer - should be an instance of JasSerializer which knows about VerifiableAgentNameImpl.

debugString

public java.lang.String debugString()
Returns a translated representation of this VerifiableAgentName.

Returns:
The translated representation of this VerifiableAgentName

equals

public boolean equals(java.lang.Object o)
Compares this VerifiableAgentName with another to determine if the reports are equal.

VerifiableAgentName are equal if their internal, private, immutable handles are equal. The publicKey is the only exception.

Specified by:
equals in interface javax.agent.AgentName
Parameters:
o - An instance of an VerifiableAgentName that is to be compared to this VerifiableAgentName.

Returns:
true, if this VerifiableAgentName is equal to the specified VerifiableAgentName; false, otherwise.

VerifiableAgentName are equal if their internal, private, immutable handles are equal. The publicKey is the only exception.


hashCode

public int hashCode()
Needed if these names will be keys in hash tables.

Because agent names are nearly always unique they should make a good key.

Specified by:
hashCode in interface javax.agent.AgentName
Returns:
int The hashcode of the unique name of this VAN

toString

public java.lang.String toString()
Returns a brief representation of this VerifiableAgentName.

Returns:
A brief representation of this VerifiableAgentName.

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005