Interface PersistentResourceTokenService
-
- All Known Implementing Classes:
DefaultTokenService
public interface PersistentResourceTokenService
A service on the persistent token for Silverpeas entities. It wraps the mechanism to compute and to retrieve a token for a given resource handled in Silverpeas.- Author:
- Yohann Chastagnier
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PersistentResourceTokenService
get()
PersistentResourceToken
get(String token)
Gets the token with the specified value from the data source.PersistentResourceToken
get(EntityReference resource)
Gets the token of the resource referred by the specifiedEntityReference
.PersistentResourceToken
initialize(EntityReference resource)
Initializes the token of the resource referred by the specifiedEntityReference
.void
remove(String token)
Removes quietly the specified token.void
remove(EntityReference resource)
Removes quietly the token of the resource referred by the specified entity reference.
-
-
-
Method Detail
-
get
static PersistentResourceTokenService get()
-
initialize
PersistentResourceToken initialize(EntityReference resource) throws TokenException
Initializes the token of the resource referred by the specifiedEntityReference
. If the resource has already a token, this token is then renewed.- Parameters:
resource
- a reference to the resource for which a token will be initialized.- Returns:
- a token persisted for the specified resource.
- Throws:
TokenException
- if an unexpected error occurs while initializing a token.
-
get
PersistentResourceToken get(EntityReference resource)
Gets the token of the resource referred by the specifiedEntityReference
. If no token exists for the resource, thenPersistentResourceToken.NoneToken
is returned.- Parameters:
resource
- a reference to the resource for which a token will be initialized.- Returns:
- either the token associated with the specified resource or NoneToken if no such token exists.
-
get
PersistentResourceToken get(String token)
Gets the token with the specified value from the data source. If no token exists with a such value, thenPersistentResourceToken.NoneToken
is returned.- Parameters:
token
- the value of the token to get.- Returns:
- either the token with the specified value or NoneToken if no such token exists.
-
remove
void remove(EntityReference resource)
Removes quietly the token of the resource referred by the specified entity reference.- Parameters:
resource
- the resource for which the token has to be removed.
-
remove
void remove(String token)
Removes quietly the specified token.- Parameters:
token
- the String representation of the token to remove.
-
-