Package org.cyclos.security.system
Class ImportServiceSecurity
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.security.BaseServiceSecurity
-
- org.cyclos.security.CRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
- org.cyclos.security.system.ImportServiceSecurity
-
- All Implemented Interfaces:
CRUDService<ImportedFileDTO,ImportedFileData,ImportedFileDataParams>,CRUDWithConfirmationPasswordService<ImportedFileDTO,ImportedFileData,ImportedFileDataParams>,Service,ImportService
@Security public class ImportServiceSecurity extends CRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams> implements ImportService
Security forImportService
-
-
Field Summary
-
Fields inherited from class org.cyclos.security.CRUDServiceSecurity
entityClass
-
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 ImportServiceSecurity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanabort(Long importedFileId)Attempts to trigger the abort process of the given import.protected voidcheckCreateNew(ImportedFileDataParams params)Checks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif notprotected booleandoHasManageAccess(ImportedFile importedFile)Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given operationbooleandoHasViewAccess(ImportedFile importedFile)Should be implemented in order to return whether the caller is allowed to view the given entity.protected ImportServiceLocalgetImplementation()Should be implemented in order to return the actual implementation of the serviceImportedLineDatagetImportedLineData(Long importedLineId)Returns the imported line dataImportProgressVOgetImportProgress(Long importedFileId)Returns a double between 0 and 1 indicating the progress of the given import.ImportedFileSearchDatagetSearchData(ImportSearchContext context, UserLocatorVO user)Returns information to perform searches over imports.booleanisAccessible(SessionData sessionData, ImportedFile entity)Must be implemented in order to determine whether the given entity is accessible for the given session data.voidmarkAsSkipped(Long importedFileId, List<Long> lineIds, boolean skipped)Sets if the lines should be skipped by the import process or not based on the skipped parameter.protected voidonBeforeSave(ImportedFileDTO dto, ImportedFile entity)voidprocess(Long importedFileId)Starts an importvoidsaveDescription(Long importedFileId, String descrption)Saves the description for the specified imported file id.voidsaveImportedLine(ImportedLineDTO importedLineDTO)Saves the values of the imported linePage<ImportedFileVO>search(ImportedFileQuery params)Returns the imports that satisfy the query restrictions.Page<ImportedLineVO>searchImportedLines(ImportedLineQuery params)Returns the imported lines that matches the query restrictions.Longupload(ImportedFileDTO dto, SerializableInputStream input, String confirmationPassword)Uploads a file to be imported.-
Methods inherited from class org.cyclos.security.CRUDServiceSecurity
canPerformOperation, canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, customizeData, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, remove, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityCheck, save, saveWithConfirmationPassword
-
Methods inherited from class org.cyclos.security.BaseServiceSecurity
checkGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initialize
-
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.services.CRUDWithConfirmationPasswordService
getConfirmationPasswordInputForRemove, removeAllWithConfirmationPassword, removeWithConfirmationPassword, saveWithConfirmationPassword
-
-
-
-
Method Detail
-
abort
public boolean abort(Long importedFileId) throws FrameworkException
Description copied from interface:ImportServiceAttempts to trigger the abort process of the given import. If can returns true, otherwise returns false.- Specified by:
abortin interfaceImportService- Throws:
FrameworkException
-
doHasViewAccess
public boolean doHasViewAccess(ImportedFile importedFile)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to view the given entity.- Specified by:
doHasViewAccessin classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
getImportedLineData
public ImportedLineData getImportedLineData(Long importedLineId)
Description copied from interface:ImportServiceReturns the imported line data- Specified by:
getImportedLineDatain interfaceImportService
-
getImportProgress
public ImportProgressVO getImportProgress(Long importedFileId) throws FrameworkException
Description copied from interface:ImportServiceReturns a double between 0 and 1 indicating the progress of the given import.- Specified by:
getImportProgressin interfaceImportService- Throws:
FrameworkException
-
getSearchData
public ImportedFileSearchData getSearchData(ImportSearchContext context, UserLocatorVO user) throws FrameworkException
Description copied from interface:ImportServiceReturns information to perform searches over imports.- Specified by:
getSearchDatain interfaceImportService- Throws:
FrameworkException
-
isAccessible
public boolean isAccessible(SessionData sessionData, ImportedFile entity)
Description copied from class:CRUDServiceSecurityMust be implemented in order to determine whether the given entity is accessible for the given session data. This method shouldn't check the same condition asCRUDServiceSecurity.hasViewAccess(BaseEntity). If the only condition for an entity isCRUDServiceSecurity.hasViewAccess(BaseEntity), this method should return false.- Specified by:
isAccessiblein classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
markAsSkipped
public void markAsSkipped(Long importedFileId, List<Long> lineIds, boolean skipped) throws FrameworkException
Description copied from interface:ImportServiceSets if the lines should be skipped by the import process or not based on the skipped parameter. It is only possible to mark as skipped/not skipped the lines that were validated successfully.- Specified by:
markAsSkippedin interfaceImportService- Throws:
FrameworkException
-
process
public void process(Long importedFileId)
Description copied from interface:ImportServiceStarts an import- Specified by:
processin interfaceImportService
-
saveDescription
public void saveDescription(Long importedFileId, String descrption)
Description copied from interface:ImportServiceSaves the description for the specified imported file id.- Specified by:
saveDescriptionin interfaceImportService
-
saveImportedLine
public void saveImportedLine(ImportedLineDTO importedLineDTO)
Description copied from interface:ImportServiceSaves the values of the imported line- Specified by:
saveImportedLinein interfaceImportService
-
search
public Page<ImportedFileVO> search(ImportedFileQuery params) throws FrameworkException
Description copied from interface:ImportServiceReturns the imports that satisfy the query restrictions.- Specified by:
searchin interfaceImportService- Throws:
FrameworkException
-
searchImportedLines
public Page<ImportedLineVO> searchImportedLines(ImportedLineQuery params)
Description copied from interface:ImportServiceReturns the imported lines that matches the query restrictions.- Specified by:
searchImportedLinesin interfaceImportService
-
upload
public Long upload(ImportedFileDTO dto, SerializableInputStream input, String confirmationPassword) throws FrameworkException
Description copied from interface:ImportServiceUploads a file to be imported. The confirmation password is only checked depending on the imported file type.- Specified by:
uploadin interfaceImportService- Returns:
- the imported file id.
- Throws:
FrameworkException- See Also:
ImportType.requiresConfirmationPassword()
-
checkCreateNew
protected void checkCreateNew(ImportedFileDataParams params)
Description copied from class:CRUDServiceSecurityChecks whether creating new entities with the given context parameters is allowed, throwingPermissionDeniedExceptionif not- Specified by:
checkCreateNewin classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
doHasManageAccess
protected boolean doHasManageAccess(ImportedFile importedFile)
Description copied from class:CRUDServiceSecurityShould be implemented in order to return whether the caller is allowed to manage the given entity, for the given operation- Specified by:
doHasManageAccessin classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
getImplementation
protected ImportServiceLocal getImplementation()
Description copied from class:CRUDServiceSecurityShould be implemented in order to return the actual implementation of the service- Specified by:
getImplementationin classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
onBeforeSave
protected void onBeforeSave(ImportedFileDTO dto, ImportedFile entity)
- Overrides:
onBeforeSavein classCRUDServiceSecurity<ImportedFileDTO,ImportedFile,ImportedFileData,ImportedFileDataParams>
-
-