Package com.kazurayam.materialstore.core
Class StoreImpl
java.lang.Object
com.kazurayam.materialstore.core.StoreImpl
- All Implemented Interfaces:
Store
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
contains
(JobName jobName, JobTimestamp jobTimestamp) int
copyMaterials
(JobName jobName, JobTimestamp source, JobTimestamp target) int
deleteJobName
(JobName jobName) int
deleteJobTimestamp
(JobName jobName, JobTimestamp jobTimestamp) long
findAllJobTimestamps
(JobName jobName) findAllJobTimestampsPriorTo
(JobName jobName, JobTimestamp baseJobTimestamp) findAllReportsOf
(JobName jobName) findDifferentiatingJobTimestamps
(JobName jobName) findJobTimestampPriorTo
(JobName jobName, JobTimestamp jobTimestamp) findJobTimestampsReferredBy
(JobName jobName, JobTimestamp jobTimestamp) findLatestJobTimestamp
(JobName jobName) findNthJobTimestamp
(JobName jobName, int nth) getCachedJobber
(JobName jobName, JobTimestamp jobTimestamp) getJobber
(JobName jobName, JobTimestamp jobTimestamp) return an instance of Job.getPathOf
(JobName jobName, JobTimestamp jobTimestamp) getRoot()
boolean
hasDifferentiatingIndexEntry
(JobName jobName, JobTimestamp jobTimestamp) markNewerThanOrEqualTo
(JobName jobName, JobTimestamp newerThanOrEqualTo) markOlderThan
(JobName jobName, JobTimestamp olderThan) queryAllJobTimestamps
(JobName jobName, QueryOnMetadata query) queryAllJobTimestampsPriorTo
(JobName jobName, QueryOnMetadata query, JobTimestamp jobTimestamp) queryJobTimestampPriorTo
(JobName jobName, QueryOnMetadata query, JobTimestamp jobTimestamp) queryLatestJobTimestamp
(JobName jobName, QueryOnMetadata query) byte[]
readAllLines
(Material material) readAllLines
(Material material, Charset charset) reflect
(MaterialList base) reflect
(MaterialList baseMaterialList, JobTimestamp priorTo) look up a MaterialList out of this store, of which JobName and JobTimestamp meets the criteria specified by the given parameters.resolveReportFileName
(JobName jobName, JobTimestamp jobTimestamp) long
select
(JobName jobName, JobTimestamp jobTimestamp) select
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType) select
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, QueryOnMetadata query) select
(JobName jobName, JobTimestamp jobTimestamp, QueryOnMetadata query) selectSingle
(JobName jobName, JobTimestamp jobTimestamp) selectSingle
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType) selectSingle
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, QueryOnMetadata query) selectSingle
(JobName jobName, JobTimestamp jobTimestamp, QueryOnMetadata query) static byte[]
toByteArray
(InputStream inputStream) toString()
write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata metadata, byte[] input) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, byte[] input, StoreWriteParameter writeParam) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, BufferedImage input) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata metadata, BufferedImage input, StoreWriteParameter writeParam) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, File input, StoreWriteParameter writeParam) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, StoreWriteParameter writeParam) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, Charset charset) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, Charset charset, StoreWriteParameter writeParam) write
(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, Path input, StoreWriteParameter writeParam)
-
Field Details
-
NULL_OBJECT
-
-
Constructor Details
-
StoreImpl
-
-
Method Details
-
copyMaterials
public int copyMaterials(JobName jobName, JobTimestamp source, JobTimestamp target) throws MaterialstoreException - Specified by:
copyMaterials
in interfaceStore
- Throws:
MaterialstoreException
-
deleteJobName
- Specified by:
deleteJobName
in interfaceStore
- Throws:
MaterialstoreException
-
deleteJobTimestamp
public int deleteJobTimestamp(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
deleteJobTimestamp
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
export
- Specified by:
export
in interfaceStore
- Throws:
MaterialstoreException
-
findAllJobNames
- Specified by:
findAllJobNames
in interfaceStore
- Throws:
MaterialstoreException
-
findAllJobTimestamps
public List<JobTimestamp> findAllJobTimestamps(JobName jobName) throws JobNameNotFoundException, MaterialstoreException - Specified by:
findAllJobTimestamps
in interfaceStore
- Parameters:
jobName
- JobName instance- Returns:
- List of JobTimestamp objects in the jobName directory. The returned list is sorted in reverse order (the latest timestamp should come first)
- Throws:
JobNameNotFoundException
MaterialstoreException
-
findAllJobTimestampsPriorTo
public List<JobTimestamp> findAllJobTimestampsPriorTo(JobName jobName, JobTimestamp baseJobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
findAllJobTimestampsPriorTo
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
findAllReportsOf
- Specified by:
findAllReportsOf
in interfaceStore
- Throws:
MaterialstoreException
-
findDifferentiatingJobTimestamps
public List<JobTimestamp> findDifferentiatingJobTimestamps(JobName jobName) throws MaterialstoreException, JobNameNotFoundException - Specified by:
findDifferentiatingJobTimestamps
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
hasDifferentiatingIndexEntry
public boolean hasDifferentiatingIndexEntry(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException - Specified by:
hasDifferentiatingIndexEntry
in interfaceStore
- Throws:
MaterialstoreException
-
markOlderThan
public Set<JobTimestamp> markOlderThan(JobName jobName, JobTimestamp olderThan) throws MaterialstoreException, JobNameNotFoundException - Specified by:
markOlderThan
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
markNewerThanOrEqualTo
public Set<JobTimestamp> markNewerThanOrEqualTo(JobName jobName, JobTimestamp newerThanOrEqualTo) throws MaterialstoreException, JobNameNotFoundException - Specified by:
markNewerThanOrEqualTo
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
findJobTimestampsReferredBy
public List<JobTimestamp> findJobTimestampsReferredBy(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException - Specified by:
findJobTimestampsReferredBy
in interfaceStore
- Throws:
MaterialstoreException
-
findJobTimestampPriorTo
public JobTimestamp findJobTimestampPriorTo(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
findJobTimestampPriorTo
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
findLatestJobTimestamp
public JobTimestamp findLatestJobTimestamp(JobName jobName) throws MaterialstoreException, JobNameNotFoundException - Specified by:
findLatestJobTimestamp
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
findNthJobTimestamp
public JobTimestamp findNthJobTimestamp(JobName jobName, int nth) throws MaterialstoreException, JobNameNotFoundException - Specified by:
findNthJobTimestamp
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
getCachedJobber
- Specified by:
getCachedJobber
in interfaceStore
-
getJobber
return an instance of Job. if cached, return the found. if not cached, return the new one.- Specified by:
getJobber
in interfaceStore
- Throws:
MaterialstoreException
-
getPathOf
- Specified by:
getPathOf
in interfaceStore
- Throws:
MaterialstoreException
-
getPathOf
- Specified by:
getPathOf
in interfaceStore
- Throws:
MaterialstoreException
-
getPathOf
-
getRoot
-
queryAllJobTimestamps
public List<JobTimestamp> queryAllJobTimestamps(JobName jobName, QueryOnMetadata query) throws MaterialstoreException, JobNameNotFoundException - Specified by:
queryAllJobTimestamps
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
queryAllJobTimestampsPriorTo
public List<JobTimestamp> queryAllJobTimestampsPriorTo(JobName jobName, QueryOnMetadata query, JobTimestamp jobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
queryAllJobTimestampsPriorTo
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
queryJobTimestampPriorTo
public JobTimestamp queryJobTimestampPriorTo(JobName jobName, QueryOnMetadata query, JobTimestamp jobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
queryJobTimestampPriorTo
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
reflect
public MaterialList reflect(MaterialList base) throws MaterialstoreException, JobNameNotFoundException - Specified by:
reflect
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
reflect
public MaterialList reflect(MaterialList baseMaterialList, JobTimestamp priorTo) throws MaterialstoreException, JobNameNotFoundException look up a MaterialList out of this store, of which JobName and JobTimestamp meets the criteria specified by the given parameters.- Specified by:
reflect
in interfaceStore
- Parameters:
baseMaterialList
- we will look for a MaterialList of which JobName is equal to this baseMaterialListpriorTo
- we will look for a MaterialList of which JobTimestamp is prior to the baseMaterialList, excluding the baseMaterialList itself.- Returns:
- a MaterialList in the store of which JobName and JobTimestamp meet the criteria
- Throws:
MaterialstoreException
- when any io to the store failedJobNameNotFoundException
-
resolveReportFileName
- Specified by:
resolveReportFileName
in interfaceStore
-
retrieve
- Specified by:
retrieve
in interfaceStore
- Throws:
MaterialstoreException
-
contains
public boolean contains(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException, JobNameNotFoundException - Specified by:
contains
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
contains
- Specified by:
contains
in interfaceStore
- Throws:
MaterialstoreException
-
queryLatestJobTimestamp
public JobTimestamp queryLatestJobTimestamp(JobName jobName, QueryOnMetadata query) throws MaterialstoreException, JobNameNotFoundException - Specified by:
queryLatestJobTimestamp
in interfaceStore
- Throws:
MaterialstoreException
JobNameNotFoundException
-
read
- Specified by:
read
in interfaceStore
- Throws:
MaterialstoreException
-
readAllLines
- Specified by:
readAllLines
in interfaceStore
- Throws:
MaterialstoreException
-
readAllLines
- Specified by:
readAllLines
in interfaceStore
- Throws:
MaterialstoreException
-
select
public MaterialList select(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, QueryOnMetadata query) throws MaterialstoreException - Specified by:
select
in interfaceStore
- Throws:
MaterialstoreException
-
select
public MaterialList select(JobName jobName, JobTimestamp jobTimestamp, QueryOnMetadata query) throws MaterialstoreException - Specified by:
select
in interfaceStore
- Throws:
MaterialstoreException
-
select
public MaterialList select(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType) throws MaterialstoreException - Specified by:
select
in interfaceStore
- Throws:
MaterialstoreException
-
select
public MaterialList select(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException - Specified by:
select
in interfaceStore
- Throws:
MaterialstoreException
-
selectSingle
public Material selectSingle(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, QueryOnMetadata query) throws MaterialstoreException - Specified by:
selectSingle
in interfaceStore
- Throws:
MaterialstoreException
-
selectSingle
public Material selectSingle(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType) throws MaterialstoreException - Specified by:
selectSingle
in interfaceStore
- Throws:
MaterialstoreException
-
selectSingle
public Material selectSingle(JobName jobName, JobTimestamp jobTimestamp, QueryOnMetadata query) throws MaterialstoreException - Specified by:
selectSingle
in interfaceStore
- Throws:
MaterialstoreException
-
selectSingle
public Material selectSingle(JobName jobName, JobTimestamp jobTimestamp) throws MaterialstoreException - Specified by:
selectSingle
in interfaceStore
- Throws:
MaterialstoreException
-
toByteArray
- Throws:
IOException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, BufferedImage input) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata metadata, BufferedImage input, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata metadata, byte[] input) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, byte[] input, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, File input) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, File input, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, Path input) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, Path input, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, Charset charset) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
write
public Material write(JobName jobName, JobTimestamp jobTimestamp, IFileType fileType, Metadata meta, String input, Charset charset, StoreWriteParameter writeParam) throws MaterialstoreException - Specified by:
write
in interfaceStore
- Throws:
MaterialstoreException
-
toString
-