Class CibaRequestService


  • @Named
    public class CibaRequestService
    extends Object
    Service used to access to the database for CibaRequest ObjectClass.
    Version:
    May 28, 2020
    Author:
    Milton BO
    • Constructor Detail

      • CibaRequestService

        public CibaRequestService()
    • Method Detail

      • persistRequest

        public void persistRequest​(CibaRequestCacheControl request,
                                   int expiresIn)
        Uses request data and expiration sent by the client and save request data in database.
        Parameters:
        request - Object containing information related to the request.
        expiresIn - Expiration time that end user has to answer.
      • load

        public CIBARequest load​(String authReqId)
        Load a CIBARequest entry from database.
        Parameters:
        authReqId - Identifier of the entry.
      • loadExpiredByStatus

        public List<CIBARequest> loadExpiredByStatus​(CibaRequestStatus authorizationStatus,
                                                     int maxRequestsToGet)
        Generates a list of requests that are expired and also filter them using a Status.
        Parameters:
        authorizationStatus - Status used to filter entries.
        maxRequestsToGet - Limit of requests that would be returned.
      • updateStatus

        public void updateStatus​(CIBARequest cibaRequest,
                                 CibaRequestStatus authorizationStatus)
        Change the status field in database for a specific request.
        Parameters:
        cibaRequest - Entry containing information of the CIBA request.
        authorizationStatus - New status.
      • removeCibaRequest

        public void removeCibaRequest​(CIBARequest cibaRequest)
        Removes a CibaRequest object from the database.
        Parameters:
        cibaRequest - Object to be removed.
      • removeCibaRequest

        public void removeCibaRequest​(String authReqId)
        Removes a CibaRequest from the database.
        Parameters:
        authReqId - Identifier of the CibaRequest.
      • save

        public void save​(CibaRequestCacheControl request,
                         int expiresIn)
        Register a new CibaRequestCacheControl instance in Cache and in the database.
        Parameters:
        request - New instance to be saved.
        expiresIn - Expiration time of the request in Cache and memory.
      • update

        public void update​(CibaRequestCacheControl request)
        Put in cache a CibaRequestCacheControl object, it uses same expiration time that it has.
        Parameters:
        request - Object to be updated, replaced or created.
      • getCibaRequest

        public CibaRequestCacheControl getCibaRequest​(String authReqId)
        Get a CibaRequestCacheControl object from Cache service.
        Parameters:
        authReqId - Identifier of the object to be gotten.
      • removeCibaCacheRequest

        public void removeCibaCacheRequest​(String cacheKey)
        Removes from cache a request.
        Parameters:
        cacheKey - Object to be removed from Cache.
      • hasCibaCompatibility

        public boolean hasCibaCompatibility​(io.jans.as.common.model.registration.Client client)
        Verifies whether a specific client has CIBA compatibility.
        Parameters:
        client - Client to check.