Package org.cyclos.impl.system
Class TokenImportHandlerImpl
-
- All Implemented Interfaces:
ImportHandler<TokenImportedFileDTO,TokenImportedFileData,TokenImportedFile,Token>
@Component public class TokenImportHandlerImpl extends BaseImportHandlerImpl<TokenImportedFileDTO,TokenImportedFileData,TokenImportedFile,Token>
Handler for token import
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<String>REQUIRED_HEADERS-
Fields inherited from class org.cyclos.impl.system.BaseImportHandlerImpl
currencyService, rawEntityManagerHandler
-
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 TokenImportHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Predicate<String>getAllowedImportFieldsPredicate(TokenImportedFile importedFile)Returns a predicate that evaluates true for a field allowed to be importedTokenImportedFileDatagetData(TokenImportedFile importedFile)Returns the data associated to an importClass<Token>getEntityClass()Returns the class of the imported entityClass<TokenImportedFile>getImportedFileClass()Returns the imported file classImportTypegetImportType()Returns the type of imports handled by this classList<String>getKeywordFields()Returns a list of field names that can be used to search for imported linesSet<String>getMissingRequiredFields(TokenImportedFile importedFile, List<String> headers)Return the fields that are required and are not present in the given headers.List<ImportField>getSearchImportedLineFields()Returns the list of fields that will be used to show the information of import lines.ObjectinstantiateContext()Returns an import context that will be used in the validation and processing of each import line.TokenImportedFilenewImportedFile(TokenImportedFileDTO dto)Instantiates anImportedFilea new entity based on a dtoTokenprocessImportedLine(ImportedLine importedLine, Object processContext)Imports an entity with the information in the imported line and returns the imported entity.ValidatorresolveValidator(TokenImportedFileDTO dto)Returns a new validator for the import.voidvalidateImportedLine(ImportedLine importedLine, Object context)Validates the imported line-
Methods inherited from class org.cyclos.impl.system.BaseImportHandlerImpl
fieldName, find, finishImport, getImportField, locateUser, locateUser, parseAmount, parseBoolean, parseDate, parseDateTime
-
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
-
-
-
-
Method Detail
-
getAllowedImportFieldsPredicate
public Predicate<String> getAllowedImportFieldsPredicate(TokenImportedFile importedFile)
Description copied from interface:ImportHandlerReturns a predicate that evaluates true for a field allowed to be imported
-
getData
public TokenImportedFileData getData(TokenImportedFile importedFile)
Description copied from interface:ImportHandlerReturns the data associated to an import
-
getEntityClass
public Class<Token> getEntityClass()
Description copied from interface:ImportHandlerReturns the class of the imported entity
-
getImportedFileClass
public Class<TokenImportedFile> getImportedFileClass()
Description copied from interface:ImportHandlerReturns the imported file class
-
getImportType
public ImportType getImportType()
Description copied from interface:ImportHandlerReturns the type of imports handled by this class
-
getKeywordFields
public List<String> getKeywordFields()
Description copied from interface:ImportHandlerReturns a list of field names that can be used to search for imported lines
-
getMissingRequiredFields
public Set<String> getMissingRequiredFields(TokenImportedFile importedFile, List<String> headers)
Description copied from interface:ImportHandlerReturn the fields that are required and are not present in the given headers.
-
getSearchImportedLineFields
public List<ImportField> getSearchImportedLineFields()
Description copied from interface:ImportHandlerReturns the list of fields that will be used to show the information of import lines.
-
instantiateContext
public Object instantiateContext()
Description copied from interface:ImportHandlerReturns an import context that will be used in the validation and processing of each import line.
-
newImportedFile
public TokenImportedFile newImportedFile(TokenImportedFileDTO dto)
Description copied from interface:ImportHandlerInstantiates anImportedFilea new entity based on a dto
-
processImportedLine
public Token processImportedLine(ImportedLine importedLine, Object processContext)
Description copied from interface:ImportHandlerImports an entity with the information in the imported line and returns the imported entity.
-
resolveValidator
public Validator resolveValidator(TokenImportedFileDTO dto)
Description copied from interface:ImportHandlerReturns a new validator for the import.
-
validateImportedLine
public void validateImportedLine(ImportedLine importedLine, Object context)
Description copied from interface:ImportHandlerValidates the imported line
-
-