org.eclipse.higgins.idas.common
Class AuthNNamePasswordMaterials

java.lang.Object
  extended by org.eclipse.higgins.idas.common.AuthNNamePasswordMaterials
All Implemented Interfaces:
Serializable, org.eclipse.higgins.idas.api.IAuthNAttributesMaterials, org.eclipse.higgins.idas.api.IAuthNMaterials, org.eclipse.higgins.idas.api.IHasAttributes

public class AuthNNamePasswordMaterials
extends Object
implements org.eclipse.higgins.idas.api.IAuthNAttributesMaterials

Simple username and password authorization materials. The username and password can be held by this class in a JavaBean-style way (in this case, use the constructor WITHOUT IContext) OR The username and password can be held inside an IContext as attributes. (in this case, use the constructor WITH IContext)

See Also:
Serialized Form

Field Summary
static URI ATTR_MANAGED_URI
           
static URI ATTR_TYPE_USERNAME
           
 
Fields inherited from interface org.eclipse.higgins.idas.api.IAuthNMaterials
AUTHNMATERIALS_TYPE_ANONYMOUS, AUTHNMATERIALS_TYPE_IMPLIED, AUTHNMATERIALS_TYPE_LEASTPRIVILEGED, AUTHNMATERIALS_TYPE_MINFOCARD, AUTHNMATERIALS_TYPE_NAMEPRIVATEKEY, AUTHNMATERIALS_TYPE_PINFOCARD, AUTHNMATERIALS_TYPE_SAMLPOLICY, AUTHNMATERIALS_TYPE_USERNAMEPASSWORD
 
Constructor Summary
AuthNNamePasswordMaterials(org.eclipse.higgins.idas.api.IContext context, String username, String password)
          Constructs an AuthNNamePasswordMaterials by taking the username and password as String objects.
AuthNNamePasswordMaterials(String username, String password)
          Constructs an AuthNNamePasswordMaterials by taking the username and password as String objects.
 
Method Summary
 org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
           
 org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
           
 org.eclipse.higgins.idas.api.IEntity addAttributeValue(URI attrType, String entityId)
           
 boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
           
 boolean equals(Object object)
           
 org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
           
 Iterator getAttributes()
           
 org.eclipse.higgins.idas.api.IAttribute getManagedAttr()
           
 URI getManagedAttrID()
           
 String getPassword()
          Returns the password.
 org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
           
 String getUsername()
          Returns the username.
 int hashCode()
           
 void removeAttribute(URI attrID)
           
 void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
           
 void removeAttributeValue(URI attrID, Object value)
           
 void setUsername(String username)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_TYPE_USERNAME

public static final URI ATTR_TYPE_USERNAME

ATTR_MANAGED_URI

public static final URI ATTR_MANAGED_URI
Constructor Detail

AuthNNamePasswordMaterials

public AuthNNamePasswordMaterials(org.eclipse.higgins.idas.api.IContext context,
                                  String username,
                                  String password)
                           throws org.eclipse.higgins.idas.api.IdASException
Constructs an AuthNNamePasswordMaterials by taking the username and password as String objects.

Parameters:
context - needed in order to build attributes from username and password
username - name of identity
password - password of identity
Throws:
org.eclipse.higgins.idas.api.IdASException

AuthNNamePasswordMaterials

public AuthNNamePasswordMaterials(String username,
                                  String password)
Constructs an AuthNNamePasswordMaterials by taking the username and password as String objects.

Parameters:
username - name of identity
password - password of identity
Throws:
org.eclipse.higgins.idas.api.IdASException
Method Detail

getUsername

public String getUsername()
Returns the username. IdAS Context Providers may also wish to access the username in IAttribute form as follows:
 IAttribute usernameAttr = thisMaterials.getAttribute(new URI(thisMaterials.ATTR_TYPE_USERNAME));

Returns:
The username is String form
Throws:
org.eclipse.higgins.idas.api.IdASException

getPassword

public String getPassword()
Returns the password. IdAS Context Providers may also wish to access the password in IAttribute form as follows:
 IAttribute passwordAttr = thisMaterials.getAttribute(new URI(thisMaterials.ATTR_TYPE_PASSWORD));

Returns:
The password is String form
Throws:
org.eclipse.higgins.idas.api.IdASException

setUsername

public void setUsername(String username)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object

addAttribute

public org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
                                                     throws org.eclipse.higgins.idas.api.IdASException,
                                                            org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
addAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

addAttribute

public org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getAttribute

public org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getAttributes

public Iterator getAttributes()
                       throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getAttributes in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

getSingleValuedAttribute

public org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
                                                                             throws org.eclipse.higgins.idas.api.IdASException,
                                                                                    org.eclipse.higgins.idas.api.NotSingleValuedAttributeException
Specified by:
getSingleValuedAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.NotSingleValuedAttributeException

removeAttribute

public void removeAttribute(URI attrID)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttribute in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

removeAttributeValue

public void removeAttributeValue(URI attrID,
                                 Object value)
                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttributeValue in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

removeAttributeValue

public void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
removeAttributeValue in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException

equals

public boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
               throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

getManagedAttr

public org.eclipse.higgins.idas.api.IAttribute getManagedAttr()
Specified by:
getManagedAttr in interface org.eclipse.higgins.idas.api.IAuthNAttributesMaterials

getManagedAttrID

public URI getManagedAttrID()
Specified by:
getManagedAttrID in interface org.eclipse.higgins.idas.api.IAuthNAttributesMaterials

addAttributeValue

public org.eclipse.higgins.idas.api.IEntity addAttributeValue(URI attrType,
                                                              String entityId)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addAttributeValue in interface org.eclipse.higgins.idas.api.IHasAttributes
Throws:
org.eclipse.higgins.idas.api.IdASException