org.jets3t.service.acl
Class CanonicalGrantee

java.lang.Object
  extended by org.jets3t.service.acl.CanonicalGrantee
All Implemented Interfaces:
GranteeInterface
Direct Known Subclasses:
UserByIdGrantee

public class CanonicalGrantee
extends java.lang.Object
implements GranteeInterface

Represents a grantee identified by their canonical Amazon ID, which is something along the lines of an Amazon-internal ID specific to a user. For example, Amazon can map a grantee identified by an email address to a canonical ID.

Canonical grantees may have an associated Display Name, which is a human-friendly name that Amazon has linked to the canonical ID (eg the user's login name).


Field Summary
protected  java.lang.String displayName
           
protected  java.lang.String id
           
 
Constructor Summary
CanonicalGrantee()
          Default constructor.
CanonicalGrantee(java.lang.String identifier)
          Constructs a grantee with the given canonical ID.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDisplayName()
           
 java.lang.String getIdentifier()
           
 int hashCode()
           
 void setDisplayName(java.lang.String displayName)
           
 void setIdentifier(java.lang.String id)
           
 java.lang.String toString()
           
 java.lang.String toXml()
           
 com.jamesmurty.utils.XMLBuilder toXMLBuilder()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

displayName

protected java.lang.String displayName
Constructor Detail

CanonicalGrantee

public CanonicalGrantee()
Default constructor.

Warning! If created with this constructor this class will not represent a valid grantee until the identifier is set.


CanonicalGrantee

public CanonicalGrantee(java.lang.String identifier)
Constructs a grantee with the given canonical ID.

Parameters:
identifier -
Method Detail

toXml

public java.lang.String toXml()
                       throws javax.xml.transform.TransformerException,
                              javax.xml.parsers.ParserConfigurationException,
                              javax.xml.parsers.FactoryConfigurationError
Specified by:
toXml in interface GranteeInterface
Returns:
the grantee represented in an XML fragment compatible with the S3 REST interface.
Throws:
javax.xml.transform.TransformerException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError

toXMLBuilder

public com.jamesmurty.utils.XMLBuilder toXMLBuilder()
                                             throws javax.xml.transform.TransformerException,
                                                    javax.xml.parsers.ParserConfigurationException,
                                                    javax.xml.parsers.FactoryConfigurationError
Specified by:
toXMLBuilder in interface GranteeInterface
Throws:
javax.xml.transform.TransformerException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.FactoryConfigurationError

setIdentifier

public void setIdentifier(java.lang.String id)
Specified by:
setIdentifier in interface GranteeInterface

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface GranteeInterface

setDisplayName

public void setDisplayName(java.lang.String displayName)

getDisplayName

public java.lang.String getDisplayName()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object