org.brickred.socialauth.util
Class AccessGrant

java.lang.Object
  extended by org.brickred.socialauth.util.AccessGrant
All Implemented Interfaces:
Serializable

public class AccessGrant
extends Object
implements Serializable

Stores the keys and secret for OAuth access token as well as OAuth request token.

Author:
tarunn@brickred.com
See Also:
Serialized Form

Constructor Summary
AccessGrant()
           
AccessGrant(String key, String secret)
           
 
Method Summary
 Object getAttribute(String key)
          Gets an attribute based from the given key.
 Map<String,Object> getAttributes()
          Gets the attributes of this token.
 String getKey()
          Retrieves the Token Key
 Permission getPermission()
          Retrieves the scope
 String getProviderId()
          Retrieves the provider id.
 String getSecret()
          Retrieves the Token Secret
 void setAttribute(String key, Object value)
          Sets an attribute based from the given key and value.
 void setAttributes(Map<String,Object> attributes)
          Sets an attributes from given attributes map.
 void setKey(String key)
          Updates the Token Key
 void setPermission(Permission permission)
           
 void setProviderId(String providerId)
          Updates the provider id.
 void setSecret(String secret)
          Updates the Token Secret
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AccessGrant

public AccessGrant(String key,
                   String secret)
Parameters:
key - the Key
secret - the Secret

AccessGrant

public AccessGrant()
Method Detail

getKey

public String getKey()
Retrieves the Token Key

Returns:
the Token Key

setKey

public void setKey(String key)
Updates the Token Key

Parameters:
key - the Token Key

getSecret

public String getSecret()
Retrieves the Token Secret

Returns:
the Token Secret

setSecret

public void setSecret(String secret)
Updates the Token Secret

Parameters:
secret - the Token Secret

getAttributes

public Map<String,Object> getAttributes()
Gets the attributes of this token.


getAttribute

public Object getAttribute(String key)
Gets an attribute based from the given key.


setAttribute

public void setAttribute(String key,
                         Object value)
Sets an attribute based from the given key and value.


setAttributes

public void setAttributes(Map<String,Object> attributes)
Sets an attributes from given attributes map.


getProviderId

public String getProviderId()
Retrieves the provider id.

Returns:
the provider id.

setProviderId

public void setProviderId(String providerId)
Updates the provider id.

Parameters:
providerId - the provider id.

getPermission

public Permission getPermission()
Retrieves the scope

Returns:
the scope

setPermission

public void setPermission(Permission permission)
Parameters:
permission - Permission object which can be Permission.AUHTHENTICATE_ONLY, Permission.ALL, Permission.DEFAULT

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.