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 consentOptional<de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationResponse>createAisConsentAuthorisation(String consentId, de.adorsys.psd2.xs2a.core.sca.ScaStatus scaStatus, de.adorsys.psd2.xs2a.core.psu.PsuIdData psuData)Sends a POST request to CMS to store created consent authorisationOptional<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 consentbooleanfindAndTerminateOldConsentsByNewConsentId(String newConsentId)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<de.adorsys.psd2.xs2a.core.sca.ScaStatus>getAuthorisationScaStatus(String consentId, String authorisationId)Requests CMS to retrieve SCA status of AIS consent authorisationOptional<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(UpdateConsentPsuDataReq 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 Optional<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
-
findAndTerminateOldConsentsByNewConsentId
public boolean findAndTerminateOldConsentsByNewConsentId(String newConsentId)
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
-
createAisConsentAuthorisation
public Optional<de.adorsys.psd2.consent.api.authorisation.CreateAuthorisationResponse> createAisConsentAuthorisation(String consentId, de.adorsys.psd2.xs2a.core.sca.ScaStatus scaStatus, de.adorsys.psd2.xs2a.core.psu.PsuIdData psuData)
Sends a POST request to CMS to store created consent authorisation- Parameters:
consentId- String representation of identifier of stored consentscaStatus- Enum for status of the SCA method appliedpsuData- authorisation data about PSU- Returns:
- CreateAisConsentAuthorizationResponse object with authorisation ID and scaStatus
-
updateConsentAuthorisation
public void updateConsentAuthorisation(UpdateConsentPsuDataReq 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
-
getAuthorisationScaStatus
public Optional<de.adorsys.psd2.xs2a.core.sca.ScaStatus> getAuthorisationScaStatus(String consentId, String authorisationId)
Requests CMS to retrieve SCA status of AIS consent authorisation- Parameters:
consentId- String representation of consent identifierauthorisationId- String representation of authorisation identifier- Returns:
- SCA status of the authorisation
-
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
-
-