org.jasig.portal.groups
Class CompositeEntityIdentifier

java.lang.Object
  extended by org.jasig.portal.EntityIdentifier
      extended by org.jasig.portal.groups.CompositeEntityIdentifier
All Implemented Interfaces:
Serializable, IGroupConstants
Direct Known Subclasses:
CompositeServiceIdentifier

public class CompositeEntityIdentifier
extends EntityIdentifier
implements IGroupConstants

A composite key and type that uniquely identify a portal entity. The composite key contains a service name, which may be compound, and a native key, which is the key that identifies the entity in the local service.

Version:
$Revision: 19776 $
Author:
Dan Ellentuck
See Also:
Serialized Form

Field Summary
protected  String cachedCompositeKey
           
protected  String cachedLocalKey
           
protected  Name cachedServiceName
           
protected  Name compositeKey
           
protected static String separator
           
 
Fields inherited from class org.jasig.portal.EntityIdentifier
key, type
 
Fields inherited from interface org.jasig.portal.groups.IGroupConstants
CHANNEL_CATEGORIES, CONTAINS, ENDS_WITH, EVERYONE, IS, NODE_SEPARATOR, PORTAL_ADMINISTRATORS, STARTS_WITH
 
Constructor Summary
CompositeEntityIdentifier(String entityKey, Class entityType)
           
 
Method Summary
protected  Name getCompositeKey()
           
 String getKey()
           
 String getLocalKey()
           
protected  NameParser getParser()
           
 Name getServiceName()
          If the composite key is either empty or has a single node, there is no service name.
 Name newName()
          Returns a new empty Name
 Name parseCompoundKey(String key)
          Returns a CompoundName parsed from key
 String popNode()
           
 Name pushNode(String newNode)
           
 void setCompositeKey(Name newCompositeKey)
           
 void setServiceName(Name newServiceName)
           
protected  int size()
           
 String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class org.jasig.portal.EntityIdentifier
equals, getType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

separator

protected static String separator

compositeKey

protected Name compositeKey

cachedCompositeKey

protected String cachedCompositeKey

cachedLocalKey

protected String cachedLocalKey

cachedServiceName

protected Name cachedServiceName
Constructor Detail

CompositeEntityIdentifier

public CompositeEntityIdentifier(String entityKey,
                                 Class entityType)
                          throws GroupsException
Parameters:
entityKey - java.lang.String
entityType - java.lang.Class
Throws:
GroupsException
Method Detail

getCompositeKey

protected Name getCompositeKey()
Returns:
javax.naming.Name

getKey

public String getKey()
Overrides:
getKey in class EntityIdentifier
Returns:
java.lang.String

getLocalKey

public String getLocalKey()
Returns:
java.lang.String

getParser

protected NameParser getParser()
Returns:
javax.naming.NameParser

getServiceName

public Name getServiceName()
If the composite key is either empty or has a single node, there is no service name.

Returns:
javax.naming.Name

newName

public Name newName()
             throws InvalidNameException
Returns a new empty Name

Throws:
InvalidNameException

popNode

public String popNode()
               throws InvalidNameException
Returns:
String - the removed component
Throws:
InvalidNameException

pushNode

public Name pushNode(String newNode)
              throws InvalidNameException
Returns:
javax.naming.Name
Throws:
InvalidNameException

setCompositeKey

public void setCompositeKey(Name newCompositeKey)
Parameters:
newCompositeKey - javax.naming.Name

setServiceName

public void setServiceName(Name newServiceName)
                    throws InvalidNameException
Parameters:
newServiceName - javax.naming.Name
Throws:
InvalidNameException

size

protected int size()
Returns:
int

toString

public String toString()
Returns a String that represents the value of this object.

Overrides:
toString in class EntityIdentifier
Returns:
java.lang.String
See Also:
Object.toString()

parseCompoundKey

public Name parseCompoundKey(String key)
                      throws NamingException
Returns a CompoundName parsed from key

Throws:
NamingException


Copyright © 2010 Jasig. All Rights Reserved.