Package org.cyclos.impl.system
Class TempImageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.BaseImageServiceImpl<TempImage,QTempImage,NewTempImageParams>
-
- org.cyclos.impl.system.TempImageServiceImpl
-
- All Implemented Interfaces:
BaseImageServiceLocal<TempImage,NewTempImageParams>,TempImageServiceLocal,Service,BaseImageService<NewTempImageParams>,TempImageService
@Service public class TempImageServiceImpl extends BaseImageServiceImpl<TempImage,QTempImage,NewTempImageParams> implements TempImageServiceLocal
Implementation forTempImageService
-
-
Field Summary
Fields Modifier and Type Field Description protected BeanHandlerbeanHandler-
Fields inherited from class org.cyclos.impl.system.BaseImageServiceImpl
$, imageHandler, imageType, nature
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, 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.TempImageServiceLocal
HOURS_FOR_EXPIRATION, TEMP_OWNER
-
-
Constructor Summary
Constructors Constructor Description TempImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longdeleteExpiredImages()Deletes the expired temporary images from the database and the corresponding contents from the content storage.List<ImageVO>list(NewTempImageParams params)Lists the temporary images owned by the current user or guest for the given target.voidmove(TempImage temp, StoredFile image)Move the content of the given temp image to a final destinationTempImagenewImage(NewTempImageParams params)Returns a new image for the given parametersvoidpreProcess(NewTempImageParams params)Makes sure that the target in the given parameter is valid.protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected voidvalidateMaxImages(NewTempImageParams params)May be overridden in order to validate maximum images upload limit-
Methods inherited from class org.cyclos.impl.system.BaseImageServiceImpl
find, findByKey, getImageNature, isKeepOriginalContent, onAfterRemove, onAfterSave, onBeforeRemove, readContent, readContentByKey, remove, removeAll, save, saveName, setDataAndPersist, setImageName
-
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.system.BaseImageService
remove, removeAll, save, saveName
-
Methods inherited from interface org.cyclos.impl.system.BaseImageServiceLocal
find, getImageNature, readContent, readContentByKey
-
-
-
-
Field Detail
-
beanHandler
@Autowired protected BeanHandler beanHandler
-
-
Method Detail
-
deleteExpiredImages
public final long deleteExpiredImages()
Description copied from interface:TempImageServiceLocalDeletes the expired temporary images from the database and the corresponding contents from the content storage.- Specified by:
deleteExpiredImagesin interfaceTempImageServiceLocal
-
list
public List<ImageVO> list(NewTempImageParams params) throws FrameworkException
Description copied from interface:TempImageServiceLists the temporary images owned by the current user or guest for the given target. Guests are matched by key (or remote address if none is given)- Specified by:
listin interfaceTempImageService- Throws:
FrameworkException
-
move
public void move(TempImage temp, StoredFile image)
Description copied from interface:TempImageServiceLocalMove the content of the given temp image to a final destination- Specified by:
movein interfaceTempImageServiceLocal
-
newImage
public TempImage newImage(NewTempImageParams params)
Description copied from class:BaseImageServiceImplReturns a new image for the given parameters- Specified by:
newImagein classBaseImageServiceImpl<TempImage,QTempImage,NewTempImageParams>
-
preProcess
public void preProcess(NewTempImageParams params)
Description copied from interface:TempImageServiceLocalMakes sure that the target in the given parameter is valid. When the target is null, setsTempImageTarget.USER_REGISTRATIONwhen there's no custom field, orTempImageTarget.CUSTOM_VALUEwhen there is one. Also validate the user parameter, setting the default to the logged user when required.- Specified by:
preProcessin interfaceTempImageServiceLocal
-
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
-
validateMaxImages
protected void validateMaxImages(NewTempImageParams params) throws MaxItemsException
Description copied from class:BaseImageServiceImplMay be overridden in order to validate maximum images upload limit- Overrides:
validateMaxImagesin classBaseImageServiceImpl<TempImage,QTempImage,NewTempImageParams>- Throws:
MaxItemsException
-
-