Class CibaRequestService

  • @Named
    public class CibaRequestService
    extends Object
    Service used to access to the database for CibaRequest ObjectClass.
    May 28, 2020
    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.
        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.
        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.
        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.
        cibaRequest - Entry containing information of the CIBA request.
        authorizationStatus - New status.
      • removeCibaRequest

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

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

        public void save​(CibaRequestCacheControl request,
                         int expiresIn)
        Register a new CibaRequestCacheControl instance in Cache and in the database.
        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.
        request - Object to be updated, replaced or created.
      • getCibaRequest

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

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

        public boolean hasCibaCompatibility​( client)
        Verifies whether a specific client has CIBA compatibility.
        client - Client to check.