org.xiruss.repository.api
Interface Repository

All Known Subinterfaces:
MultiUserRepository, XirussRepository, XirussRepositoryServer
All Known Implementing Classes:
MultiUserRespositoryBase, MultiUserSchemaAwareRepositoryBase, NullRepository, RepositoryBase, SchemaAwareRepositoryBase, XirussRepositoryDefaultImpl, XirussRepositoryProxy

public interface Repository


Field Summary
static java.util.Vector builtinContainerNames
           
static Branch nullBranch
           
static DependencyLink nullDependencyLink
           
static DependencyMap nullDependencyMap
           
static MutableSnapshot nullMutableSnapshot
           
static Repository nullRepository
           
static RepositoryObject nullRepositoryObject
           
static ResolutionPolicy nullResolutionPolicy
           
static Resource nullResource
           
static ResourceMap nullResourceMap
           
static Snapshot nullSnapshot
           
static SnapshotMap nullSnapshotMap
           
static StorageManager nullStorageManager
           
static Version nullVersion
           
static VersionByResourceMap nullVersionByResourceMap
           
static VersionMap nullVersionMap
           
 
Method Summary
 void accept(RepositoryVisitor visitor)
           
 java.lang.String addStorageManager(StorageManager manager)
          Sets the active storage manager to the specified manager.
 Branch createBranch(java.lang.String branchName)
          Create a new branch and assign the specified branch name to it.
 DependencyLink createDependency(java.lang.String dependencyType, Version sourceVersion, Resource targetResource, ResolutionPolicy policy)
          Create a new dependency between the specified Version and a target Resource, using the specified resolution policy.
 DependencyLink createDependency(java.lang.String dependencyType, Version sourceVersion, Resource targetResource, ResolutionPolicy policy, java.lang.Object sourceObject)
          Factory method for creating new dependency instances based on the dependency type value.
 DependencyLink createDependency(java.lang.String dependencyClassName, Version sourceVersion, Resource targetResource, java.lang.String resolutionPolicyClassName)
          Creates a new dependency link instance of the specified class and using the specified resolution policy class.
 MutableSnapshot createMutableSnapshot(Branch br)
          Creates a new mutable snapshot.
 MutableSnapshot createMutableSnapshot(Branch br, java.lang.String name)
          Creates a new mutable snapshot and names it.
 ResolutionPolicy createResolutionPolicy(java.lang.String policyType)
           
 Resource createResource(java.lang.String resourceName)
          Creates a new resource instance with the specified name.
 Snapshot createSnapshot(Branch branch, MutableSnapshot snapshot, java.util.Date commitTime)
          Create a new immutable snapshot from an existing mutable snapshot.
 Version createVersion(java.lang.String name, Resource res, java.lang.Class versionSubClass)
          Creates a new version instance of the specified class.
 Branch getBranch(java.lang.String branchId)
          Returns the specified branch.
 Branch getBranchById(java.lang.String branchId)
          Get a Branch by its repository ID.
 Branch getBranchByName(java.lang.String branchName)
           
 long getBranchCount()
          Returns the total number of branches in the repository.
 java.util.Map getBranches()
           
 java.util.Set getBranchIds()
           
 java.util.Set getBranchNames()
           
 StorageManager getDefaultStorageManager()
           
 java.util.Map getDependencies()
           
 DependencyLink getDependencyById(java.lang.String objId)
           
 long getDependencyCount()
          Returns the total number of dependency objects in the repository.
 java.lang.Integer getId()
           
 MutableSnapshot getMutableSnapshotById(java.lang.String objId)
          Gets a mutable snapshot by ID
 long getMutableSnapshotCount()
           
 SnapshotMap getMutableSnapshots()
           
 java.lang.String getName()
          Get the display name of the repository.
 Resource getNullResource()
           
 Snapshot getNullSnapshot()
           
 RepositoryObject getObjectById(java.lang.String objId)
          Returns an object of any type given an object ID.
 ResolutionPolicy getPolicyById(java.lang.String token)
          Gets the specified resolution policy.
 long getPolicyCount()
          Returns the number of resolution policy objects in the repository.
 int getRepositoryObjectType(java.lang.String objId)
          Returns the repository object ID constant for the object identified by the specified object ID.
 java.util.Map getResolutionPolicies()
          Returns a map of all the resolution policies by object ID.
 Resource getResourceById(java.lang.String resId)
          Gets a resource by its repository ID.
 Resource getResourceByKey(java.lang.String resourceName)
           
 long getResourceCount()
           
 java.util.Set getResourceIds()
          List of all resource IDs.
 ResourceMap getResources()
           
 Snapshot getSnapshotById(java.lang.String objId)
           
 long getSnapshotCount()
           
 SnapshotMap getSnapShots()
           
 StorageManager getStorageManager(java.lang.String managerId)
          Returns the storage manager with the specified ID, if it exists.
 Version getVersionById(java.lang.String verId)
           
 long getVersionCount()
           
 VersionMap getVersions()
           
 boolean hasBranchNamed(java.lang.String branchName)
           
 boolean hasResourceNamed(java.lang.String resourceName)
           
 void importCompoundDoc(java.io.File compoundDocumentRootFile, Branch branch, User user, java.lang.String docName)
          Import a compound document into the repository.
 java.lang.String listVersionIds()
           
 void registerBranchName(Branch branch, java.lang.String name)
          Register a new alias for the specified branch.
 void registerSnapshot(Snapshot snapshot)
           
 void registerVersion(Version ver)
           
 void setDefaultStorageManager(java.lang.String managerId)
          Sets the storage manager that will store new storage objects by default.
 void setId(java.lang.Integer id)
           
 void unRegisterBranchName(Branch branch, java.lang.String alias)
          Delete an alias entry for the specified branch.
 VersionMap whereUsedByTypeOnSnapshot(Resource resource, Snapshot snapshot, java.lang.Class versionClass)
          Returns a version map of versions of the specified type visible on the specified snapshot that have a dependency relationship to the specified resource.
 VersionMap whereUsedByTypeOnSnapshot(Resource resource, Snapshot snapshot, java.lang.Class versionClass, java.lang.String dependencyTypeName)
          Returns a version map of versions of the specified type visible on the specified snapshot that have a dependency relationship of the specified type to the specified resource.
 VersionMap whereUsedOnSnapshot(Resource resource, Snapshot snapshot)
          Returns a version map of versions visible on the specified snapshot that have a dependency relationship to the specified resource.
 VersionMap whereUsedOnSnapshot(Resource resource, Snapshot snapshot, java.lang.String dependencyTypeName)
          Returns a version map of versions visible on the specified snapshot that have a dependency of the specified type to the specified resource.
 

Field Detail

nullVersion

static final Version nullVersion

nullStorageManager

static final StorageManager nullStorageManager

nullResource

static final Resource nullResource

nullBranch

static final Branch nullBranch

nullRepositoryObject

static final RepositoryObject nullRepositoryObject

nullSnapshot

static final Snapshot nullSnapshot

nullMutableSnapshot

static final MutableSnapshot nullMutableSnapshot

nullRepository

static final Repository nullRepository

nullResourceMap

static final ResourceMap nullResourceMap

nullVersionMap

static final VersionMap nullVersionMap

nullVersionByResourceMap

static final VersionByResourceMap nullVersionByResourceMap

nullSnapshotMap

static final SnapshotMap nullSnapshotMap

nullDependencyMap

static final DependencyMap nullDependencyMap

nullDependencyLink

static final DependencyLink nullDependencyLink

nullResolutionPolicy

static final ResolutionPolicy nullResolutionPolicy

builtinContainerNames

static final java.util.Vector builtinContainerNames
Method Detail

setId

void setId(java.lang.Integer id)

getId

java.lang.Integer getId()

createResource

Resource createResource(java.lang.String resourceName)
                        throws NameNotUniqueException
Creates a new resource instance with the specified name.

Parameters:
resourceName - The display name to use for the resource.
Returns:
The created resource
Throws:
NameNotUniqueException

createBranch

Branch createBranch(java.lang.String branchName)
                    throws RepositoryException
Create a new branch and assign the specified branch name to it.

Parameters:
branchName - The name to use for the branch. This will act as an alias for the internal branch ID.
Returns:
The created branch
Throws:
RepositoryException

importCompoundDoc

void importCompoundDoc(java.io.File compoundDocumentRootFile,
                       Branch branch,
                       User user,
                       java.lang.String docName)
                       throws ImporterException,
                              VersionCommitException,
                              NoSuchPolicyTypeException,
                              NoSuchDependencyTypeException,
                              RepositoryException,
                              VersionMutationException
Import a compound document into the repository.

Parameters:
cd1File - The file to import. Currently expected to be an XML document.
Throws:
ImporterException
VersionCommitException
NoSuchPolicyTypeException
NoSuchDependencyTypeException
RepositoryException
VersionMutationException

getStorageManager

StorageManager getStorageManager(java.lang.String managerId)
Returns the storage manager with the specified ID, if it exists. Otherwise returns a null storage manager.

Parameters:
managerId -

getBranch

Branch getBranch(java.lang.String branchId)
                 throws RepositoryException
Returns the specified branch.

Parameters:
string -
Throws:
RepositoryException

getBranchIds

java.util.Set getBranchIds()

getBranchNames

java.util.Set getBranchNames()

getBranchByName

Branch getBranchByName(java.lang.String branchName)

hasBranchNamed

boolean hasBranchNamed(java.lang.String branchName)

hasResourceNamed

boolean hasResourceNamed(java.lang.String resourceName)
Parameters:
string -
Returns:

getResourceByKey

Resource getResourceByKey(java.lang.String resourceName)
Parameters:
string -
Returns:

getResourceById

Resource getResourceById(java.lang.String resId)
Gets a resource by its repository ID.

Parameters:
resId1 -
Returns:
Resource or null

getBranches

java.util.Map getBranches()
Returns:
Map of branch objects by branch ID

getBranchById

Branch getBranchById(java.lang.String branchId)
Get a Branch by its repository ID.

Parameters:
string -
Returns:
Branch with ID or NullBranch object

createDependency

DependencyLink createDependency(java.lang.String dependencyType,
                                Version sourceVersion,
                                Resource targetResource,
                                ResolutionPolicy policy)
                                throws RepositoryException,
                                       NoSuchDependencyTypeException
Create a new dependency between the specified Version and a target Resource, using the specified resolution policy. The dependency is added to the source version's dependencies.

Parameters:
dependencyType -
sourceVersion -
targetResource -
policy -
Returns:
Throws:
RepositoryException
NoSuchDependencyTypeException

createDependency

DependencyLink createDependency(java.lang.String dependencyClassName,
                                Version sourceVersion,
                                Resource targetResource,
                                java.lang.String resolutionPolicyClassName)
                                throws NoSuchDependencyTypeException,
                                       RepositoryException,
                                       NoSuchPolicyTypeException
Creates a new dependency link instance of the specified class and using the specified resolution policy class.

Parameters:
dependencyClassName - Name of the dependency type to instantiate
sourceVersion - The specific version that has the dependency
targetResource - The resource on which the source version is dependent
resolutionPolicyClassName - The name of the resolution policy type to use for this dependency.
Returns:
New dependency link instance.
Throws:
RepositoryException
NoSuchDependencyTypeException
NoSuchPolicyTypeException

createDependency

DependencyLink createDependency(java.lang.String dependencyType,
                                Version sourceVersion,
                                Resource targetResource,
                                ResolutionPolicy policy,
                                java.lang.Object sourceObject)
                                throws NoSuchDependencyTypeException,
                                       RepositoryException
Factory method for creating new dependency instances based on the dependency type value. The source object is used to maintain knowledge of what version object data the dependency reflects (i.e., a link element of some sort).

Parameters:
string -
string2 -
Returns:
Throws:
NoSuchDependencyTypeException
RepositoryException

createResolutionPolicy

ResolutionPolicy createResolutionPolicy(java.lang.String policyType)
                                        throws RepositoryException,
                                               NoSuchPolicyTypeException
Parameters:
string -
Returns:
Throws:
RepositoryException
NoSuchPolicyTypeException

createMutableSnapshot

MutableSnapshot createMutableSnapshot(Branch br)
Creates a new mutable snapshot.

Returns:

createMutableSnapshot

MutableSnapshot createMutableSnapshot(Branch br,
                                      java.lang.String name)
Creates a new mutable snapshot and names it.

Returns:

createVersion

Version createVersion(java.lang.String name,
                      Resource res,
                      java.lang.Class versionSubClass)
                      throws java.lang.InstantiationException,
                             java.lang.IllegalAccessException
Creates a new version instance of the specified class.

Parameters:
name - Name (alias) for the version.
res - The resource this is a version of
subClass - The subsclass of version to instantiate
Returns:
Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException

getVersionById

Version getVersionById(java.lang.String verId)
Parameters:
verId -
Returns:

listVersionIds

java.lang.String listVersionIds()

whereUsedOnSnapshot

VersionMap whereUsedOnSnapshot(Resource resource,
                               Snapshot snapshot)
Returns a version map of versions visible on the specified snapshot that have a dependency relationship to the specified resource. Used to determine where a particular version (through its resource) is used.

Parameters:
resource - The resource whose usage is being queried
snapshot - The snapshot the result versionSet must be visible on.
Returns:
A version map of versionSet that use the resource.

whereUsedOnSnapshot

VersionMap whereUsedOnSnapshot(Resource resource,
                               Snapshot snapshot,
                               java.lang.String dependencyTypeName)
Returns a version map of versions visible on the specified snapshot that have a dependency of the specified type to the specified resource.

Parameters:
resource - The resource whose usage is being queried
snapshot - The snapshot the result versionSet must be visible on.
dependencyTypeName -
Returns:

whereUsedByTypeOnSnapshot

VersionMap whereUsedByTypeOnSnapshot(Resource resource,
                                     Snapshot snapshot,
                                     java.lang.Class versionClass)
Returns a version map of versions of the specified type visible on the specified snapshot that have a dependency relationship to the specified resource. Used to determine where a particular version (through its resource) is used.

Parameters:
resource - The resource whose usage is being queried
snapshot - The snapshot the result versionSet must be visible on.
Returns:
A version map of versionSet that use the resource.

whereUsedByTypeOnSnapshot

VersionMap whereUsedByTypeOnSnapshot(Resource resource,
                                     Snapshot snapshot,
                                     java.lang.Class versionClass,
                                     java.lang.String dependencyTypeName)
Returns a version map of versions of the specified type visible on the specified snapshot that have a dependency relationship of the specified type to the specified resource. Used to determine where a particular version (through its resource) is used.

Parameters:
resource - The resource whose usage is being queried
snapshot - The snapshot the result versionSet must be visible on.
Returns:
A version map of versionSet that use the resource.

getResourceIds

java.util.Set getResourceIds()
List of all resource IDs.

Returns:

getSnapshotById

Snapshot getSnapshotById(java.lang.String objId)
Parameters:
string -
Returns:

getObjectById

RepositoryObject getObjectById(java.lang.String objId)
Returns an object of any type given an object ID.

Parameters:
objId - The repository ID of the object to retrieve.
Returns:
The repository object with the specified ID, or null.

getRepositoryObjectType

int getRepositoryObjectType(java.lang.String objId)
                            throws SnapCMException
Returns the repository object ID constant for the object identified by the specified object ID.

Parameters:
objId -
Throws:
SnapCMException

registerSnapshot

void registerSnapshot(Snapshot snapshot)

getMutableSnapshotById

MutableSnapshot getMutableSnapshotById(java.lang.String objId)
Gets a mutable snapshot by ID

Parameters:
objId - ID of mutable snapshot.
Returns:
Snapshot.

getNullSnapshot

Snapshot getNullSnapshot()

unRegisterBranchName

void unRegisterBranchName(Branch branch,
                          java.lang.String alias)
Delete an alias entry for the specified branch. Does not report the case where the specified alias is not registered.

Parameters:
branch - The branch whose alias is to be unregistered.
alias - The alias value to unregister.

registerBranchName

void registerBranchName(Branch branch,
                        java.lang.String name)
                        throws RepositoryException
Register a new alias for the specified branch.

Parameters:
branch - The branch to which the alias will be associated.
alias - The alias to be registered.
Throws:
RepositoryException

registerVersion

void registerVersion(Version ver)

getResources

ResourceMap getResources()

getVersions

VersionMap getVersions()

getMutableSnapshots

SnapshotMap getMutableSnapshots()

getMutableSnapshotCount

long getMutableSnapshotCount()

getDependencies

java.util.Map getDependencies()

getDependencyById

DependencyLink getDependencyById(java.lang.String objId)

getNullResource

Resource getNullResource()

accept

void accept(RepositoryVisitor visitor)
            throws java.lang.Throwable
Throws:
java.lang.Throwable

createSnapshot

Snapshot createSnapshot(Branch branch,
                        MutableSnapshot snapshot,
                        java.util.Date commitTime)
Create a new immutable snapshot from an existing mutable snapshot.

Parameters:
branch -
snapshot - Mutable snapshot with which to initialize the new snapshot.
commitTime -
Returns:

getName

java.lang.String getName()
Get the display name of the repository.


getResourceCount

long getResourceCount()

getSnapshotCount

long getSnapshotCount()

getSnapShots

SnapshotMap getSnapShots()

getDependencyCount

long getDependencyCount()
Returns the total number of dependency objects in the repository.

Returns:

getBranchCount

long getBranchCount()
Returns the total number of branches in the repository.

Returns:

addStorageManager

java.lang.String addStorageManager(StorageManager manager)
Sets the active storage manager to the specified manager.

Parameters:
manager -
Returns:
Object ID of added storage manager

setDefaultStorageManager

void setDefaultStorageManager(java.lang.String managerId)
Sets the storage manager that will store new storage objects by default.

Parameters:
manager -

getDefaultStorageManager

StorageManager getDefaultStorageManager()

getVersionCount

long getVersionCount()

getResolutionPolicies

java.util.Map getResolutionPolicies()
Returns a map of all the resolution policies by object ID.


getPolicyCount

long getPolicyCount()
Returns the number of resolution policy objects in the repository.


getPolicyById

ResolutionPolicy getPolicyById(java.lang.String token)
Gets the specified resolution policy.

Parameters:
objId - Policy object ID.
Returns:
Specified policy or NullResolutionPolicy