javax.slee.profile
Class ProfileID

java.lang.Object
  |
  +--javax.slee.profile.ProfileID
All Implemented Interfaces:
java.io.Serializable

public class ProfileID
extends java.lang.Object
implements java.io.Serializable

The ProfileID class defines an indentifer that can be used to reference profiles. For example a profile specification's CMP interface may contain attributes of the type ProfileID, allowing profile's of that type to reference other profiles.

See Also:
Serialized Form

Constructor Summary
ProfileID(Address address)
          Create a ProfileID object from an address.
ProfileID(java.lang.String profileTableName, java.lang.String profileName)
          Create a ProfileID object using a profile table name and profile name.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this profile identifier for equality with another object.
 java.lang.String getProfileName()
          Get the name of the profile referenced by this identifier.
 java.lang.String getProfileTableName()
          Get the name of the profile table referenced by this identifier.
 int hashCode()
          Get a hash code value for this profile identifer.
 void setProfileID(java.lang.String profileTableName, java.lang.String profileName)
          Set the profile table and profile referenced by this profile identifier to new values.
 Address toAddress()
          Get an Address object containing the address form of the profile identified by this profile identifier.
 java.lang.String toString()
          Get a string representation for this profile identifier.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProfileID

public ProfileID(java.lang.String profileTableName,
                 java.lang.String profileName)
          throws java.lang.NullPointerException,
                 java.lang.IllegalArgumentException
Create a ProfileID object using a profile table name and profile name.
Parameters:
profileTableName - the name of the profile table.
profileName - the name of the profile within the profile table.
Throws:
java.lang.NullPointerException - if either argument is null.
java.lang.IllegalArgumentException - if profileTableName includes the '/' character. This character is not permitted in profile table names.

ProfileID

public ProfileID(Address address)
          throws java.lang.NullPointerException,
                 java.lang.IllegalArgumentException
Create a ProfileID object from an address. The address must have the address plan of AddressPlan.SLEE_PROFILE.
Parameters:
address - the address of the profile.
Throws:
java.lang.NullPointerException - if address is null.
java.lang.IllegalArgumentException - if the address plan of the address is not AddressPlan.SLEE_PROFILE, or the address string does not contain a profile identifier with the correct encoding: <profile-table-name</<profile-name>.
Method Detail

getProfileTableName

public final java.lang.String getProfileTableName()
Get the name of the profile table referenced by this identifier.
Returns:
the profile table name.

getProfileName

public final java.lang.String getProfileName()
Get the name of the profile referenced by this identifier.
Returns:
the profile name.

setProfileID

public final void setProfileID(java.lang.String profileTableName,
                               java.lang.String profileName)
                        throws java.lang.NullPointerException,
                               java.lang.IllegalArgumentException
Set the profile table and profile referenced by this profile identifier to new values.
Parameters:
profileTableName - the name of the profile table.
profileName - the name of the profile within the profile table.
Throws:
java.lang.NullPointerException - if either argument is null.
java.lang.IllegalArgumentException - if profileTableName includes the '/' character. This character is not permitted in profile table names.

toAddress

public Address toAddress()
Get an Address object containing the address form of the profile identified by this profile identifier.
Returns:
an Address object containing the address form of the profile identified by this profile identifier.

equals

public boolean equals(java.lang.Object obj)
Compare this profile identifier for equality with another object.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class and the profile table name and profile name are equal.

hashCode

public int hashCode()
Get a hash code value for this profile identifer. The hash code is the logical OR of the hashcodes of the profile table name and profile name.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this profile identifier.

toString

public java.lang.String toString()
Get a string representation for this profile identifier.
Overrides:
toString in class java.lang.Object
Returns:
a string representation for this profile identifer.