ZMObject
└─ZMTokens
public class ZMTokens
extends ZMObject
| Fields inherited from org.zenmagick.core\ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| void | Create new instance. |
| void | clear(boolean all) Clear all expired token. |
| protected string | createToken(int length) Generate a random token. |
| static ZMToken | getNewToken(string resource, int lifetime) Get a new token for the given resource. |
| ZMToken | getTokenForHash(string hash) Get a token for the given hash. |
| array | getTokenForResource(string resource) Get all token for a given resource. |
| static void | instance() Get instance. |
| void | updateToken(ZMToken token, int lifetime) Update a given token. |
| ZMToken | validateHash(string resource, string hash, boolean expire) Check if hash is valid in context of the resource. |
| Methods inherited from org.zenmagick.core\ZMObject | |
|---|---|
| __construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton | |
public void __construct()
Create new instance.
public void clear(boolean all)
Clear all expired token.
protected string createToken(int length)
Generate a random token.
public static ZMToken getNewToken(string resource, int lifetime)
Get a new token for the given resource.
public ZMToken getTokenForHash(string hash)
Get a token for the given hash.
ZMToken or null.public array getTokenForResource(string resource)
Get all token for a given resource.
ZMToken.public static void instance()
Get instance.
public void updateToken(ZMToken token, int lifetime)
Update a given token.
public ZMToken validateHash(string resource, string hash, boolean expire)
Check if hash is valid in context of the resource.
true.null.
Token service.