Package org.cyclos.impl.system
Class ServiceInterceptorServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
- org.cyclos.impl.system.ServiceInterceptorServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<ServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>,ServiceInterceptorServiceLocal,CRUDService<ServiceInterceptorDTO,ServiceInterceptorData,Void>,CRUDWithConfirmationPasswordService<ServiceInterceptorDTO,ServiceInterceptorData,Void>,Service,ServiceInterceptorService
@Service public class ServiceInterceptorServiceImpl extends CRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void> implements ServiceInterceptorServiceLocal
Implementation forServiceInterceptorService
-
-
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
-
Fields inherited from interface org.cyclos.impl.system.ServiceInterceptorServiceLocal
ATTR_CONTEXT, ATTR_INTERCEPTOR, ATTR_OPERATION, ATTR_SERVICE
-
-
Constructor Summary
Constructors Constructor Description ServiceInterceptorServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableAllInterceptorsInNetwork(NetworkVO vo)Disables all service interceptors in the given network.protected ServiceInterceptorDatagetData(ServiceInterceptor entity)Returns details data for the given entityprotected Object[]getExcludedPropertiesToDTO(ServiceInterceptor entity)May be overridden in order to exclude properties when converting the given entity to DTOprotected Object[]getExcludedPropertiesToEntity(ServiceInterceptorDTO dto)May be overridden in order to exclude properties when converting the given DTO to entitybooleanhasEnabledInterceptors(Network network)Returns whether the given network has at least one enabled service interceptorvoidinitialize()List<ServiceInterceptorVO>list()Lists all available service interceptorsServiceInterceptornewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonAfterSave(ServiceInterceptor interceptor, ServiceInterceptor currentCopy, Object dataFromOnBeforeSave)May be overridden in order to perform custom logic after saving an entityprotected voidonBeforeRemove(ServiceInterceptor interceptor)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(ServiceInterceptor interceptor, ServiceInterceptor 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 networkList<ServiceInterceptor>resolveInterceptors(Network network, Class<? extends Service> serviceInterface, Method operation)Resolve the service interceptors to be applied to an invocationprotected ValidatorresolveValidator(ServiceInterceptorDTO dto)voidsaveOrder(List<Long> ids)Saves the order of the given orderable entities idsServiceInterceptorDTOtoDTO(ServiceInterceptor entity)Converts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclassesServiceInterceptortoEntity(ServiceInterceptorDTO 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, onAfterRemove, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, 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
-
disableAllInterceptorsInNetwork
public void disableAllInterceptorsInNetwork(NetworkVO vo) throws FrameworkException
Description copied from interface:ServiceInterceptorServiceDisables all service interceptors in the given network. As a last resort, if an interceptor script is preventing the usage of the system, it is possible to switch to global mode and call this on the specific network. Must be in global mode to run.- Specified by:
disableAllInterceptorsInNetworkin interfaceServiceInterceptorService- Throws:
FrameworkException
-
hasEnabledInterceptors
public boolean hasEnabledInterceptors(Network network)
Description copied from interface:ServiceInterceptorServiceLocalReturns whether the given network has at least one enabled service interceptor- Specified by:
hasEnabledInterceptorsin interfaceServiceInterceptorServiceLocal
-
initialize
@PostConstruct public void initialize()
-
list
public List<ServiceInterceptorVO> list() throws FrameworkException
Description copied from interface:ServiceInterceptorServiceLists all available service interceptors- Specified by:
listin interfaceServiceInterceptorService- Throws:
FrameworkException
-
newEntity
public ServiceInterceptor newEntity(Void 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<ServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>- Specified by:
newEntityin classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
resolveInterceptors
public List<ServiceInterceptor> resolveInterceptors(Network network, Class<? extends Service> serviceInterface, Method operation)
Description copied from interface:ServiceInterceptorServiceLocalResolve the service interceptors to be applied to an invocation- Specified by:
resolveInterceptorsin interfaceServiceInterceptorServiceLocal
-
saveOrder
public void saveOrder(List<Long> ids)
Description copied from class:CRUDServiceImplSaves the order of the given orderable entities ids- Specified by:
saveOrderin interfaceServiceInterceptorService- Overrides:
saveOrderin classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
toDTO
public ServiceInterceptorDTO toDTO(ServiceInterceptor entity)
Description copied from class:CRUDServiceImplConverts the given entity in a DTO, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toDTOin interfaceCRUDServiceLocal<ServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>- Overrides:
toDTOin classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
toEntity
public ServiceInterceptor toEntity(ServiceInterceptorDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<ServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>- Overrides:
toEntityin classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
getData
protected ServiceInterceptorData getData(ServiceInterceptor entity)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
getExcludedPropertiesToDTO
protected Object[] getExcludedPropertiesToDTO(ServiceInterceptor entity)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given entity to DTO
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(ServiceInterceptorDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity
-
onAfterSave
protected void onAfterSave(ServiceInterceptor interceptor, ServiceInterceptor currentCopy, Object dataFromOnBeforeSave)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic after saving an entity- Overrides:
onAfterSavein classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
onBeforeRemove
protected void onBeforeRemove(ServiceInterceptor interceptor)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
onBeforeSave
protected Object onBeforeSave(ServiceInterceptor interceptor, ServiceInterceptor 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<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
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(ServiceInterceptorDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<ServiceInterceptor,QServiceInterceptor,ServiceInterceptorDTO,ServiceInterceptorData,Void>
-
-