Package org.cyclos.impl.system
Class CustomWebServiceServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.CRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
- org.cyclos.impl.system.CustomWebServiceServiceImpl
-
- All Implemented Interfaces:
CRUDServiceLocal<CustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>,CustomWebServiceServiceLocal,CRUDService<CustomWebServiceDTO,CustomWebServiceData,Void>,CRUDWithConfirmationPasswordService<CustomWebServiceDTO,CustomWebServiceData,Void>,Service,CustomWebServiceService
@Service public class CustomWebServiceServiceImpl extends CRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void> implements CustomWebServiceServiceLocal
-
-
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.CustomWebServiceServiceLocal
ATTR_CUSTOM_WEB_SERVICE, ATTR_PATH, ATTR_PATH_VARIABLES, ATTR_REQUEST
-
-
Constructor Summary
Constructors Constructor Description CustomWebServiceServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CustomWebServiceDatagetData(CustomWebService entity)Returns details data for the given entityprotected Object[]getExcludedPropertiesToDTO(CustomWebService entity)May be overridden in order to exclude properties when converting the given entity to DTOprotected Object[]getExcludedPropertiesToEntity(CustomWebServiceDTO dto)May be overridden in order to exclude properties when converting the given DTO to entityvoidinitialize()List<CustomWebServiceVO>list()Lists all available custom web servicesCustomWebServicenewEntity(Void params)Should be implemented in order to instantiate a new entity based on the given context parametersprotected voidonBeforeRemove(CustomWebService entity)May be overridden in order to perform custom logic before removing an entityprotected ObjectonBeforeSave(CustomWebService entity, CustomWebService currentCopy)May be overridden in order to perform custom logic before saving an entity.voidprepareContext(CustomWebServiceContext context, SessionData runAs, RequestInfo request)Collects in the given context all information needed to run a custom web service.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected ValidatorresolveValidator(CustomWebServiceDTO dto)ResponseInforun(CustomWebServiceContext context)Runs the custom web service associated to the request's uri.CustomWebServicetoEntity(CustomWebServiceDTO 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, onAfterSave, preProcessCurrentCopy, remove, remove, removeAll, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveDTOType, resolveEntityType, resolveExtensionPointAccessor, save, saveOrder, saveSkippingEntityLog, saveWithConfirmationPassword, shouldCheckConfirmationPassword, subClassMappings, toDTO, 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, toDTO, validate
-
-
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
-
list
public List<CustomWebServiceVO> list() throws FrameworkException
Description copied from interface:CustomWebServiceServiceLists all available custom web services- Specified by:
listin interfaceCustomWebServiceService- Throws:
FrameworkException
-
newEntity
public CustomWebService 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<CustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>- Specified by:
newEntityin classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
prepareContext
public void prepareContext(CustomWebServiceContext context, SessionData runAs, RequestInfo request) throws FrameworkException, ResponseException
Description copied from interface:CustomWebServiceServiceLocalCollects in the given context all information needed to run a custom web service.- Specified by:
prepareContextin interfaceCustomWebServiceServiceLocalrunAs- The session data resolved from client. May or may not be used, according to the resolvedCustomWebService'sRunAsfield.- Throws:
FrameworkExceptionResponseException
-
run
public ResponseInfo run(CustomWebServiceContext context) throws FrameworkException, ResponseException
Description copied from interface:CustomWebServiceServiceLocalRuns the custom web service associated to the request's uri.- Specified by:
runin interfaceCustomWebServiceServiceLocal- Throws:
ResponseException- When there is an error, indicates how the response is generatedFrameworkException
-
toEntity
public CustomWebService toEntity(CustomWebServiceDTO dto)
Description copied from class:CRUDServiceImplConverts the given DTO in an entity, handling theCRUDServiceImpl.subClassMappings()mappings for subclasses- Specified by:
toEntityin interfaceCRUDServiceLocal<CustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>- Overrides:
toEntityin classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
getData
protected CustomWebServiceData getData(CustomWebService entity)
Description copied from class:CRUDServiceImplReturns details data for the given entity- Specified by:
getDatain classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
getExcludedPropertiesToDTO
protected Object[] getExcludedPropertiesToDTO(CustomWebService entity)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given entity to DTO- Overrides:
getExcludedPropertiesToDTOin classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
getExcludedPropertiesToEntity
protected Object[] getExcludedPropertiesToEntity(CustomWebServiceDTO dto)
Description copied from class:CRUDServiceImplMay be overridden in order to exclude properties when converting the given DTO to entity- Overrides:
getExcludedPropertiesToEntityin classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
onBeforeRemove
protected void onBeforeRemove(CustomWebService entity)
Description copied from class:CRUDServiceImplMay be overridden in order to perform custom logic before removing an entity- Overrides:
onBeforeRemovein classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
onBeforeSave
protected Object onBeforeSave(CustomWebService entity, CustomWebService 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<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,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(CustomWebServiceDTO dto)
- Specified by:
resolveValidatorin classCRUDServiceImpl<CustomWebService,QCustomWebService,CustomWebServiceDTO,CustomWebServiceData,Void>
-
-