com.elasticpath.service.dataimport
Interface ImportService

All Superinterfaces:
EpPersistenceService, EpService
All Known Implementing Classes:
ImportServiceImpl

public interface ImportService
extends EpPersistenceService

Provide services of the import manager.


Method Summary
 ImportDataType findImportDataType(java.lang.String name)
          Find an import data type by name.
 ImportJob findImportJob(java.lang.String name)
          Find an import job by name.
 ImportJob getImportJob(long importJobUid)
          Get the import job with the given UID.
 ImportType getImportType(int importTypeId)
          Returns the import type with the given id.
 java.util.List getPreviewData(ImportJob importJob)
          Returns the preview data of the import data file.
 ImportRunningJob getRunningJob()
          Returns the running import job.
 java.util.List getTitleLine(ImportJob importJob)
          Returns the title line of the import csv data file.
 java.util.List listImportDataTypes()
          List all import data types.
 java.util.List listImportJobs()
          List all saved import jobs.
 java.util.List listImportTypes()
          List all import types.
 java.util.List runImportJob(ImportJob importJob)
          Run the import job.
 void saveOrUpdateImportJob(ImportJob importJob)
          Save or update the given importjob.
 java.util.List validataCsvFormat(ImportJob importJob)
          Validate the csv format of the import data file.
 java.util.List validateMappings(ImportJob importJob)
          Validate the import mappings specified in the importjob.
 
Methods inherited from interface com.elasticpath.service.EpPersistenceService
getObject, getPersistenceEngine, setPersistenceEngine
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Method Detail

findImportDataType

ImportDataType findImportDataType(java.lang.String name)
Find an import data type by name.

Parameters:
name - the import data type name
Returns:
the import data type of the given name if it exist, otherwise, null.

findImportJob

ImportJob findImportJob(java.lang.String name)
Find an import job by name.

Parameters:
name - the import job name
Returns:
the import job of the given name if it exist, otherwise, null.

getImportJob

ImportJob getImportJob(long importJobUid)
                       throws EpServiceException
Get the import job with the given UID. Return null if no matching record exists.

Parameters:
importJobUid - the importJob UID, give 0 if you want to create a new import job.
Returns:
the importJob if UID exists, otherwise null
Throws:
EpServiceException - - in case of any errors

getImportType

ImportType getImportType(int importTypeId)
Returns the import type with the given id.

Parameters:
importTypeId - the import type id
Returns:
the import type with the given id

getPreviewData

java.util.List getPreviewData(ImportJob importJob)
Returns the preview data of the import data file.

Parameters:
importJob - the import job
Returns:
a list of records for previewing

getRunningJob

ImportRunningJob getRunningJob()
Returns the running import job.

Returns:
the running import job

getTitleLine

java.util.List getTitleLine(ImportJob importJob)
Returns the title line of the import csv data file.

Parameters:
importJob - the import job
Returns:
a list of fields of the title line

listImportDataTypes

java.util.List listImportDataTypes()
List all import data types.

Returns:
a list of import data types.

listImportJobs

java.util.List listImportJobs()
List all saved import jobs.

Returns:
a list of saved import jobs.

listImportTypes

java.util.List listImportTypes()
List all import types.

Returns:
a list of import types.

runImportJob

java.util.List runImportJob(ImportJob importJob)
Run the import job.

Parameters:
importJob - the import job to run
Returns:
a list of lines that failed validation. If all lines are good, then returns an empty list.

saveOrUpdateImportJob

void saveOrUpdateImportJob(ImportJob importJob)
                           throws ImportJobExistException
Save or update the given importjob.

Parameters:
importJob - the importJob to save or update
Throws:
ImportJobExistException - - if the specified import job name is already in use.

validataCsvFormat

java.util.List validataCsvFormat(ImportJob importJob)
Validate the csv format of the import data file.

Parameters:
importJob - the import job
Returns:
a list of lines that not complying with the csv format. If all lines are good, then returns an empty list.

validateMappings

java.util.List validateMappings(ImportJob importJob)
Validate the import mappings specified in the importjob.

Parameters:
importJob - the import job
Returns:
a list of lines that not complying with the mappings. If all lines are good, then returns an empty list.