Package org.cyclos.impl.system
Class ChannelConfigurationServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<ChannelConfiguration,QChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>
-
- org.cyclos.impl.system.ChannelConfigurationServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<ChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>,ChannelConfigurationServiceLocal,CRUDService<ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>,CRUDWithConfirmationPasswordService<ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>,Service,ChannelConfigurationService
@Service public class ChannelConfigurationServiceImpl extends CRUDServiceImpl<ChannelConfiguration,QChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams> implements ChannelConfigurationServiceLocal
Implementation forChannelConfigurationService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.CRUDServiceImpl
$, ATTR_CURRENT_COPY, 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 ChannelConfigurationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanActivateTrustedDevice(Channel channel)Returns whether a device can be activated as trusted using the given channelprotected ChannelConfigurationDatagetData(ChannelConfiguration channelConfiguration)Returns details data for the given entityprotected Object[]getExcludedPropertiesToDTO(ChannelConfiguration entity)May be overridden in order to exclude properties when converting the given entity to DTOprotected Object[]getExcludedPropertiesToEntity(ChannelConfigurationDTO dto)May be overridden in order to exclude properties when converting the given DTO to entitybooleanisDeviceSupported(CredentialUsage usage, Channel channel)Returns whether the DEVICE is supported for the given usage and channel or not.booleanisUsedForAccess(PasswordType passwordType)Returns whether the give password type is used either as access password on any channelList<ChannelConfigurationVO>list(ConfigurationVO configurationVO)Returns all channel configurations for the given configurationChannelConfigurationnewEntity(ChannelConfigurationDataParams params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterRemove(ChannelConfiguration entity)May be overridden in order to perform custom logic after removing an entityprotected voidonAfterSave(ChannelConfiguration entity, ChannelConfiguration currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected ObjectonBeforeSave(ChannelConfiguration channelConfiguration, ChannelConfiguration currentCopy)May be overridden in order to perform custom logic before saving an entity.protected voidpreProcessCurrentCopy(ChannelConfigurationDTO dto, ChannelConfiguration currentCopy)This method is invoked before saving the entity and also, if the log is enabled, before removing.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(ChannelConfigurationDTO dto)protected org.apache.commons.collections4.BidiMap<Class<? extends ChannelConfiguration>,Class<? extends ChannelConfigurationDTO>>subClassMappings()Should be overridden by subclasses which handle entity / dto hierarchies.ChannelConfigurationDTOtoDTO(ChannelConfiguration channelConfiguration)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesChannelConfigurationtoEntity(ChannelConfigurationDTO 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, getNameLabel, getUniqueInternalNameQuery, getUniqueNameQuery, isEntityInternalNameRequired, isNameRequired, load, logEntity, onBeforeRemove, 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, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, delete, detach, 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
-
canActivateTrustedDevice
public boolean canActivateTrustedDevice(Channel channel)
Returns whether a device can be activated as trusted using the given channel- Specified by:
canActivateTrustedDevicein interfaceChannelConfigurationServiceLocal
-
isDeviceSupported
public boolean isDeviceSupported(CredentialUsage usage, Channel channel)
Returns whether the DEVICE is supported for the given usage and channel or not. If the usage is disabled for the channel then it returns false.- Specified by:
isDeviceSupportedin interfaceChannelConfigurationServiceLocal
-
isUsedForAccess
public boolean isUsedForAccess(PasswordType passwordType) throws FrameworkException
Description copied from interface:ChannelConfigurationServiceLocalReturns whether the give password type is used either as access password on any channel- Specified by:
isUsedForAccessin interfaceChannelConfigurationServiceLocal- Throws:
FrameworkException
-
list
public List<ChannelConfigurationVO> list(ConfigurationVO configurationVO) throws FrameworkException
Description copied from interface:ChannelConfigurationServiceReturns all channel configurations for the given configuration- Specified by:
listin interfaceChannelConfigurationService- Throws:
FrameworkException
-
newEntity
public ChannelConfiguration newEntity(ChannelConfigurationDataParams 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<ChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>- Specified by:
newEntityin classCRUDServiceImpl<ChannelConfiguration,QChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>
-
toDTO
public ChannelConfigurationDTO toDTO(ChannelConfiguration channelConfiguration)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<ChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>- Overrides:
toDTOin classCRUDServiceImpl<ChannelConfiguration,QChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>
-
toEntity
public ChannelConfiguration toEntity(ChannelConfigurationDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<ChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>- Overrides:
toEntityin classCRUDServiceImpl<ChannelConfiguration,QChannelConfiguration,ChannelConfigurationDTO,ChannelConfigurationData,ChannelConfigurationDataParams>
-
getData
protected ChannelConfigurationData getData(ChannelConfiguration channelConfiguration)
Description copied from class:CRUDServiceImplReturns details data for the given entity
-
getExcludedPropertiesToDTO
protected Object[] getExcludedPropertiesToDTO(ChannelConfiguration entity)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given entity to DTO
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(ChannelConfigurationDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity
-
onAfterRemove
protected void onAfterRemove(ChannelConfiguration entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after removing an entity
-
onAfterSave
protected void onAfterSave(ChannelConfiguration entity, ChannelConfiguration currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity
-
onBeforeSave
protected Object onBeforeSave(ChannelConfiguration channelConfiguration, ChannelConfiguration 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
-
preProcessCurrentCopy
protected void preProcessCurrentCopy(ChannelConfigurationDTO dto, ChannelConfiguration currentCopy)
Description copied from class:CRUDServiceImplThis method is invoked before saving the entity and also, if the log is enabled, before removing. Subclasses can override it to fetch lazy relationships, etc as the current copy will be detached. In case of removing (i.e the log is enabled for this entity) the dto parameter will be null.
-
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(ChannelConfigurationDTO dto)
-
subClassMappings
protected org.apache.commons.collections4.BidiMap<Class<? extends ChannelConfiguration>,Class<? extends ChannelConfigurationDTO>> 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
-
-