Package org.cyclos.impl.system
Class ImportedImageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.BaseImageServiceImpl<I,A,NP>
-
- org.cyclos.impl.system.BaseCategorizedImageServiceImpl<I,O,A,NP>
-
- org.cyclos.impl.system.BaseOwnedImageServiceImpl<ImportedFile,ImportedImage,QImportedImage,ImportedFileVO>
-
- org.cyclos.impl.system.ImportedImageServiceImpl
-
- All Implemented Interfaces:
BaseCategorizedImageServiceLocal<ImportedImage,ImportedFile,ImportedFileVO>,BaseImageServiceLocal<ImportedImage,ImportedFileVO>,BaseOwnedImageServiceLocal<ImportedFile,ImportedImage,ImportedFileVO>,ImportedImageServiceLocal,Service,BaseCategorizedImageService<ImportedFileVO>,BaseImageService<ImportedFileVO>,BaseOwnedImageService<ImportedFileVO>
@Service public class ImportedImageServiceImpl extends BaseOwnedImageServiceImpl<ImportedFile,ImportedImage,QImportedImage,ImportedFileVO> implements ImportedImageServiceLocal
Implementation forImportedImageServiceLocal
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.system.BaseOwnedImageServiceImpl
beanHandler, tempImageService
-
Fields inherited from class org.cyclos.impl.system.BaseCategorizedImageServiceImpl
categoryPath, categoryType
-
Fields inherited from class org.cyclos.impl.system.BaseImageServiceImpl
$, imageHandler, imageType, nature, storedFileHandler
-
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 ImportedImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisTempValid(ImportedFile owner, TempImage temp)Must be implemented to return whether the given temporary image is valid for the given ownerprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkprotected intresolveMaxImages(ImportedFile owner)Must be implemented in order to resolve the maximum images upload limit.protected voidsetFirstImage(ImportedImage image, ImportedFile owner, Supplier<Boolean> mustSetGuard)We override it to change the way we set the first image to the owner.protected voidsetImageName(String name, ImportedImage image)-
Methods inherited from class org.cyclos.impl.system.BaseOwnedImageServiceImpl
customizeListByCategoryQuery, doAddImage, importTempImage, importTempImages, isCategoryActive, newImage, newOrder, onAfterRemove, onAfterSave, onBeforeRemove, onOrderChanged, physicallyAddImage, removeAll, saveOrder
-
Methods inherited from class org.cyclos.impl.system.BaseCategorizedImageServiceImpl
count, findCategory, getListData, isRequired, list, listByCategory, remove, save, toCategory, validateMaxImages, validateMaxImages
-
Methods inherited from class org.cyclos.impl.system.BaseImageServiceImpl
find, findByKey, getImageNature, isKeepOriginalContent, readContent, readContentByKey, remove, removeAll, saveName, setDataAndPersist
-
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, 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.BaseCategorizedImageService
getListData, list
-
Methods inherited from interface org.cyclos.impl.system.BaseCategorizedImageServiceLocal
listByCategory, removeAll
-
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
-
Methods inherited from interface org.cyclos.services.system.BaseOwnedImageService
saveOrder
-
Methods inherited from interface org.cyclos.impl.system.BaseOwnedImageServiceLocal
importTempImage, importTempImages
-
-
-
-
Method Detail
-
isTempValid
protected boolean isTempValid(ImportedFile owner, TempImage temp)
Description copied from class:BaseOwnedImageServiceImplMust be implemented to return whether the given temporary image is valid for the given owner- Specified by:
isTempValidin classBaseOwnedImageServiceImpl<ImportedFile,ImportedImage,QImportedImage,ImportedFileVO>
-
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
-
resolveMaxImages
protected int resolveMaxImages(ImportedFile owner)
Description copied from class:BaseCategorizedImageServiceImplMust be implemented in order to resolve the maximum images upload limit. Returns a negative number for unlimited upload.- Specified by:
resolveMaxImagesin classBaseCategorizedImageServiceImpl<ImportedImage,ImportedFile,QImportedImage,ImportedFileVO>
-
setFirstImage
protected void setFirstImage(ImportedImage image, ImportedFile owner, Supplier<Boolean> mustSetGuard)
We override it to change the way we set the first image to the owner. In case of imported files there is not concurrent access to the sameImportedFilebecause each import will create a new file then there is not need to lock the access.
The implementation in the superclass will force a refresh of theImportedFilethen causing errors when the import has finished because the changes made to the file (e.g the new status) will be lost.- Overrides:
setFirstImagein classBaseOwnedImageServiceImpl<ImportedFile,ImportedImage,QImportedImage,ImportedFileVO>- Parameters:
image- the image to be set. Could be null.mustSetGuard- The image will be set only if the given boolean supplier returns true. Take into account this guard will be invoked twice if the first time it returns true (one before entering the critical section and the other after the lock was acquired).
-
setImageName
protected void setImageName(String name, ImportedImage image)
- Overrides:
setImageNamein classBaseImageServiceImpl<ImportedImage,QImportedImage,ImportedFileVO>
-
-