org.n52.security.authentication.principals
Class AttributePrincipal

java.lang.Object
  extended by org.n52.security.authentication.principals.NamePrincipal
      extended by org.n52.security.authentication.principals.AttributePrincipal
All Implemented Interfaces:
java.io.Serializable, java.security.Principal, Scope

public class AttributePrincipal
extends NamePrincipal

Container for simple parameter/value principals.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.n52.security.authentication.principals.Scope
GLOBAL
 
Constructor Summary
AttributePrincipal(Attribute attribute)
          Constructor creates a new instance.
AttributePrincipal(Attribute attribute, Scope scope)
          Constructor creates a new instance.
AttributePrincipal(java.lang.String key, java.lang.String value)
          Constructor creates a new instance.
AttributePrincipal(java.lang.String key, java.lang.String value, Scope scope)
          Constructor creates a new instance.
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns the equaltiy.
 Attribute getAttribute()
          Method gets the attribute.
 AttributeValue getAttributeValue()
          Method gets the attribute value.
 java.lang.String getValue()
           
 int hashCode()
          Returns the hashCode.
 
Methods inherited from class org.n52.security.authentication.principals.NamePrincipal
getName, getScope
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
toString
 

Constructor Detail

AttributePrincipal

public AttributePrincipal(Attribute attribute)
                   throws java.lang.IllegalArgumentException
Constructor creates a new instance.

Parameters:
attribute - the attribute.
Throws:
java.lang.IllegalArgumentException - if error occurs.

AttributePrincipal

public AttributePrincipal(Attribute attribute,
                          Scope scope)
                   throws java.lang.IllegalArgumentException
Constructor creates a new instance.

Parameters:
attribute - the attribute.
scope - the scope.
Throws:
java.lang.IllegalArgumentException - if error occurs.

AttributePrincipal

public AttributePrincipal(java.lang.String key,
                          java.lang.String value)
                   throws java.lang.IllegalArgumentException
Constructor creates a new instance.

Parameters:
key - the key.
value - the value.
Throws:
java.lang.IllegalArgumentException - if error occurs.

AttributePrincipal

public AttributePrincipal(java.lang.String key,
                          java.lang.String value,
                          Scope scope)
                   throws java.lang.IllegalArgumentException
Constructor creates a new instance.

Parameters:
key - the key.
value - the value.
scope - the scope.
Throws:
java.lang.IllegalArgumentException - if error occurs.
Method Detail

getAttribute

public Attribute getAttribute()
Method gets the attribute.

Returns:
Attribute.

getAttributeValue

public AttributeValue getAttributeValue()
Method gets the attribute value. short cut for getAttribute().getValue()

Returns:
AttributeValue.

getValue

public java.lang.String getValue()
Returns:
the string value of this attribute

equals

public boolean equals(java.lang.Object o)
Returns the equaltiy.

Specified by:
equals in interface java.security.Principal
Overrides:
equals in class NamePrincipal
Parameters:
o - the other object.
Returns:
boolean.

hashCode

public int hashCode()
Returns the hashCode.

Specified by:
hashCode in interface java.security.Principal
Overrides:
hashCode in class NamePrincipal
Returns:
int.


Copyright © 2004-2009 52north.org. All Rights Reserved.