Package org.moera.lib.node.carte
Class MoeraCarteSource
java.lang.Object
org.moera.lib.node.carte.MoeraCarteSource
- All Implemented Interfaces:
CarteSource
Class that gets cartes from the given node, caches them and supplies them for authentication.
This class is not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionMoeraCarteSource
(MoeraNode node, Long clientScope, Long adminScope, String targetNodeName) Create the carte source. -
Method Summary
-
Constructor Details
-
MoeraCarteSource
Create the carte source.- Parameters:
node
- node to get cartes fromclientScope
- permissions to be granted to the cartes; ifnull
, all permissions of the cartes' owner are grantedadminScope
- additional administrative permissions (of those granted to the cartes' owner by the target node) to be granted to the cartestargetNodeName
- if set, the cartes are valid for authentication on the specified node only
-
-
Method Details
-
renew
public void renew()Force renewing the cached list of cartes.- Throws:
MoeraCartesException
- if cartes cannot be obtained
-
getCarte
Retrieves a valid carte for authentication purposes. The method attempts to use a cached carte if available and valid. If no cached carte is valid, the method will attempt to renew the list of cartes.- Specified by:
getCarte
in interfaceCarteSource
- Returns:
- a valid carte
- Throws:
MoeraCartesException
- if no valid carte is available or could not be obtained
-