org.xiruss.xirussrepository.server
Class XirussRepositoryDefaultImpl

java.lang.Object
  extended by org.xiruss.repository.server.RepositoryBase
      extended by org.xiruss.repository.multiuser.server.MultiUserRespositoryBase
          extended by org.xiruss.repository.multiuserschema_aware.MultiUserSchemaAwareRepositoryBase
              extended by org.xiruss.xirussrepository.server.XirussRepositoryDefaultImpl
All Implemented Interfaces:
Repository, MultiUserRepository, SchemaAwareRepository, XirussRepository, XirussRepositoryServer

public class XirussRepositoryDefaultImpl
extends MultiUserSchemaAwareRepositoryBase
implements XirussRepositoryServer

Implements the Xiruss repository. This implementation level is mostly concerned with the HTTP exposure aspects of the repository.


Field Summary
(package private) static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.xiruss.repository.server.RepositoryBase
branchesById, branchesByName, defaultStorageManager, dependenciesById, id, interfaceToClassMap, mutableSnapshots, nullBranch, nullMutableSnapshot, nullRepositoryObject, nullResource, nullSnapshot, objectsById, properties, resourcesByAlias, resourcesById, snapshotIdCtr, snapshotsById, usersByAlias, usersById, verIdCtr, versionsByAlias, versionsById
 
Fields inherited from interface org.xiruss.repository.multiuser.api.MultiUserRepository
nullSession, nullUser
 
Fields inherited from interface org.xiruss.repository.api.Repository
builtinContainerNames, nullBranch, nullDependencyLink, nullDependencyMap, nullMutableSnapshot, nullRepository, nullRepositoryObject, nullResolutionPolicy, nullResource, nullResourceMap, nullSnapshot, nullSnapshotMap, nullStorageManager, nullVersion, nullVersionByResourceMap, nullVersionMap
 
Constructor Summary
XirussRepositoryDefaultImpl()
           
 
Method Summary
 void accept(RepositoryVisitor visitor)
           
 int getHttpApiPort()
          Gets the port by which the repository is exposed via the HTTP API.
 java.lang.String getHttpHost()
           
 int getHttpViewerPort()
          Gets the port by which the repository is exposed for direct HTTP access to repository content.
 java.lang.String getURLforSnapshot(Snapshot snapshot)
          Given a snapshot, returns a URL that addresses that snapshot for viewing and resource and version content access.
 java.lang.String getUrlStringForBranch(Branch branch)
           
 java.lang.String getUrlStringForDependency(DependencyLink dep)
           
 java.lang.String getUrlStringForObject(RepositoryObject obj)
          Given a repository object, returns the cannonical URL for addressing it.
 java.lang.String getUrlStringForRepository()
          Gets the HTTP viewer URL to the repository.
 java.lang.String getURLStringforResourceOnSnapshot(Resource targetRes, ResolutionPolicy policy)
          Constructs a URL for a resource that includes a resolution policy.
 void setHttpApiPort(int httpApiPort)
          Sets the port number by which the repository is served via the HTTP REST API.
 void setHttpViewPort(int httpViewerPort)
          Sets the port number by which the repository is served for direct HTTP access to repository objects (members and version content).
 VersionMap whereUsedInCompoundDocOnSnapShot(Resource resource, Snapshot snapshot)
           
 
Methods inherited from class org.xiruss.repository.multiuserschema_aware.MultiUserSchemaAwareRepositoryBase
getSchemaResource, hasSchema, registerSchema
 
Methods inherited from class org.xiruss.repository.multiuser.server.MultiUserRespositoryBase
endSession, getNullUser, getSession, getSessionById, getSessionCount, getSessionIterator, getUser, getUserCount, getUserIterator
 
Methods inherited from class org.xiruss.repository.server.RepositoryBase
addStorageManager, createBranch, createDependency, createDependency, createDependency, createMutableSnapshot, createMutableSnapshot, createResolutionPolicy, createResource, createSnapshot, createUser, createVersion, getBranch, getBranchById, getBranchByName, getBranchCount, getBranches, getBranchIds, getBranchNames, getDefaultStorageManager, getDependencies, getDependencyById, getDependencyCount, getId, getImplementationClassForClass, getMutableSnapshotById, getMutableSnapshotCount, getMutableSnapshots, getName, getNullResource, getNullSnapshot, getObjectById, getPolicyById, getPolicyCount, getProperties, getRepositoryObjectType, getResolutionPolicies, getResourceById, getResourceByKey, getResourceCount, getResourceIds, getResources, getSnapshotById, getSnapshotCount, getSnapShots, getStorageManager, getURLforResource, getUrlStringForResource, getUrlStringForSnapshot, getUrlStringForVersion, getVersionById, getVersionCount, getVersions, hasBranchNamed, hasResourceNamed, importCompoundDoc, listVersionIds, registerBranchName, registerResource, registerSnapshot, registerVersion, reportRepositoryContents, setDefaultStorageManager, setId, setName, setProperty, unRegisterBranchName, whereUsedByTypeOnSnapshot, whereUsedByTypeOnSnapshot, whereUsedOnSnapshot, whereUsedOnSnapshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xiruss.xirussrepository.api.XirussRepositoryServer
setName
 
Methods inherited from interface org.xiruss.xirussrepository.api.XirussRepository
createUser, getUrlStringForResource, getUrlStringForSnapshot
 
Methods inherited from interface org.xiruss.repository.multiuser.api.MultiUserRepository
endSession, getSession, getSessionById, getSessionCount, getSessionIterator, getUser, getUserCount, getUserIterator
 
Methods inherited from interface org.xiruss.repository.api.Repository
addStorageManager, createBranch, createDependency, createDependency, createDependency, createMutableSnapshot, createMutableSnapshot, createResolutionPolicy, createResource, createSnapshot, createVersion, getBranch, getBranchById, getBranchByName, getBranchCount, getBranches, getBranchIds, getBranchNames, getDefaultStorageManager, getDependencies, getDependencyById, getDependencyCount, getId, getMutableSnapshotById, getMutableSnapshotCount, getMutableSnapshots, getName, getNullResource, getNullSnapshot, getObjectById, getPolicyById, getPolicyCount, getRepositoryObjectType, getResolutionPolicies, getResourceById, getResourceByKey, getResourceCount, getResourceIds, getResources, getSnapshotById, getSnapshotCount, getSnapShots, getStorageManager, getVersionById, getVersionCount, getVersions, hasBranchNamed, hasResourceNamed, importCompoundDoc, listVersionIds, registerBranchName, registerSnapshot, registerVersion, setDefaultStorageManager, setId, unRegisterBranchName, whereUsedByTypeOnSnapshot, whereUsedByTypeOnSnapshot, whereUsedOnSnapshot, whereUsedOnSnapshot
 
Methods inherited from interface org.xiruss.repository.schema_aware.api.SchemaAwareRepository
getSchemaResource, hasSchema, registerSchema
 

Field Detail

logger

static org.apache.log4j.Logger logger
Constructor Detail

XirussRepositoryDefaultImpl

public XirussRepositoryDefaultImpl()
                            throws RepositoryException
Throws:
RepositoryException
Method Detail

whereUsedInCompoundDocOnSnapShot

public VersionMap whereUsedInCompoundDocOnSnapShot(Resource resource,
                                                   Snapshot snapshot)
Specified by:
whereUsedInCompoundDocOnSnapShot in interface XirussRepository

getURLforSnapshot

public java.lang.String getURLforSnapshot(Snapshot snapshot)
Given a snapshot, returns a URL that addresses that snapshot for viewing and resource and version content access.

Specified by:
getURLforSnapshot in interface XirussRepository
Parameters:
snapshot - The snapshot to get the URL for.
Returns:

getUrlStringForRepository

public java.lang.String getUrlStringForRepository()
Gets the HTTP viewer URL to the repository. This is the URL that is used for direct access to version data, as opposed to the HTTP API URL, which is used for access to version properties (and for manipulation of the repository state in general).

Specified by:
getUrlStringForRepository in interface XirussRepository
Returns:
URL to the repository

getHttpHost

public java.lang.String getHttpHost()
Specified by:
getHttpHost in interface XirussRepository
Returns:

getUrlStringForBranch

public java.lang.String getUrlStringForBranch(Branch branch)
Specified by:
getUrlStringForBranch in interface XirussRepository
Overrides:
getUrlStringForBranch in class RepositoryBase
Parameters:
branch -
Returns:

getURLStringforResourceOnSnapshot

public java.lang.String getURLStringforResourceOnSnapshot(Resource targetRes,
                                                          ResolutionPolicy policy)
Constructs a URL for a resource that includes a resolution policy.

Specified by:
getURLStringforResourceOnSnapshot in interface XirussRepository
Parameters:
targetRes -
policy - The policy to use when resolving this resource to a version in the context of a snapshot.
Returns:

getUrlStringForObject

public java.lang.String getUrlStringForObject(RepositoryObject obj)
Given a repository object, returns the cannonical URL for addressing it.

Specified by:
getUrlStringForObject in interface XirussRepository
Parameters:
obj -
Returns:

getUrlStringForDependency

public java.lang.String getUrlStringForDependency(DependencyLink dep)
Specified by:
getUrlStringForDependency in interface XirussRepository
Parameters:
dep -
Returns:

accept

public void accept(RepositoryVisitor visitor)
            throws java.lang.Throwable
Specified by:
accept in interface Repository
Specified by:
accept in interface XirussRepository
Overrides:
accept in class MultiUserRespositoryBase
Throws:
java.lang.Throwable

getHttpApiPort

public int getHttpApiPort()
Description copied from interface: XirussRepository
Gets the port by which the repository is exposed via the HTTP API.

Specified by:
getHttpApiPort in interface XirussRepository
Returns:
Port number

getHttpViewerPort

public int getHttpViewerPort()
Description copied from interface: XirussRepository
Gets the port by which the repository is exposed for direct HTTP access to repository content.

Specified by:
getHttpViewerPort in interface XirussRepository
Returns:
Port number

setHttpApiPort

public void setHttpApiPort(int httpApiPort)
Description copied from interface: XirussRepositoryServer
Sets the port number by which the repository is served via the HTTP REST API.

Specified by:
setHttpApiPort in interface XirussRepositoryServer
Parameters:
httpApiPort - Port number for the HTTP API.

setHttpViewPort

public void setHttpViewPort(int httpViewerPort)
Description copied from interface: XirussRepositoryServer
Sets the port number by which the repository is served for direct HTTP access to repository objects (members and version content).

Specified by:
setHttpViewPort in interface XirussRepositoryServer
Parameters:
httpViewerPort - Port number for the HTTP server