|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PartitionRepository<T extends Entity>
Interface for specification-based partitioned repositories.
Partitioned repositories will not consist of a single repository instance, but rather a directed acyclic graph (DAG) of repository instances. Each repository partition is defined by aSpecification
,
and these partitions are organized following the semantics of specification subsumptions.
One might regard partitions as repository indices,
and the routine of adding them as indexing the overall repository.
There are some known weaknesses for partitioned repositories.
When entity state changes, before the entity is updated/repartitioned, its whereabouts in the overall repository structure is unstable.
For instance:
generalizationOf
,
Specifications subsumption specialCaseOf
Method Summary | ||
---|---|---|
|
addPartitionFor(Specification<V> partitionSpecification)
Adds a new partition to this repository. |
|
|
addPartitionFor(Specification<V> partitionSpecification,
Repository<? super V> partitionRepository)
Adds a new partition to this repository. |
|
|
addPartitionFor(Specification<V> partitionSpecification,
java.lang.String repositoryId)
Adds a new partition to this repository. |
|
void |
collectAllPartitions(java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
Populates the given map with a flattened and recursive view of all partitions in this repository. |
|
|
collectAllPartitionsWithRepositorySatisfying(Specification<R> specification,
java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
Populates the given map with a flattened and recursive view of all partitions in this repository, satisfying the given specification. |
|
|
findPartitionFor(Specification<V> specification)
|
|
java.util.Map<Specification<? extends T>,PartitionRepository> |
getAllPartitions()
Optional: mainly added for testing purposes, may throw UnsupportedOperationException |
|
|
getPartitionOnlyEntities()
This method applies to this partition only! |
|
java.util.Map<Specification<? extends T>,PartitionRepository> |
getPartitions()
Optional: mainly added for testing purposes, may throw UnsupportedOperationException
This method applies to this partition only! |
|
Specification<T> |
getPartitionSpecification()
This method applies to this partition only! |
|
PartitionRepository<? super T> |
getRootRepository()
|
|
PartitionRepository<? super T> |
getSuperPartitionRepository()
This method applies to this partition only! |
|
Repository<T> |
getTargetRepository()
This method applies to this partition only! |
|
java.lang.Class<T> |
getType()
|
|
java.lang.Boolean |
isLeafPartition()
This method applies to this partition only! |
|
java.lang.Boolean |
isRootPartition()
This method applies to this partition only! |
|
void |
repartition()
Repartitions the entire repository. |
|
|
repartition(V entity)
When an entity is altered, this method must be explicitely invoked to reassure proper placement in the repository partition hierarchy. |
|
void |
setPartitionSpecification(Specification<T> specification)
This method applies to this partition only! |
|
void |
setSuperPartitionRepository(PartitionRepository<? super T> specification)
This method applies to this partition only! |
|
void |
setSuperPartitionSpecification(Specification<? super T> specification)
This method applies to this partition only! |
Methods inherited from interface net.sourceforge.domian.repository.Repository |
---|
count, countAll, countAllEntitiesSpecifiedBy, find, findAll, findAllEntitiesSpecifiedBy, findSingle, findSingleEntitySpecifiedBy, isIndexingEntitiesRecursively, isPartitioningNatively, iterate, iterateAll, iterateAllEntitiesSpecifiedBy, makePartition, put, putAll, remove, remove, removeAll, removeAllEntitiesSpecifiedBy, update, update |
Method Detail |
---|
java.lang.Class<T> getType()
java.lang.Boolean isRootPartition()
true
if this repository partition is the root partition (does not have a super partitions)PartitionRepository<? super T> getRootRepository()
java.lang.Boolean isLeafPartition()
true
if this repository partition is a leaf partition (does not have any sub partitions)<V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification)
Specification
.
The new partition repository will be of the same type as this repository.
partitionSpecification
- the specification specifying the partition
<V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification, java.lang.String repositoryId)
Specification
.
The new partition repository will be of the same type as this repository.
partitionSpecification
- the specification specifying the partitionrepositoryId
- the repository id; a non-blank value is mandatory for all persistent repositories
<V extends T> PartitionRepository<V> addPartitionFor(Specification<V> partitionSpecification, Repository<? super V> partitionRepository)
Specification
.
partitionSpecification
- the specification specifying the partitionpartitionRepository
- the partition repository
<V extends T> java.lang.Boolean repartition(V entity)
entity
- the entity to be repartitioned
true
if entity was repartitionedvoid repartition()
<V extends T> PartitionRepository findPartitionFor(Specification<V> specification)
specification
- sub-partition specification
void setSuperPartitionSpecification(Specification<? super T> specification)
PartitionRepository<? super T> getSuperPartitionRepository()
void setSuperPartitionRepository(PartitionRepository<? super T> specification)
Specification<T> getPartitionSpecification()
void setPartitionSpecification(Specification<T> specification)
Repository<T> getTargetRepository()
Repository
instance.
Not only the Repository
instance in action must be modified, but all super partitions leading up to the root repository as well.
Is it possible anyway...?
null
<V extends T> java.util.Set<V> getPartitionOnlyEntities()
java.util.Map<Specification<? extends T>,PartitionRepository> getPartitions()
UnsupportedOperationException
This method applies to this partition only!
PartitionRepository
only
java.lang.UnsupportedOperationException
- if not supportedjava.util.Map<Specification<? extends T>,PartitionRepository> getAllPartitions()
UnsupportedOperationException
PartitionRepository
and below
java.lang.UnsupportedOperationException
- if not supportedvoid collectAllPartitions(java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
UnsupportedOperationException
partitionMap
- the index->partition map
java.lang.IllegalArgumentException
- if the partition map is null
java.lang.UnsupportedOperationException
- if not supported<R extends Repository> void collectAllPartitionsWithRepositorySatisfying(Specification<R> specification, java.util.Map<Specification<? extends T>,PartitionRepository> partitionMap)
UnsupportedOperationException
specification
- the specification to satisfy to be included in result mappartitionMap
- the index->partition map
java.lang.IllegalArgumentException
- if the partition map is null
java.lang.UnsupportedOperationException
- if not supported
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |