krb5.lib
Class PrincipalName

java.lang.Object
  extended by krb5.lib.PrincipalName
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
ServiceName

public class PrincipalName
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Class Description : Principal name class. A modified version of the code obtained from the Open Group Research Institute.

Version:
1.1
Author:
Bojan Pajkovski
See Also:
Serialized Form

Constructor Summary
PrincipalName(java.lang.String name)
          Class constructor
PrincipalName(java.lang.String[] nameParts)
          Class constructor
PrincipalName(java.lang.String[] nameParts, int type)
          Class constructor
PrincipalName(java.lang.String[] nameParts, java.lang.String realm, int type)
          Class constructor
PrincipalName(java.lang.String name, int type)
          Class constructor
PrincipalName(java.lang.String name, java.lang.String realm)
          Class constructor
 
Method Summary
 java.lang.Object clone()
          Clones this object
 boolean equals(PrincipalName other)
          Determines whether two principal names are the same or not
 boolean equalsWithoutRealm(PrincipalName other)
          Determines whether two principal names are the same without realm
 java.lang.String getNameString()
          Returns name as a String
 java.lang.String[] getNameStrings()
          Returns the name
 int getNameType()
          Returns the name type as an array of String
 Realm getRealm()
          Returns the realm
 java.lang.String getRealmString()
          Returns the realm as a String
 void setRealm(Realm new_nameRealm)
          Sets the realm
 void setRealm(java.lang.String realmsString)
          Sets the realm String
 byte[][] toByteArray()
          Returns the principal name as an array of bytes
 java.lang.String toString()
          Converts a principal name into printable format
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrincipalName

public PrincipalName(java.lang.String[] nameParts,
                     int type)
Class constructor

Parameters:
nameParts - String[]
type - int

PrincipalName

public PrincipalName(java.lang.String[] nameParts,
                     java.lang.String realm,
                     int type)
              throws RealmException
Class constructor

Parameters:
nameParts - String[]
realm - String
type - int
Throws:
RealmException

PrincipalName

public PrincipalName(java.lang.String[] nameParts)
Class constructor

Parameters:
nameParts - String[]

PrincipalName

public PrincipalName(java.lang.String name,
                     int type)
              throws RealmException
Class constructor

Parameters:
name - String
type - int
Throws:
RealmException

PrincipalName

public PrincipalName(java.lang.String name)
              throws RealmException
Class constructor

Parameters:
name - String
Throws:
RealmException

PrincipalName

public PrincipalName(java.lang.String name,
                     java.lang.String realm)
              throws RealmException
Class constructor

Parameters:
name - String
realm - String
Throws:
RealmException
Method Detail

clone

public java.lang.Object clone()
Clones this object

Overrides:
clone in class java.lang.Object
Returns:
Object
See Also:
Object.clone()

equals

public boolean equals(PrincipalName other)
Determines whether two principal names are the same or not

Parameters:
other - PrincipalName
Returns:
boolean

equalsWithoutRealm

public boolean equalsWithoutRealm(PrincipalName other)
Determines whether two principal names are the same without realm

Parameters:
other - PrincipalName
Returns:
boolean

getNameType

public int getNameType()
Returns the name type as an array of String

Returns:
int

getNameStrings

public java.lang.String[] getNameStrings()
Returns the name

Returns:
String[]

toByteArray

public byte[][] toByteArray()
Returns the principal name as an array of bytes

Returns:
byte[][]

getRealmString

public java.lang.String getRealmString()
Returns the realm as a String

Returns:
String

getRealm

public Realm getRealm()
Returns the realm

Returns:
Realm

setRealm

public void setRealm(Realm new_nameRealm)
Sets the realm

Parameters:
new_nameRealm - Realm

setRealm

public void setRealm(java.lang.String realmsString)
              throws RealmException
Sets the realm String

Parameters:
realmsString - String
Throws:
RealmException

toString

public java.lang.String toString()
Converts a principal name into printable format

Overrides:
toString in class java.lang.Object
Returns:
String

getNameString

public java.lang.String getNameString()
Returns name as a String

Returns:
String