Class MoeraCarteSource

java.lang.Object
org.moera.lib.node.carte.MoeraCarteSource
All Implemented Interfaces:
CarteSource

public class MoeraCarteSource extends Object implements CarteSource
Class that gets cartes from the given node, caches them and supplies them for authentication.

This class is not thread-safe.

  • Constructor Details

    • MoeraCarteSource

      public MoeraCarteSource(MoeraNode node, Long clientScope, Long adminScope, String targetNodeName)
      Create the carte source.
      Parameters:
      node - node to get cartes from
      clientScope - permissions to be granted to the cartes; if null, all permissions of the cartes' owner are granted
      adminScope - additional administrative permissions (of those granted to the cartes' owner by the target node) to be granted to the cartes
      targetNodeName - 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

      public String 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 interface CarteSource
      Returns:
      a valid carte
      Throws:
      MoeraCartesException - if no valid carte is available or could not be obtained