Package org.cyclos.impl.access
Class IdentityProviderServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
- org.cyclos.impl.access.IdentityProviderServiceImpl
-
- All Implemented Interfaces:
IdentityProviderServiceLocal,CRUDServiceLocal<IdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>,IdentityProviderService,CRUDService<IdentityProviderDTO,IdentityProviderData,IdentityProviderType>,CRUDWithConfirmationPasswordService<IdentityProviderDTO,IdentityProviderData,IdentityProviderType>,Service
@Service public class IdentityProviderServiceImpl extends CRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType> implements IdentityProviderServiceLocal
Local interface forIdentityProviderService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, cacheHandler, dtoClass, entityClass, extensionPointService, idPath, internalNamePath, namePath, ownerEntityIdPath, ownerEntityPath, ownerEntityPropertyName, passwordHandler, 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 IdentityProviderServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IdentityProviderDatagetData(IdentityProvider idp)Returns details data for the given entityprotected Object[]getExcludedPropertiesToEntity(IdentityProviderDTO dto)May be overridden in order to exclude properties when converting the given DTO to entityprotected Pair<DBQuery<?>,String>getUniqueNameQuery(IdentityProviderDTO dto)This method may be overridden to customize the default global unique validation for the name property.protected booleanisEntityInternalNameRequired()NOTE: This method will be only invoked if the entity is anIInternalNamedEntity.List<IdentityProviderVO>list()Returns all identity providersList<IdentityProvider>listEnabled(BasicUser user)Returns all enabled providers for the given userIdentityProvidernewEntity(IdentityProviderType type)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(IdentityProvider entity, IdentityProvider currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(IdentityProvider entity)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(IdentityProvider provider, IdentityProvider currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkIdentityProviderRequestResultrequest(@NotNull IdentityProviderRequest request)Prepares an operation using an identity provider.protected ValidatorresolveValidator(IdentityProviderDTO dto)protected org.apache.commons.collections4.BidiMap<Class<? extends IdentityProvider>,Class<? extends IdentityProviderDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.IdentityProviderDTOtoDTO(IdentityProvider entity)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesIdentityProvidertoEntity(IdentityProviderDTO dto)Converts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses-
Methods inherited from class org.cyclos.impl.CRUDServiceImpl
addCustomInternalNameValidations, addCustomNameValidations, checkConfirmationPassword, doRemove, find, findAll, from, getConfirmationPasswordInput, getConfirmationPasswordInputForRemove, getData, getDataForNew, getDeviceConfirmationParams, getEntityClass, getEntityInternalNameKey, getExcludedPropertiesToDTO, getNameLabel, getUniqueInternalNameQuery, isNameRequired, load, logEntity, onAfterRemove, 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
-
Methods inherited from interface org.cyclos.services.access.IdentityProviderService
saveOrder
-
-
-
-
Method Detail
-
list
public List<IdentityProviderVO> list() throws FrameworkException
Description copied from interface:IdentityProviderServiceReturns all identity providers- Specified by:
listin interfaceIdentityProviderService- Throws:
FrameworkException
-
listEnabled
public List<IdentityProvider> listEnabled(BasicUser user)
Description copied from interface:IdentityProviderServiceLocalReturns all enabled providers for the given user- Specified by:
listEnabledin interfaceIdentityProviderServiceLocal
-
newEntity
public IdentityProvider newEntity(IdentityProviderType type)
Description copied from class:CRUDServiceImplShould be implemented in order to instantiate a new entity based on the given context parameters- Specified by:
newEntityin interfaceCRUDServiceLocal<IdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>- Specified by:
newEntityin classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
request
public IdentityProviderRequestResult request(@NotNull @NotNull IdentityProviderRequest request) throws FrameworkException
Description copied from interface:IdentityProviderServicePrepares an operation using an identity provider.- Specified by:
requestin interfaceIdentityProviderService- Throws:
FrameworkException
-
toDTO
public IdentityProviderDTO toDTO(IdentityProvider entity)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<IdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>- Overrides:
toDTOin classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
toEntity
public IdentityProvider toEntity(IdentityProviderDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<IdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>- Overrides:
toEntityin classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
getData
protected IdentityProviderData getData(IdentityProvider idp)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(IdentityProviderDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity
-
getUniqueNameQuery
protected Pair<DBQuery<?>,String> getUniqueNameQuery(IdentityProviderDTO dto)
Description copied from class:CRUDServiceImplThis method may be overridden to customize the default global unique validation for the name property. Also it must return a string with the context to be included in the key used for the lock (LockKey#LockType)
-
isEntityInternalNameRequired
protected boolean isEntityInternalNameRequired()
Description copied from class:CRUDServiceImplNOTE: This method will be only invoked if the entity is anIInternalNamedEntity. Subclasses could override it if the internal name is required.- Overrides:
isEntityInternalNameRequiredin classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>- Returns:
- false (optional by default)
-
onAfterSave
protected void onAfterSave(IdentityProvider entity, IdentityProvider currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
onBeforeRemove
protected void onBeforeRemove(IdentityProvider entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
onBeforeSave
protected Object onBeforeSave(IdentityProvider provider, IdentityProvider 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<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
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(IdentityProviderDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends IdentityProvider>,Class<? extends IdentityProviderDTO>> 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<IdentityProvider,QIdentityProvider,IdentityProviderDTO,IdentityProviderData,IdentityProviderType>
-
-