Class Xs2aAisConsentService
- java.lang.Object
-
- de.adorsys.psd2.xs2a.service.consent.Xs2aAisConsentService
-
@Service public class Xs2aAisConsentService extends Object
-
-
Constructor Summary
Constructors Constructor Description Xs2aAisConsentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsentActionLog(String tppId, String consentId, de.adorsys.psd2.consent.api.ActionStatus actionStatus, String requestUri, boolean updateUsage, String resourceId, String transactionId)Sends a POST request to CMS to perform decrement of consent usages and report status of the operation held with certain AIS consentXs2aResponse<Xs2aCreateAisConsentResponse>createConsent(CreateConsentReq request, de.adorsys.psd2.xs2a.core.psu.PsuIdData psuData, de.adorsys.psd2.xs2a.core.tpp.TppInfo tppInfo)Sends a POST request to CMS to store created AIS consentbooleanfindAndTerminateOldConsents(String newConsentId, de.adorsys.psd2.xs2a.core.consent.TerminateOldConsentsRequest request)Requests CMS to find old consents for current TPP and PSU and terminate them.Optional<de.adorsys.psd2.core.data.ais.AisConsent>getAccountConsentById(String consentId)Requests CMS to retrieve AIS consent by its identifierOptional<List<String>>getAuthorisationSubResources(String consentId)Requests CMS to retrieve AIS consent authorisation IDs by consent IDde.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.core.data.ais.AisConsent>updateAspspAccountAccess(String consentId, de.adorsys.psd2.core.data.AccountAccess accountAccess)Sends a PUT request to CMS to update AIS account access information by consent IDvoidupdateConsentAuthorisation(ConsentAuthorisationsParameters updatePsuData)Sends a PUT request to CMS to update created AIS consent authorisationvoidupdateConsentStatus(String consentId, de.adorsys.psd2.xs2a.core.consent.ConsentStatus consentStatus)Requests CMS to update consent status into provided onevoidupdateMultilevelScaRequired(String consentId, boolean multilevelScaRequired)Updates multilevel SCA required field
-
-
-
Method Detail
-
createConsent
public Xs2aResponse<Xs2aCreateAisConsentResponse> createConsent(CreateConsentReq request, de.adorsys.psd2.xs2a.core.psu.PsuIdData psuData, de.adorsys.psd2.xs2a.core.tpp.TppInfo tppInfo)
Sends a POST request to CMS to store created AIS consent- Parameters:
request- Request body storing main consent detailspsuData- PsuIdData container of authorisation data about PSUtppInfo- Information about particular TPP from TPP Certificate- Returns:
- create consent response, containing consent and its encrypted ID
-
getAccountConsentById
public Optional<de.adorsys.psd2.core.data.ais.AisConsent> getAccountConsentById(String consentId)
Requests CMS to retrieve AIS consent by its identifier- Parameters:
consentId- String representation of identifier of stored consent- Returns:
- Response containing AIS Consent
-
findAndTerminateOldConsents
public boolean findAndTerminateOldConsents(String newConsentId, de.adorsys.psd2.xs2a.core.consent.TerminateOldConsentsRequest request)
Requests CMS to find old consents for current TPP and PSU and terminate them.- Parameters:
newConsentId- id of new consent- Returns:
- true if any consents have been terminated, false - if none
-
updateConsentStatus
public void updateConsentStatus(String consentId, de.adorsys.psd2.xs2a.core.consent.ConsentStatus consentStatus)
Requests CMS to update consent status into provided one- Parameters:
consentId- String representation of identifier of stored consentconsentStatus- ConsentStatus the consent be changed to
-
consentActionLog
public void consentActionLog(String tppId, String consentId, de.adorsys.psd2.consent.api.ActionStatus actionStatus, String requestUri, boolean updateUsage, String resourceId, String transactionId)
Sends a POST request to CMS to perform decrement of consent usages and report status of the operation held with certain AIS consent- Parameters:
tppId- String representation of TPP`s identifier from TPP CertificateconsentId- String representation of identifier of stored consentactionStatus- Enum value representing whether the action is successful or errors occurredrequestUri- target URL of the requestupdateUsage- Update usage indicatorresourceId- The identification that denotes the addressed accounttransactionId- String representation of ASPSP transaction primary identifier
-
updateConsentAuthorisation
public void updateConsentAuthorisation(ConsentAuthorisationsParameters updatePsuData)
Sends a PUT request to CMS to update created AIS consent authorisation- Parameters:
updatePsuData- Consent PSU data
-
updateAspspAccountAccess
public de.adorsys.psd2.consent.api.CmsResponse<de.adorsys.psd2.core.data.ais.AisConsent> updateAspspAccountAccess(String consentId, de.adorsys.psd2.core.data.AccountAccess accountAccess)
Sends a PUT request to CMS to update AIS account access information by consent ID- Parameters:
consentId- consentId String representation of identifier of stored consentaccountAccess- AIS account access information- Returns:
- Response containing AIS Consent
-
getAuthorisationSubResources
public Optional<List<String>> getAuthorisationSubResources(String consentId)
Requests CMS to retrieve AIS consent authorisation IDs by consent ID- Parameters:
consentId- String representation of identifier of stored consent- Returns:
- list of consent authorisation IDs
-
updateMultilevelScaRequired
public void updateMultilevelScaRequired(String consentId, boolean multilevelScaRequired)
Updates multilevel SCA required field- Parameters:
consentId- String representation of the consent identifiermultilevelScaRequired- multilevel SCA required indicator
-
-