|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hyperic.hq.bizapp.agent.TokenManager
public class TokenManager
The token manager is a class which knows how to read a properties file which contains a list of tokens with the following information: 1 - The Token - A simple string 2 - Create Time - The time when the token was generated 3 - Locked - A flag indicating whether the token is verified or it is just temporary, in which case it will timeout after a certain time after the creation time. Tokens which are pending and exceed the timeout are eliminated automagically.
| Constructor Summary | |
|---|---|
TokenManager(long timeout,
TokenStorer storer)
Create a token manager with a timeout for pending tokens of 'timeout' milliseconds. |
|
| Method Summary | |
|---|---|
void |
addToken(TokenData newToken)
|
void |
deleteToken(TokenData token)
|
TokenData |
getToken(java.lang.String token)
Get a token with the specified string |
java.util.List |
getTokens()
Get a list of all the tokens managed by the TokenManager |
void |
load(java.io.InputStream is)
|
void |
setTokenLocked(TokenData token,
boolean locked)
Set the token managed by the manager to the given locked mode. |
void |
store()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TokenManager(long timeout,
TokenStorer storer)
| Method Detail |
|---|
public void addToken(TokenData newToken)
public void deleteToken(TokenData token)
throws TokenNotFoundException
TokenNotFoundException
public void setTokenLocked(TokenData token,
boolean locked)
throws TokenNotFoundException
token - Token to set locked/unlockedlocked - True or false if the token is locked or pending
TokenNotFoundExceptionpublic java.util.List getTokens()
public TokenData getToken(java.lang.String token)
throws TokenNotFoundException
token - The token to look for
TokenNotFoundException
public void store()
throws java.io.IOException
java.io.IOException
public void load(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||