|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dyuproject.oauth.Token
public final class Token
Token - stores the keys and state whether it is already useable or not.
Field Summary | |
---|---|
static int |
ACCESS_TOKEN
Access token state. |
static int |
AUTHORIZED
Authorized state. |
static int |
UNAUTHORIZED
Unauthorized state. |
static int |
UNITIALIZED
Uninitialized state. |
Constructor Summary | |
---|---|
Token()
|
|
Token(String ck)
|
|
Token(String ck,
String key,
String secret)
|
|
Token(String ck,
String key,
String secret,
int state)
|
Method Summary | |
---|---|
boolean |
authorize(String key,
String verifier)
Checks whether the key and the verifier is authorized or not. |
void |
fromJSON(Map map)
|
Object |
getAttribute(String key)
Gets an attribute based from the given key. |
Map<String,Object> |
getAttributes()
Gets the attributes of this token. |
String |
getCk()
Gets the consumer secret. |
String |
getKey()
Gets the consumer key. |
String |
getSecret()
Gets the secret key; This is obtained from the exchanges (OAuth dance). |
int |
getState()
Gets the state of the token. |
boolean |
isAuthentic()
Checks whether the token is authentic (aka useable to make auth requests against the service provider. |
void |
setAttribute(String key,
Object value)
Sets an attribute based from the given key and value. |
void |
toJSON(org.mortbay.util.ajax.JSON.Output out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UNITIALIZED
public static final int UNAUTHORIZED
public static final int AUTHORIZED
public static final int ACCESS_TOKEN
Constructor Detail |
---|
public Token()
public Token(String ck)
public Token(String ck, String key, String secret)
public Token(String ck, String key, String secret, int state)
Method Detail |
---|
public int getState()
public String getCk()
public String getKey()
public String getSecret()
public boolean authorize(String key, String verifier)
public boolean isAuthentic()
public Map<String,Object> getAttributes()
public Object getAttribute(String key)
public void setAttribute(String key, Object value)
public void fromJSON(Map map)
fromJSON
in interface org.mortbay.util.ajax.JSON.Convertible
public void toJSON(org.mortbay.util.ajax.JSON.Output out)
toJSON
in interface org.mortbay.util.ajax.JSON.Convertible
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |