Package org.cyclos.impl.access
Class TokenServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
- org.cyclos.impl.access.TokenServiceImpl
-
- All Implemented Interfaces:
TokenServiceLocal,CRUDServiceLocal<Token,TokenDTO,TokenData,TokenDataParams>,TokenService,CRUDService<TokenDTO,TokenData,TokenDataParams>,CRUDWithConfirmationPasswordService<TokenDTO,TokenData,TokenDataParams>,Service
@Service public class TokenServiceImpl extends CRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams> implements TokenServiceLocal
implementation forTokenService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, richTextHandler, withConfirmationPassword
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description TokenServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Longactivate(TokenActionDTO dto, UserLocatorVO locator)Searches for a token with the given type and value specified in theTokenActionDTOparameter.
The token's status must beTokenStatus.UNASSIGNEDorTokenStatus.PENDING_ACTIVATIONbut assigned to the logged user or one of its operators.
If the token is unassigned then this method assigns it to the user specified by theUserLocatorVOparameter and change its status toTokenStatus.ACTIVE.
Otherwise (the token is already assigned and is pending by activation) it activates only.
This method can be used only by members (i.e.voidactivatePending(Long tokenId)Activates an already assigned token with statusTokenStatus.PENDING_ACTIVATION.
This operation can only be done by admins/brokers over tokens of managed users or member over tokens of its operators with permission to activate the correspondingTokenPrincipalTypeVO.voidassign(@NotNull Long tokenId, @NotNull UserLocatorVO locator)Assigns a pending token to a user, leaving it in pending status The token status must beTokenStatus.UNASSIGNED.SerializableInputStreambarcode(TokenBarcodeParams params)Returns a barcode image of the tokenvoidblock(Long tokenId)Blocks the given tokenvoidcancel(Long tokenId)Cancels the given tokenvoidcancel(Token token)voidcancelAll(BasicUser user)Cancels all active / blocked tokens of the given uservoidcancelNFCToken(TokenActionDTO dto)Cancels the given NFC token.DeviceConfirmationVOcreateDeviceConfirmationForPersonalizeNFCTag(@NotNull UserLocatorVO locator, @NotNull TokenPrincipalTypeVO tokenTypeVO)Creates a new pending device confirmation for the specified user.SerializableInputStreamdeviceConfirmationBarcodeForPersonalizeNFCTag(UserLocatorVO locator, @NotNull TokenPrincipalTypeVO tokenTypeVO, DeviceConfirmationBarcodeParams params)Generates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer.longexpireTokens()Takes all the tokens and switches their statuses to EXPIRED or ACTIVATION_EXPIRED for those who meet the conditions of these statuses.FileInfoexportTokens(@NotNull ExportFormatVO formatVO, @NotNull TokenQuery query)Exports the token search results to fileTokenfirstActive(BasicUser user, TokenPrincipalType type)Returns the first token for the given basic user, whose status isTokenStatus.ACTIVEvoidgenerateOnRegistrationTokens(BasicUser user)Generates the tokens that are configured to be generated upon registrationprotected TokenDatagetData(Token token)Returns details data for the given entityInitializeNFCTagDatagetInitializeNFCTagData()Returns data with the token types available to initialize a blank NFC tag.
The available tokens to personalize the tag are returned too to allow initialization and personalization at the same time.byte[]getKeyMask(NFCToken nfcToken)Returns the key mask used to encrypt/decrypt the nfc token's keys (AMK and Operational)TokensListDatagetListData(TokenPrincipalTypeVO tokenType, UserLocatorVO locator)Returns data for listing tokens of a given type and userPersonalizeNFCTagDatagetPersonalizeNFCTagData(TokenPrincipalTypeVO tokenTypeVO, UserLocatorVO locator)Returns data needed to personalize a NFC tag for the specified type and user.
ThePersonalizeNFCTagData.CONFIRMATION_PASSWORD_INPUTwill be null if the logged user manages the given user.List<TokenType>getReceiveTokenTypes()Returns a list with the token types used for receive paymentsTokenSearchDatagetSearchData(TokenPrincipalTypeVO tokenType)Returns data for searching tokensbooleanhasReachedMaxTokensPerUser(TokenPrincipalType type, BasicUser user, Token ignoredToken)Returns if the given user has reached the maximum possible assigned tokensInitializeNFCTagResultinitializeNFCTag(NFCTagInitializeDTO dto)Initializes and optionally personalize a NFC tag with the given data.TokennewEntity(TokenDataParams params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(Token token, Token currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected ObjectonBeforeSave(Token token, Token currentCopy)May be overridden in order to perform custom logic before saving an entity.voidpersonalizeNFCTag(NFCTagPersonalizeDTO dto)Personalizes a NFC tag for the given user.voidpersonalizeNFCTag(NFCTagWithChallengeDTO dto, BasicUser user)Same asTokenService.personalizeNFCTag(NFCTagPersonalizeDTO)but for a new user being registered.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveDeviceConfirmationForPersonalizeNFCTag(@NotNull UserLocatorVO locator, @NotNull TokenPrincipalTypeVO tokenTypeVO, String deviceConfirmationId)Removes a device confirmation for the given user.ExternalNFCTagAuthenticateDatarequestForExternalAuthenticate(ExternalNFCTagAuthenticateDTO dto)This method must be invoked to start a mutual authentication process between the server and the NFC tag (e.g.voidrequestNewOTPForPersonalizeNFCTag(UserLocatorVO locator, TokenPrincipalTypeVO tokenTypeVO, SendMedium medium)Generates a new OTP (removing any previous password, if any) and sends it to the user by the specified medium using the confirmation password type set for theBuiltInChannel.POSchannel for the specified user.
It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.protected ValidatorresolveValidator(TokenDTO dto)Page<TokenVO>search(TokenQuery params)Searches for tokens.voidsetActivationDeadline(@NotNull Long tokenId, DateTime dateTime)Changes the token activation deadline date.protected voidsetActivationDeadline(Token entity)protected voidsetExpiryAndActivationDate(Token entity)voidsetExpiryDate(@NotNull Long tokenId, DateTime dateTime)Changes the token expiry date.protected org.apache.commons.collections4.BidiMap<Class<? extends Token>,Class<? extends TokenDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.TokenDTOtoDTO(Token entity)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesTokentoEntity(TokenDTO dto)Converts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesvoidunblock(Long tokenId)Unblocks the given tokenvoidvalidateNFCChallenge(String challenge)Validates the challenge received from a NFC tag/device ensuring it's the same as the previously generated by Cyclos.DeviceConfirmationVOviewDeviceConfirmationForPersonalizeNFCTag(@NotNull UserLocatorVO locator, @NotNull TokenPrincipalTypeVO tokenTypeVO, String deviceConfirmationId)Loads the details of a confirmation belonging to the given user.-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getExcludedPropertiesToEntity, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onAfterRemove, onBeforeRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, validate
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, remove, removeAll, saveEntity, saveSkippingEntityLog, validate
-
-
-
-
Method Detail
-
activate
public Long activate(TokenActionDTO dto, UserLocatorVO locator) throws MaxTokenActivationAttemptsException, InvalidTokenException
Description copied from interface:TokenServiceSearches for a token with the given type and value specified in theTokenActionDTOparameter.
The token's status must beTokenStatus.UNASSIGNEDorTokenStatus.PENDING_ACTIVATIONbut assigned to the logged user or one of its operators.
If the token is unassigned then this method assigns it to the user specified by theUserLocatorVOparameter and change its status toTokenStatus.ACTIVE.
Otherwise (the token is already assigned and is pending by activation) it activates only.
This method can be used only by members (i.e. not administrators) with permission to activate the correspondingTokenPrincipalTypeVO. For administrators / brokers, seeTokenService.activatePending(Long)- Specified by:
activatein interfaceTokenService- Throws:
MaxTokenActivationAttemptsExceptionInvalidTokenException
-
activatePending
public void activatePending(Long tokenId)
Description copied from interface:TokenServiceActivates an already assigned token with statusTokenStatus.PENDING_ACTIVATION.
This operation can only be done by admins/brokers over tokens of managed users or member over tokens of its operators with permission to activate the correspondingTokenPrincipalTypeVO.- Specified by:
activatePendingin interfaceTokenService
-
assign
public void assign(@NotNull @NotNull Long tokenId, @NotNull @NotNull UserLocatorVO locator) throws FrameworkExceptionDescription copied from interface:TokenServiceAssigns a pending token to a user, leaving it in pending status The token status must beTokenStatus.UNASSIGNED.- Specified by:
assignin interfaceTokenService- Throws:
FrameworkException
-
barcode
public SerializableInputStream barcode(TokenBarcodeParams params) throws FrameworkException
Description copied from interface:TokenServiceReturns a barcode image of the token- Specified by:
barcodein interfaceTokenService- Throws:
FrameworkException
-
block
public void block(Long tokenId)
Description copied from interface:TokenServiceBlocks the given token- Specified by:
blockin interfaceTokenService
-
cancel
public void cancel(Long tokenId)
Description copied from interface:TokenServiceCancels the given token- Specified by:
cancelin interfaceTokenService
-
cancel
public void cancel(Token token)
- Specified by:
cancelin interfaceTokenServiceLocal- See Also:
TokenService.cancel(Long)
-
cancelAll
public void cancelAll(BasicUser user)
Description copied from interface:TokenServiceLocalCancels all active / blocked tokens of the given user- Specified by:
cancelAllin interfaceTokenServiceLocal
-
cancelNFCToken
public void cancelNFCToken(TokenActionDTO dto)
Description copied from interface:TokenServiceCancels the given NFC token. Admins and brokers with permissions can cancel a NFC token of typeTokenType.NFC_TAG.
In case of a NFC token of typeTokenType.NFC_DEVICEonly the logged user can cancel its own token.- Specified by:
cancelNFCTokenin interfaceTokenService
-
createDeviceConfirmationForPersonalizeNFCTag
public DeviceConfirmationVO createDeviceConfirmationForPersonalizeNFCTag(@NotNull @NotNull UserLocatorVO locator, @NotNull @NotNull TokenPrincipalTypeVO tokenTypeVO) throws FrameworkException
Description copied from interface:TokenServiceCreates a new pending device confirmation for the specified user. The logged user will be notified after the confirmation was processed. It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.- Specified by:
createDeviceConfirmationForPersonalizeNFCTagin interfaceTokenServicetokenTypeVO- the principal type used to personalize the card- Throws:
FrameworkException
-
deviceConfirmationBarcodeForPersonalizeNFCTag
public SerializableInputStream deviceConfirmationBarcodeForPersonalizeNFCTag(UserLocatorVO locator, @NotNull @NotNull TokenPrincipalTypeVO tokenTypeVO, DeviceConfirmationBarcodeParams params) throws FrameworkException
Description copied from interface:TokenServiceGenerates a two-dimensional barcode (QR code), only if the confirmation was not already approved nor rejected for the given payer. It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.- Specified by:
deviceConfirmationBarcodeForPersonalizeNFCTagin interfaceTokenServicetokenTypeVO- the principal type used to personalize the card- Throws:
FrameworkException
-
expireTokens
public long expireTokens()
Description copied from interface:TokenServiceLocalTakes all the tokens and switches their statuses to EXPIRED or ACTIVATION_EXPIRED for those who meet the conditions of these statuses.- Specified by:
expireTokensin interfaceTokenServiceLocal
-
exportTokens
public FileInfo exportTokens(@NotNull @NotNull ExportFormatVO formatVO, @NotNull @NotNull TokenQuery query) throws FrameworkException
Description copied from interface:TokenServiceExports the token search results to file- Specified by:
exportTokensin interfaceTokenService- Throws:
FrameworkException
-
firstActive
public Token firstActive(BasicUser user, TokenPrincipalType type) throws FrameworkException
Description copied from interface:TokenServiceLocalReturns the first token for the given basic user, whose status isTokenStatus.ACTIVE- Specified by:
firstActivein interfaceTokenServiceLocal- Throws:
FrameworkException
-
generateOnRegistrationTokens
public void generateOnRegistrationTokens(BasicUser user)
Description copied from interface:TokenServiceLocalGenerates the tokens that are configured to be generated upon registration- Specified by:
generateOnRegistrationTokensin interfaceTokenServiceLocal
-
getInitializeNFCTagData
public InitializeNFCTagData getInitializeNFCTagData() throws FrameworkException
Description copied from interface:TokenServiceReturns data with the token types available to initialize a blank NFC tag.
The available tokens to personalize the tag are returned too to allow initialization and personalization at the same time. Only allowed for managers (Brokers & Administrators).- Specified by:
getInitializeNFCTagDatain interfaceTokenService- Throws:
FrameworkException- See Also:
TokenService.initializeNFCTag(NFCTagInitializeDTO)
-
getKeyMask
public byte[] getKeyMask(NFCToken nfcToken)
Description copied from interface:TokenServiceLocalReturns the key mask used to encrypt/decrypt the nfc token's keys (AMK and Operational)- Specified by:
getKeyMaskin interfaceTokenServiceLocal
-
getListData
public TokensListData getListData(TokenPrincipalTypeVO tokenType, UserLocatorVO locator) throws FrameworkException
Description copied from interface:TokenServiceReturns data for listing tokens of a given type and user- Specified by:
getListDatain interfaceTokenService- Throws:
FrameworkException
-
getPersonalizeNFCTagData
public PersonalizeNFCTagData getPersonalizeNFCTagData(TokenPrincipalTypeVO tokenTypeVO, UserLocatorVO locator) throws FrameworkException
Description copied from interface:TokenServiceReturns data needed to personalize a NFC tag for the specified type and user.
ThePersonalizeNFCTagData.CONFIRMATION_PASSWORD_INPUTwill be null if the logged user manages the given user. ThePersonalizeNFCTagData.TOKEN_TYPEis the token principal type the tag was initialized for.- Specified by:
getPersonalizeNFCTagDatain interfaceTokenService- Throws:
FrameworkException
-
getReceiveTokenTypes
public List<TokenType> getReceiveTokenTypes() throws FrameworkException
Description copied from interface:TokenServiceLocalReturns a list with the token types used for receive payments- Specified by:
getReceiveTokenTypesin interfaceTokenServiceLocal- Throws:
FrameworkException
-
getSearchData
public TokenSearchData getSearchData(TokenPrincipalTypeVO tokenType)
Description copied from interface:TokenServiceReturns data for searching tokens- Specified by:
getSearchDatain interfaceTokenService
-
hasReachedMaxTokensPerUser
public boolean hasReachedMaxTokensPerUser(TokenPrincipalType type, BasicUser user, Token ignoredToken)
Description copied from interface:TokenServiceLocalReturns if the given user has reached the maximum possible assigned tokens- Specified by:
hasReachedMaxTokensPerUserin interfaceTokenServiceLocal
-
initializeNFCTag
public InitializeNFCTagResult initializeNFCTag(NFCTagInitializeDTO dto) throws FrameworkException, TokenAlreadyInUseException
Description copied from interface:TokenServiceInitializes and optionally personalize a NFC tag with the given data. If theTokenActionWithUserDTO.getUser()is not null then the token will be personalized for that user too. Returns the private keys (PICC Master Key (i.e. PMK), Application Master Key (i.e. AMK) and Operational key) to be stored into the tag.
Only allowed for managers (Brokers & Administrators).- Specified by:
initializeNFCTagin interfaceTokenService- Throws:
FrameworkExceptionTokenAlreadyInUseException
-
newEntity
public Token newEntity(TokenDataParams params)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<Token,TokenDTO,TokenData,TokenDataParams>- Specified by:
newEntityin classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
personalizeNFCTag
public void personalizeNFCTag(NFCTagPersonalizeDTO dto) throws FrameworkException, TokenAlreadyInUseException
Description copied from interface:TokenServicePersonalizes a NFC tag for the given user. If the logged user doesn't manages the user then the confirmation password of that user is required. This method requires a successful previous external authentication (TokenService.requestForExternalAuthenticate(ExternalNFCTagAuthenticateDTO))
The requiredNFCTagPersonalizeDTO.CYCLOS_CHALLENGEis the encrypted (hexadecimal string) challenge generated by the server (returned in the previous external authenticate) used to ensure the tag presence (internal authenticate)- Specified by:
personalizeNFCTagin interfaceTokenService- Throws:
FrameworkExceptionTokenAlreadyInUseException- See Also:
TokenService.requestForExternalAuthenticate(ExternalNFCTagAuthenticateDTO)
-
personalizeNFCTag
public void personalizeNFCTag(NFCTagWithChallengeDTO dto, BasicUser user) throws FrameworkException, TokenAlreadyInUseException
Description copied from interface:TokenServiceLocalSame asTokenService.personalizeNFCTag(NFCTagPersonalizeDTO)but for a new user being registered.- Specified by:
personalizeNFCTagin interfaceTokenServiceLocal- Throws:
FrameworkExceptionTokenAlreadyInUseException
-
removeDeviceConfirmationForPersonalizeNFCTag
public void removeDeviceConfirmationForPersonalizeNFCTag(@NotNull @NotNull UserLocatorVO locator, @NotNull @NotNull TokenPrincipalTypeVO tokenTypeVO, String deviceConfirmationId) throws FrameworkExceptionDescription copied from interface:TokenServiceRemoves a device confirmation for the given user. It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.- Specified by:
removeDeviceConfirmationForPersonalizeNFCTagin interfaceTokenServicetokenTypeVO- the principal type used to personalize the card- Throws:
FrameworkException
-
requestForExternalAuthenticate
public ExternalNFCTagAuthenticateData requestForExternalAuthenticate(ExternalNFCTagAuthenticateDTO dto) throws FrameworkException
Description copied from interface:TokenServiceThis method must be invoked to start a mutual authentication process between the server and the NFC tag (e.g. a card) to prove that both share the same secret key.
The authentication process is carried out in the following order:- Validate the identity of the server: external authenticate
- Validate the identity of the NFc tag: internal authenticate
- Specified by:
requestForExternalAuthenticatein interfaceTokenService- Parameters:
dto- contains the token type id (required), the token value (optional) and an encrypted challenge (required) generated by the tag in hexadecimal notation. If the token value is null then means the authentication process will be using the PICC Master Key (PMK).- Returns:
- data containing the following:
ExternalNFCTagAuthenticateData.CYCLOS_CHALLENGE: encrypted data (hexadecimal string) containing both: a new challenge generated by the server (used to validate the identity of the NFC tag, internal authenticate) and the original challenge generated by the tag processed according to the tag's authentication process. The (processed) original tag challenge will be used by the NFC tag to complete the server identity validation (external authenticate).ExternalNFCTagAuthenticateData.SESSION_KEY: A session key needed by the tag to allow send enciphered data to be written into the NFC tag
- Throws:
FrameworkException
-
requestNewOTPForPersonalizeNFCTag
public void requestNewOTPForPersonalizeNFCTag(UserLocatorVO locator, TokenPrincipalTypeVO tokenTypeVO, SendMedium medium) throws FrameworkException, SmsSendingException
Description copied from interface:TokenServiceGenerates a new OTP (removing any previous password, if any) and sends it to the user by the specified medium using the confirmation password type set for theBuiltInChannel.POSchannel for the specified user.
It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.- Specified by:
requestNewOTPForPersonalizeNFCTagin interfaceTokenServicetokenTypeVO- the principal type used to personalize the cardmedium- the medium used to send the OTP.- Throws:
SmsSendingException- only if medium isSendMedium.SMSand the OTP could not be sent to any enabled for sms phone.FrameworkException
-
search
public Page<TokenVO> search(TokenQuery params) throws FrameworkException, QueryParseException
Description copied from interface:TokenServiceSearches for tokens. This method can only be user by administrators or brokers.- Specified by:
searchin interfaceTokenService- Throws:
FrameworkExceptionQueryParseException
-
setActivationDeadline
public void setActivationDeadline(@NotNull @NotNull Long tokenId, DateTime dateTime) throws FrameworkExceptionDescription copied from interface:TokenServiceChanges the token activation deadline date. The token status must be eitherTokenStatus.PENDING_ACTIVATIONorTokenStatus.ACTIVATION_EXPIRED.- Specified by:
setActivationDeadlinein interfaceTokenService- Throws:
FrameworkException
-
setExpiryDate
public void setExpiryDate(@NotNull @NotNull Long tokenId, DateTime dateTime) throws FrameworkExceptionDescription copied from interface:TokenServiceChanges the token expiry date. The token status must be eitherTokenStatus.ACTIVE,TokenStatus.BLOCKEDorTokenStatus.EXPIRED.- Specified by:
setExpiryDatein interfaceTokenService- Throws:
FrameworkException
-
toDTO
public TokenDTO toDTO(Token entity)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<Token,TokenDTO,TokenData,TokenDataParams>- Overrides:
toDTOin classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
toEntity
public Token toEntity(TokenDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<Token,TokenDTO,TokenData,TokenDataParams>- Overrides:
toEntityin classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
unblock
public void unblock(Long tokenId)
Description copied from interface:TokenServiceUnblocks the given token- Specified by:
unblockin interfaceTokenService
-
validateNFCChallenge
public void validateNFCChallenge(String challenge) throws ValidationException
Description copied from interface:TokenServiceLocalValidates the challenge received from a NFC tag/device ensuring it's the same as the previously generated by Cyclos.- Specified by:
validateNFCChallengein interfaceTokenServiceLocal- Parameters:
challenge- the HEXA string send back by a NFC tag/device.- Throws:
ValidationException
-
viewDeviceConfirmationForPersonalizeNFCTag
public DeviceConfirmationVO viewDeviceConfirmationForPersonalizeNFCTag(@NotNull @NotNull UserLocatorVO locator, @NotNull @NotNull TokenPrincipalTypeVO tokenTypeVO, String deviceConfirmationId) throws FrameworkException
Description copied from interface:TokenServiceLoads the details of a confirmation belonging to the given user. It has the same security controls as forTokenService.personalizeNFCTag(NFCTagPersonalizeDTO), that is the logged user must be allowed to personalize a NFC Tag for the specified user.- Specified by:
viewDeviceConfirmationForPersonalizeNFCTagin interfaceTokenServicetokenTypeVO- the principal type used to personalize the card- Throws:
FrameworkException
-
getData
protected TokenData getData(Token token)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
onAfterSave
protected void onAfterSave(Token token, Token currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
onBeforeSave
protected Object onBeforeSave(Token token, Token currentCopy)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before saving an entity. Any returned value will be passed to theCRUDServiceImpl.onAfterSave(BaseEntity, BaseEntity, Object)method- Overrides:
onBeforeSavein classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
resolveValidator
protected Validator resolveValidator(TokenDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
setActivationDeadline
protected void setActivationDeadline(Token entity)
-
setExpiryAndActivationDate
protected void setExpiryAndActivationDate(Token entity)
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends Token>,Class<? extends TokenDTO>> subClassMappings()
Description copied from class:CRUDServiceImplShould be overridden by subclasses which handle entity / dto hierarchies. The map key should be the entity class, while the map value, the DTO class- Overrides:
subClassMappingsin classCRUDServiceImpl<Token,QToken,TokenDTO,TokenData,TokenDataParams>
-
-