org.modelbus.core.lib
Interface IRepositoryHelper

All Superinterfaces:
IModelBusHelper

public interface IRepositoryHelper
extends IModelBusHelper

The interface IRepositoryHelper provides an API to work with the ModelBusRepository. To instantiate the helper class, you call ModelBusCoreLib.getRepositoryHelper():

 {
        @code
        IRepositoryHelper helper = ModelBusCoreLib.getRepositoryHelper();
 }
 
If you use the IRepositoyHelper not in a dosgi-environment, you have to set the mode to CXF:
 helper.setMode(IModelBusHelper.MODE_CXF);
 
 
To work with the repository, you have to declare a session:
 {
        @code
        Session session = new Session();
        session.setId("abcdefghijklmno123456789");
        Property propertyUserName = new Property();
        propertyUserName.setKey("username");
        propertyUserName.setValue("Admin");
        Property propertyPassword = new Property();
        propertyPassword.setKey("password");
        propertyPassword.setValue("ModelBus");
        session.getProperties().add(propertyUserName);
        session.getProperties().add(propertyPassword);
 }
 
Afterwards, you can work with the repository:
 String path = "http://test/testfile.uml"
 InputStream input = helper.checkOutFile(session,path,-1);
 
 


Nested Class Summary
static class IRepositoryHelper.PingType
           
 
Field Summary
static java.lang.String REVISION_HEAD
           
 
Fields inherited from interface org.modelbus.core.lib.IModelBusHelper
MODE_CXF, MODE_DOSGI
 
Method Summary
 java.lang.String authenticate(java.lang.String username, java.lang.String password)
          Authenticates an user to the ModelBus server.
 void checkInFile(Session session, IModelBusDataSource dataSource, java.lang.String logMessage)
          Commits a file that is encapsulated in a ModelBusDataSource.
 void checkInFile(Session session, IModelBusDataSource dataSource, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Commits a file that is encapsulated in a ModelBusDataSource.
 void checkInFile(Session session, URI fileUri, java.io.File file, java.lang.String logMessage)
          Commits a file and saves the changed file in the repository.
 void checkInFile(Session session, URI fileUri, java.io.File file, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Commits a file and saves the changed file in the repository.
 void checkInModel(Session session, java.util.List<Resource> resources, java.util.Map<?,?> saveOptions, java.lang.String logMessage)
          Commits a list of resources and saves the changed resources in the repository.
 void checkInModel(Session session, java.util.List<Resource> resources, java.util.Map<?,?> saveOptions, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Commits a list of resources and saves the changed resources in the repository.
 void checkInModel(Session session, Resource resource, java.util.Map<?,?> saveOptions, java.lang.String logMessage)
          Commits a resource and saves the changed resource in the repository.
 void checkInModel(Session session, Resource resource, java.util.Map<?,?> saveOptions, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Commits a resource and saves the changed resource in the repository.
 void checkInModel(Session session, Resource resource, URI localResourceUri, java.util.Map<?,?> saveOptions, java.lang.String logMessage)
          Commits a resource and saves the changed resource in the repository.
 void checkInModel(Session session, Resource resource, URI localResourceUri, java.util.Map<?,?> saveOptions, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Commits a resource and saves the changed resource in the repository.
 java.io.InputStream checkOutFile(Session session, URI fileUri, java.lang.String revision)
          Checks out a file located in the repository at the specified path in a particular revision and returns the InputStream.
 void checkOutFile(Session session, URI fileUri, java.lang.String revision, java.io.File file)
          Checks out a file located in the repository at the specified path in a particular revision.
 IModelBusDataSource checkOutFileAsDataSource(Session session, URI fileUri, java.lang.String revision)
          Checks out a file located in the repository at the specified path in a particular revision and returns a ModelBusDataSource.
 void checkOutModel(Session session, java.util.List<Resource> resources, java.util.Map<?,?> loadOptions)
          Checks out a list of models with head revision.
 void checkOutModel(Session session, Resource resource, java.util.Map<?,?> loadOptions)
          Checks out a model with head revision.
 void checkoutModelWithDependencies(Session session, Resource model, java.lang.String revision, java.util.Map<?,?> loadOptions)
          Checks out a model and its dependent models with the specified revision.
 void checkOutModelWithRevision(Session session, java.util.List<Resource> resources, java.lang.String revision, java.util.Map<?,?> loadOptions)
          Checks out a list of models with the specified revision.
 void checkOutModelWithRevision(Session session, Resource resource, java.lang.String revision, java.util.Map<?,?> loadOptions)
          Checks out a model with the specified revision.
 java.util.List<RepositoryNodeKind> checkPath(Session session, URI uri, java.lang.String revision)
          Returns the kind ("DIR", "FILE", "MODEL", "UNKNOWN", "NONE") of a repository node located at the specified location in a particular revision.
 void commit(Session session, java.util.List<PathFileContentMapEntry> createFileMap, java.util.List<PathFileContentMapEntry> checkInFileMap, java.util.List<java.lang.String> folderPaths, java.util.List<java.lang.String> deletionPaths, java.lang.String logMessage)
           
 boolean commitChangeModel(Session session, java.lang.String messageId, URI modelUri, java.lang.String changeModelAsString)
          Commits a serialized EMF ChangeModel.
 boolean control(Session session, URI fragmentUri, java.lang.String fragmentFileLocation, java.lang.String logMessage)
          Splits a model into fragments.
 boolean copy(Session session, java.lang.String[] srcPaths, java.lang.String destPath, java.lang.String logMessage)
          Copies repository entries located at the specified srcPaths to a directory located at the specified destPath.
 java.lang.String createDir(Session session, URI uri, java.lang.String logMessage)
          Creates a directory located at the specified path.
 java.lang.String createDir(Session session, URI uri, java.lang.String logMessage, java.util.Map<java.lang.String,java.lang.Object> options)
          Creates a directory located at the specified path.
 java.lang.String delete(Session session, URI uri, java.lang.String logMessage)
          Deletes the repository entry located at the specified location.
 boolean exists(Session session, URI uri, java.lang.String revision)
          Checks whether the specified location exists in the repository or not
 DependenciesInfo getDependencies(Session session, URI uri)
          Gets all incoming and outgoing references for a model or a model element with the specified uri.
 DependenciesInfo getDependencies(Session session, URI uri, boolean includeIncomingReferences, boolean includeOutgoingReferences)
          Gets all incoming and outgoing references for a model or a model element with the specified uri.
 RepositoryDirEntry[] getDirEntries(Session session, URI uri, java.lang.String revision)
          Returns an array with repository directory entries for a directory located at the specified path in a particular revision.
 RepositoryDirEntry[] getDirEntries(Session session, URI uri, java.lang.String revision, java.lang.String[] excludeFilters)
          Returns an array with repository directory entries for a directory located at the specified path in a particular revision excluding specified entries.
 ExtendedRepositoryLogEntry getExtendedLogEntry(Session session, java.lang.String revision, java.lang.Long date)
          Returns an log entry for a given commit extended with information about its previous commit.
 java.util.List<java.lang.String> getFilesToCheckin()
           
 IncomingReferencesInfo[] getIncomingReferences(Session session, URI uri)
          Gets all incoming references for a model or a model element with the specified uri.
 java.util.List<RepositoryDirEntry> getInfo(Session session, URI uri, java.lang.String revision)
          Gives information about an entry located at the specified path in a particular revision.
 LockInfo[] getLocks(Session session, java.lang.String urlPrefix)
          Gets all lock entries on or below the specified urlPrefix.
 RepositoryLogEntry[] getLogEntries(Session session, java.lang.String[] targetPaths, java.lang.String startRevision, java.lang.String endRevision, boolean changedPath, boolean strictNode, long limit, boolean includeMergedRevisions, java.lang.String[] revProps)
          Traverses revision history and returns an array of log entries.
 java.lang.Integer getMode()
           
 OutgoingReferencesInfo[] getOutgoingReferences(Session session, URI uri)
          Gets all outgoing references for a model or a model element with the specified uri.
 java.util.HashMap<java.lang.String,java.lang.String> getProjectPathMap()
          Gets the project path map
 java.util.List<Resource> getReferencingResources(Session session, URI referencedObjectUri, URI referencingTypeUri)
          Gets a list of resources, which contain model elements of a certain type (referencingTypeUri) that references the specified element (referencedObjectUri)
 URI getResourceUri(URI objectUri)
          Returns the resource uri of an object with the specified objectUri; the uri without a fragment.
 RepositoryDirEntry getRoot(Session session)
          Returns the repository's root directory entry
 boolean lock(Session session, URI uri)
          Locks the repository entry located at the specified location.
 void move(Session session, java.lang.String[] srcPaths, java.lang.String destPath, java.lang.String logMessage)
          Moves repository entries located at the specified srcPaths to a directory located at the specified destPath.
 long ping(IRepositoryHelper.PingType type, Session session)
           
 void setEnableDependencies(boolean enableDependencies)
          Enables dependencies support.
 void setMode(java.lang.Integer mode)
           
 void setModelExtensions(java.lang.String[] modelExtensions)
          If the dependencies support is enabled, you have to specify the supported model types
 void setProjectPathMap(java.util.HashMap<java.lang.String,java.lang.String> localProjectPaths)
          Sets the project path map.
 boolean uncontrol(Session session, URI fragmentUri, java.lang.String logMessage)
          Uncontrols the EObject with the specified fragmentUri.
 boolean unlock(Session session, URI uri)
          Unlocks the repository entry located at the specified location.
 
Methods inherited from interface org.modelbus.core.lib.IModelBusHelper
forcesSecureConnection, setForceSecureConnection
 

Field Detail

REVISION_HEAD

static final java.lang.String REVISION_HEAD
See Also:
Constant Field Values
Method Detail

setProjectPathMap

void setProjectPathMap(java.util.HashMap<java.lang.String,java.lang.String> localProjectPaths)
Sets the project path map. A map entry is keyed by the local project path. Its value is the corresponding remote project path.

Parameters:
localProjectPaths -

getProjectPathMap

java.util.HashMap<java.lang.String,java.lang.String> getProjectPathMap()
Gets the project path map

Returns:
a local to remote project path map

getFilesToCheckin

java.util.List<java.lang.String> getFilesToCheckin()
Returns:

authenticate

java.lang.String authenticate(java.lang.String username,
                              java.lang.String password)
                              throws RepositoryRuntimeException,
                                     InvalidValueException
Authenticates an user to the ModelBus server.

Parameters:
username -
password -
Returns:
the ModelBus session ID
Throws:
RepositoryRuntimeException
InvalidValueException

checkInModel

void checkInModel(Session session,
                  Resource resource,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage)
                  throws RepositoryAuthentificationException,
                         NonExistingResourceException,
                         java.io.IOException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a resource and saves the changed resource in the repository. The URI of the resource to commit has to be set to the remote target location. The URI to set has to be absolute and has to start with the scheme 'http://'. If the resource does not already exist in the repository, it is created.

Parameters:
session - the current session for authentication
resource - the resource to commit
logMessage - the log message for the transaction
Throws:
java.io.IOException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException
NonExistingResourceException

checkInModel

void checkInModel(Session session,
                  Resource resource,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage,
                  java.util.Map<java.lang.String,java.lang.Object> options)
                  throws RepositoryAuthentificationException,
                         NonExistingResourceException,
                         java.io.IOException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a resource and saves the changed resource in the repository. The URI of the resource to commit has to be set to the remote target location. The URI to set has to be absolute and has to start with the scheme 'http://'. If the resource does not already exist in the repository, it is created.

Parameters:
session - the current session for authentication
resource - the resource to commit
logMessage - the log message for the transaction
options - option to use for storing the model
Throws:
java.io.IOException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException
NonExistingResourceException

checkInModel

void checkInModel(Session session,
                  Resource resource,
                  URI localResourceUri,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage)
                  throws RepositoryAuthentificationException,
                         NonExistingResourceException,
                         java.io.IOException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a resource and saves the changed resource in the repository. The URI of the resource to commit has to be set to the remote target location. The URI to set has to be absolute and has to start with the scheme 'http://'. If the resource does not already exist in the repository, it is created. The local resource URI has to be absolute and is used for matching local and remote project paths.

Parameters:
session - the current session for authentication
resource - the resource to commit
localResourceUri - the local URI of the resource to commit
logMessage - the log message for the transaction
Throws:
java.io.IOException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException
NonExistingResourceException

checkInModel

void checkInModel(Session session,
                  Resource resource,
                  URI localResourceUri,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage,
                  java.util.Map<java.lang.String,java.lang.Object> options)
                  throws RepositoryAuthentificationException,
                         NonExistingResourceException,
                         java.io.IOException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a resource and saves the changed resource in the repository. The URI of the resource to commit has to be set to the remote target location. The URI to set has to be absolute and has to start with the scheme 'http://'. If the resource does not already exist in the repository, it is created. The local resource URI has to be absolute and is used for matching local and remote project paths.

Parameters:
session - the current session for authentication
resource - the resource to commit
localResourceUri - the local URI of the resource to commit
logMessage - the log message for the transaction
options - option to use for storing the model
Throws:
java.io.IOException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException
NonExistingResourceException

checkOutModel

void checkOutModel(Session session,
                   Resource resource,
                   java.util.Map<?,?> loadOptions)
                   throws RepositoryAuthentificationException,
                          java.io.IOException,
                          UnresolvedReferencesException,
                          NonExistingResourceException
Checks out a model with head revision. The model is put into the specified resource and is loaded. This means, if the resource already exists on the local file system, the resource is updated. The URI of the resource to check-out has to be set to the remote location before it is checked-out. The URI to set has to be absolute and has to start with the scheme 'http://'.

Parameters:
session - the current session for authentication
resource - the resource to check-out
loadOptions - the options for the model check out
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
RepositoryAuthentificationException

checkOutModelWithRevision

void checkOutModelWithRevision(Session session,
                               Resource resource,
                               java.lang.String revision,
                               java.util.Map<?,?> loadOptions)
                               throws RepositoryAuthentificationException,
                                      java.io.IOException,
                                      UnresolvedReferencesException,
                                      NonExistingResourceException
Checks out a model with the specified revision. The model is put into the specified resource and is loaded. This means, if the resource already exists on the local file system, the resource is updated. The URI of the resource to check-out has to be set to the remote location before it is checked-out. The URI to set has to be absolute and has to start with the scheme 'http://'.

Parameters:
session - the current session for authentication
resource - the resource to check-out
revision - the revision of the model to check out
loadOptions - the options for the model check out
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
RepositoryAuthentificationException

checkoutModelWithDependencies

void checkoutModelWithDependencies(Session session,
                                   Resource model,
                                   java.lang.String revision,
                                   java.util.Map<?,?> loadOptions)
                                   throws RepositoryAuthentificationException,
                                          NonExistingResourceException,
                                          UnresolvedReferencesException,
                                          java.io.IOException
Checks out a model and its dependent models with the specified revision. The URI of the resource to check-out has to be set to the remote location before it is checked-out. The URI to set has to be absolute and has to start with the scheme 'http://'.

Parameters:
session - the current session for authentication
resource - the resource to check-out
revision - the revision of the model to check out
loadOptions - the options for the model check out
Throws:
RepositoryAuthentificationException
NonExistingResourceException
UnresolvedReferencesException
java.io.IOException

checkInModel

void checkInModel(Session session,
                  java.util.List<Resource> resources,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage)
                  throws RepositoryAuthentificationException,
                         java.io.IOException,
                         NonExistingResourceException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a list of resources and saves the changed resources in the repository. The URI of each resource has to be set to the remote target location before committing. The URI to set has to be absolute and has to start with the scheme 'http://'. For each resource the method #checkInModel(Session, Resource) is called.

Parameters:
session - the current session for authentication
resources - the list of resources to commit
logMessage - the log message for the transaction
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

checkInModel

void checkInModel(Session session,
                  java.util.List<Resource> resources,
                  java.util.Map<?,?> saveOptions,
                  java.lang.String logMessage,
                  java.util.Map<java.lang.String,java.lang.Object> options)
                  throws RepositoryAuthentificationException,
                         java.io.IOException,
                         NonExistingResourceException,
                         InvalidValueException,
                         ConstraintViolationException,
                         LockedException,
                         UnresolvedReferencesException
Commits a list of resources and saves the changed resources in the repository. The URI of each resource has to be set to the remote target location before committing. The URI to set has to be absolute and has to start with the scheme 'http://'. For each resource the method #checkInModel(Session, Resource) is called.

Parameters:
session - the current session for authentication
resources - the list of resources to commit
logMessage - the log message for the transaction
options - option to use for storing the model
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

checkOutModel

void checkOutModel(Session session,
                   java.util.List<Resource> resources,
                   java.util.Map<?,?> loadOptions)
                   throws RepositoryAuthentificationException,
                          java.io.IOException,
                          UnresolvedReferencesException,
                          NonExistingResourceException
Checks out a list of models with head revision. Each model is put in a resource and is loaded. The URI of each resource has to be set to the remote location before it is checked-out. The URI to set has to be absolute and has to start with the scheme 'http://'. For each resource in the list, the method #checkOutModel(Session, Resource) is called.

Parameters:
session - the current session for authentication
resources - the resources to check-out
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
RepositoryAuthentificationException

checkOutModelWithRevision

void checkOutModelWithRevision(Session session,
                               java.util.List<Resource> resources,
                               java.lang.String revision,
                               java.util.Map<?,?> loadOptions)
                               throws RepositoryAuthentificationException,
                                      java.io.IOException,
                                      UnresolvedReferencesException,
                                      NonExistingResourceException
Checks out a list of models with the specified revision. Each model is put in a resource and is loaded. The URI of each resource has to be set to the remote location before it is checked-out. The URI to set has to be absolute and has to start with the scheme 'http://'. For each resource in the list, the method #checkOutModel(Session, Resource) is called.

Parameters:
session - the current session for authentication
resources - the resources to check-out
revision - the revision of the model to check out
loadOptions - the options for the model check out
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
RepositoryAuthentificationException

checkOutFile

void checkOutFile(Session session,
                  URI fileUri,
                  java.lang.String revision,
                  java.io.File file)
                  throws RepositoryAuthentificationException,
                         java.io.IOException,
                         NonExistingResourceException
Checks out a file located in the repository at the specified path in a particular revision. This means that the file is initially checked out from the repository if no working copy exists. Otherwise, the existing file is updated.

Parameters:
session - the current session for authentication
fileUri - the remote location of the file to check out
revision - the revision of the file to check-out (HEAD: -1)
file - the local file
Throws:
java.io.IOException
NonExistingResourceException
RepositoryAuthentificationException

checkOutFile

java.io.InputStream checkOutFile(Session session,
                                 URI fileUri,
                                 java.lang.String revision)
                                 throws RepositoryAuthentificationException,
                                        java.io.IOException,
                                        NonExistingResourceException
Checks out a file located in the repository at the specified path in a particular revision and returns the InputStream.

Parameters:
session - the current session for authentication
fileUri - the remote location of the file to check-out
revision - the revision of the file to check-out (HEAD: -1)
Returns:
the InputStream of the checked out file
Throws:
java.io.IOException
NonExistingResourceException
RepositoryAuthentificationException

checkOutFileAsDataSource

IModelBusDataSource checkOutFileAsDataSource(Session session,
                                             URI fileUri,
                                             java.lang.String revision)
                                             throws RepositoryAuthentificationException,
                                                    java.io.IOException,
                                                    NonExistingResourceException
Checks out a file located in the repository at the specified path in a particular revision and returns a ModelBusDataSource. You get the InputStream of the data source through IModelBusDataSource.getInputStream()

Parameters:
session - the current session for authentication
fileUri - the remote location of the file to check-out
revision - the revision of the file to check-out (HEAD: -1)
Returns:
a ModelBusDataSource encapsulating the checked out file
Throws:
java.io.IOException
NonExistingResourceException
RepositoryAuthentificationException

setEnableDependencies

void setEnableDependencies(boolean enableDependencies)
Enables dependencies support. If it is turned on, #checkInModel(Session, Resource) commits all referenced models and meta-models automatically, but only if the referenced models do not already exist in the repository. The incoming references for each model and meta-model are saved in the repository and are always updated before committing models.

Parameters:
enableDependencies - default=false

setModelExtensions

void setModelExtensions(java.lang.String[] modelExtensions)
If the dependencies support is enabled, you have to specify the supported model types

Parameters:
modelExtensions - the supported extensions ("uml","ecore" for example)

commit

void commit(Session session,
            java.util.List<PathFileContentMapEntry> createFileMap,
            java.util.List<PathFileContentMapEntry> checkInFileMap,
            java.util.List<java.lang.String> folderPaths,
            java.util.List<java.lang.String> deletionPaths,
            java.lang.String logMessage)
            throws RepositoryRuntimeException,
                   InvalidValueException,
                   RepositoryAuthentificationException,
                   LockedException
Throws:
RepositoryRuntimeException
InvalidValueException
RepositoryAuthentificationException
LockedException

checkInFile

void checkInFile(Session session,
                 URI fileUri,
                 java.io.File file,
                 java.lang.String logMessage)
                 throws RepositoryAuthentificationException,
                        java.io.IOException,
                        NonExistingResourceException,
                        InvalidValueException,
                        ConstraintViolationException,
                        LockedException,
                        UnresolvedReferencesException
Commits a file and saves the changed file in the repository. If the specified remote path does not already exist, the file is created.

Parameters:
session - the current session for authentication
fileUri - the remote target location of the file to commit
file - the local file to commit
logMessage - the log message for the transaction
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

checkInFile

void checkInFile(Session session,
                 URI fileUri,
                 java.io.File file,
                 java.lang.String logMessage,
                 java.util.Map<java.lang.String,java.lang.Object> options)
                 throws RepositoryAuthentificationException,
                        java.io.IOException,
                        NonExistingResourceException,
                        InvalidValueException,
                        ConstraintViolationException,
                        LockedException,
                        UnresolvedReferencesException
Commits a file and saves the changed file in the repository. If the specified remote path does not already exist, the file is created.

Parameters:
session - the current session for authentication
fileUri - the remote target location of the file to commit
file - the local file to commit
logMessage - the log message for the transaction
options - option to use for storing the model
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

checkInFile

void checkInFile(Session session,
                 IModelBusDataSource dataSource,
                 java.lang.String logMessage)
                 throws RepositoryAuthentificationException,
                        java.io.IOException,
                        NonExistingResourceException,
                        InvalidValueException,
                        ConstraintViolationException,
                        LockedException,
                        UnresolvedReferencesException
Commits a file that is encapsulated in a ModelBusDataSource. The uri of the data source has to be set to the remote target location before committing. The remote location has to start with 'http://'.

Parameters:
session - the current session for authentication
dataSource - the data source to commit
logMessage - the log message for the transaction
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

checkInFile

void checkInFile(Session session,
                 IModelBusDataSource dataSource,
                 java.lang.String logMessage,
                 java.util.Map<java.lang.String,java.lang.Object> options)
                 throws RepositoryAuthentificationException,
                        java.io.IOException,
                        NonExistingResourceException,
                        InvalidValueException,
                        ConstraintViolationException,
                        LockedException,
                        UnresolvedReferencesException
Commits a file that is encapsulated in a ModelBusDataSource. The uri of the data source has to be set to the remote target location before committing. The remote location has to start with 'http://'.

Parameters:
session - the current session for authentication
dataSource - the data source to commit
logMessage - the log message for the transaction
options - option to use for storing the model
Throws:
java.io.IOException
NonExistingResourceException
UnresolvedReferencesException
LockedException
ConstraintViolationException
InvalidValueException
RepositoryAuthentificationException

getRoot

RepositoryDirEntry getRoot(Session session)
                           throws RepositoryAuthentificationException,
                                  java.io.IOException,
                                  NonExistingResourceException,
                                  RepositoryRuntimeException,
                                  InvalidRevisionException
Returns the repository's root directory entry

Parameters:
session - the current session for authentication
Returns:
a RepositoryDirEntry
Throws:
java.io.IOException
NonExistingResourceException
InvalidRevisionException
RepositoryRuntimeException
RepositoryAuthentificationException

getDirEntries

RepositoryDirEntry[] getDirEntries(Session session,
                                   URI uri,
                                   java.lang.String revision)
                                   throws RepositoryAuthentificationException,
                                          java.io.IOException,
                                          RepositoryRuntimeException,
                                          InvalidRevisionException,
                                          NonExistingResourceException
Returns an array with repository directory entries for a directory located at the specified path in a particular revision.

Parameters:
session - the current session for authentication
uri - the directory's URI to get the entries for
revision - the revision of the directory (HEAD: -1)
Returns:
an array of RepositoryDirEntry
Throws:
java.io.IOException
NonExistingResourceException
InvalidRevisionException
RepositoryRuntimeException
RepositoryAuthentificationException

getDirEntries

RepositoryDirEntry[] getDirEntries(Session session,
                                   URI uri,
                                   java.lang.String revision,
                                   java.lang.String[] excludeFilters)
                                   throws RepositoryAuthentificationException,
                                          java.io.IOException,
                                          RepositoryRuntimeException,
                                          InvalidRevisionException,
                                          NonExistingResourceException
Returns an array with repository directory entries for a directory located at the specified path in a particular revision excluding specified entries.

Parameters:
session - the current session for authentication
uri - the URI to get the directory entries for
revision - the revision of the given URL (HEAD: -1)
excludeFilters - entries to exclude (regular expressions)
Returns:
an array of RepositoryDirEntry
Throws:
java.io.IOException
NonExistingResourceException
InvalidRevisionException
RepositoryRuntimeException
RepositoryAuthentificationException

getInfo

java.util.List<RepositoryDirEntry> getInfo(Session session,
                                           URI uri,
                                           java.lang.String revision)
                                           throws RepositoryAuthentificationException,
                                                  java.io.IOException,
                                                  InvalidRevisionException,
                                                  NonExistingResourceException
Gives information about an entry located at the specified path in a particular revision.

Parameters:
session - the current session for authentication
uri - location of the entry to get the information for
revision - the revision of the given URL (HEAD: -1)
Returns:
a RepositoryDirEntry
Throws:
java.io.IOException
NonExistingResourceException
InvalidRevisionException
RepositoryAuthentificationException

exists

boolean exists(Session session,
               URI uri,
               java.lang.String revision)
               throws RepositoryAuthentificationException,
                      NonExistingResourceException
Checks whether the specified location exists in the repository or not

Parameters:
session - the current session for authentication
uri - the location to check
revision - the revision of the given location (HEAD: -1)
Returns:
true, if the specified location exists, otherwise false
Throws:
NonExistingResourceException
RepositoryAuthentificationException

checkPath

java.util.List<RepositoryNodeKind> checkPath(Session session,
                                             URI uri,
                                             java.lang.String revision)
                                             throws RepositoryAuthentificationException,
                                                    NonExistingResourceException
Returns the kind ("DIR", "FILE", "MODEL", "UNKNOWN", "NONE") of a repository node located at the specified location in a particular revision.

Parameters:
session - the current session for authentication
uri - the location to check
revision - the revision of the given location (HEAD: -1)
Returns:
the RepositoryNodeKind of the specified location
Throws:
NonExistingResourceException
RepositoryAuthentificationException

delete

java.lang.String delete(Session session,
                        URI uri,
                        java.lang.String logMessage)
                        throws RepositoryAuthentificationException,
                               LockedException,
                               NonExistingResourceException
Deletes the repository entry located at the specified location.

Parameters:
session - the current session for authentication
uri - the location to delete
logMessage - the log message for the transaction
Returns:
"OK", if deletion was successful, otherwise null
Throws:
NonExistingResourceException
LockedException
RepositoryAuthentificationException

lock

boolean lock(Session session,
             URI uri)
             throws RepositoryAuthentificationException,
                    InvalidValueException,
                    NonExistingResourceException,
                    RepositoryRuntimeException,
                    LockedException
Locks the repository entry located at the specified location. The locked location, the timestamp and the user, who has locked the location, are saved in the repository.

Parameters:
session - the current session for authentication
uri - the uri to lock
Returns:
true, if the lock was successful, otherwise false
Throws:
NonExistingResourceException
InvalidValueException
LockedException
RepositoryRuntimeException
RepositoryAuthentificationException

unlock

boolean unlock(Session session,
               URI uri)
               throws RepositoryAuthentificationException,
                      LockedException,
                      NonExistingResourceException
Unlocks the repository entry located at the specified location.

Parameters:
session - the current session for authentication
uri - the uri to unlock
Returns:
true, if the unlock was successful, otherwise false
Throws:
NonExistingResourceException
LockedException
RepositoryAuthentificationException

control

boolean control(Session session,
                URI fragmentUri,
                java.lang.String fragmentFileLocation,
                java.lang.String logMessage)
                throws RepositoryAuthentificationException,
                       LockedException,
                       NonExistingResourceException
Splits a model into fragments. An EObject with the specified fragmentUri is moved from the parent model's resource to another new created resource located at the specified fragmentFileLocation.

Parameters:
session - the current session for authentication
fragmentUri - the URI of the fragment to control
fragmentFileLocation - the remote repository location of the fragment's resource
logMessage - the log message for the transaction
Returns:
true, if the control was successful, otherwise false
Throws:
NonExistingResourceException
LockedException
RepositoryAuthentificationException

uncontrol

boolean uncontrol(Session session,
                  URI fragmentUri,
                  java.lang.String logMessage)
                  throws RepositoryAuthentificationException,
                         LockedException,
                         NonExistingResourceException
Uncontrols the EObject with the specified fragmentUri. The controlled EObject is moved to its parent model's resource and its old resource is deleted.

Parameters:
session - the current session for authentication
fragmentUri - the URI of the fragment to uncontrol
logMessage - the log message for the transaction
Returns:
true, if the uncontrol was successful, otherwise false
Throws:
NonExistingResourceException
LockedException
RepositoryAuthentificationException

getLocks

LockInfo[] getLocks(Session session,
                    java.lang.String urlPrefix)
                    throws RepositoryAuthentificationException,
                           LockedException,
                           NonExistingResourceException
Gets all lock entries on or below the specified urlPrefix. A lock entry contains the locked location, the timestamp and the user, who has locked the location.

Parameters:
session - the current session for authentication
urlPrefix - the path to get the locks for
Returns:
an array of LockInfo for the specified location
Throws:
NonExistingResourceException
LockedException
RepositoryAuthentificationException

getIncomingReferences

IncomingReferencesInfo[] getIncomingReferences(Session session,
                                               URI uri)
                                               throws RepositoryAuthentificationException,
                                                      NonExistingResourceException
Gets all incoming references for a model or a model element with the specified uri. A dependencies entry contains the remote location of the referencing model or model element, the type URI and the name of the referencing model element.

Parameters:
session - the current session for authentication
uri - the uri of the model or the model element
Returns:
an array of IncomingReferencesInfo
Throws:
NonExistingResourceException
RepositoryAuthentificationException

getOutgoingReferences

OutgoingReferencesInfo[] getOutgoingReferences(Session session,
                                               URI uri)
                                               throws RepositoryAuthentificationException,
                                                      NonExistingResourceException
Gets all outgoing references for a model or a model element with the specified uri. A reference contains the remote location of the referenced model.

Parameters:
session - the current session for authentication
uri - the uri of the model or the model element
Returns:
an array of OutgoingReferencesInfo
Throws:
NonExistingResourceException
RepositoryAuthentificationException

getDependencies

DependenciesInfo getDependencies(Session session,
                                 URI uri,
                                 boolean includeIncomingReferences,
                                 boolean includeOutgoingReferences)
                                 throws RepositoryAuthentificationException,
                                        NonExistingResourceException
Gets all incoming and outgoing references for a model or a model element with the specified uri. The methods allows to filter incoming or outgoing references.

Parameters:
session - the current session for authentication
uri - the uri of the model or the model element
includeIncomingReferences - whether to include incoming references
includeOutgoingReferences - whether to include outgoing references
Returns:
DependenciesInfo
Throws:
NonExistingResourceException
RepositoryAuthentificationException

getDependencies

DependenciesInfo getDependencies(Session session,
                                 URI uri)
                                 throws RepositoryAuthentificationException,
                                        NonExistingResourceException
Gets all incoming and outgoing references for a model or a model element with the specified uri.

Parameters:
session - the current session for authentication
uri - the uri of the model or the model element
includeIncomingReferences - whether to include incoming references
includeOutgoingReferences - whether to include outgoing references
Returns:
DependenciesInfo
Throws:
NonExistingResourceException
RepositoryAuthentificationException

getReferencingResources

java.util.List<Resource> getReferencingResources(Session session,
                                                 URI referencedObjectUri,
                                                 URI referencingTypeUri)
                                                 throws RepositoryAuthentificationException,
                                                        NonExistingResourceException,
                                                        java.io.IOException,
                                                        UnresolvedReferencesException
Gets a list of resources, which contain model elements of a certain type (referencingTypeUri) that references the specified element (referencedObjectUri)

Parameters:
session - the current session for authentication
referencedObjectUri - the URI of the referenced object
referencingTypeUri - the URI of referencing object's type
Returns:
a list of resources
Throws:
RepositoryAuthentificationException
NonExistingResourceException
java.io.IOException
UnresolvedReferencesException

getResourceUri

URI getResourceUri(URI objectUri)
Returns the resource uri of an object with the specified objectUri; the uri without a fragment.

Parameters:
objectUri -
Returns:
the specified objectUri without the fragment (if any)

createDir

java.lang.String createDir(Session session,
                           URI uri,
                           java.lang.String logMessage)
                           throws RepositoryAuthentificationException
Creates a directory located at the specified path.

Parameters:
session - the current session for authentication
uri - the path of the new directory
logMessage - the log message for the transaction
Returns:
"OK", if createDir was successful, otherwise null
Throws:
RepositoryAuthentificationException

createDir

java.lang.String createDir(Session session,
                           URI uri,
                           java.lang.String logMessage,
                           java.util.Map<java.lang.String,java.lang.Object> options)
                           throws RepositoryAuthentificationException
Creates a directory located at the specified path.

Parameters:
session - the current session for authentication
uri - the path of the new directory
logMessage - the log message for the transaction
options - option to use for storing the model
Returns:
"OK", if createDir was successful, otherwise null
Throws:
RepositoryAuthentificationException

move

void move(Session session,
          java.lang.String[] srcPaths,
          java.lang.String destPath,
          java.lang.String logMessage)
          throws RepositoryAuthentificationException,
                 NonExistingResourceException
Moves repository entries located at the specified srcPaths to a directory located at the specified destPath.

Parameters:
session - the current session for authentication
srcPaths - the locations of the entries to move
destPath - the location of the destination directory
logMessage - the log message for the transaction
Throws:
NonExistingResourceException
RepositoryAuthentificationException

copy

boolean copy(Session session,
             java.lang.String[] srcPaths,
             java.lang.String destPath,
             java.lang.String logMessage)
             throws RepositoryAuthentificationException,
                    NonExistingResourceException
Copies repository entries located at the specified srcPaths to a directory located at the specified destPath.

Parameters:
session - the current session for authentication
srcPaths - the locations of the entries to copy
destPath - the location of the destination directory
logMessage - the log message for the transaction
Returns:
true, if the copy was successful, otherwise false
Throws:
NonExistingResourceException
RepositoryAuthentificationException

getLogEntries

RepositoryLogEntry[] getLogEntries(Session session,
                                   java.lang.String[] targetPaths,
                                   java.lang.String startRevision,
                                   java.lang.String endRevision,
                                   boolean changedPath,
                                   boolean strictNode,
                                   long limit,
                                   boolean includeMergedRevisions,
                                   java.lang.String[] revProps)
                                   throws RepositoryAuthentificationException
Traverses revision history and returns an array of log entries.

Parameters:
session - the current session for authentication
targetPaths - paths that mean only those revisions at which they were changed
startRevision - a revision to start from
endRevision - a revision to end at
changedPath - if true, then revision information will also include all changed paths per revision, otherwise not
strictNode - if true, then copy history is not to be traversed
limit - the maximum number of log entries to process
includeMergedRevisions -
revProps -
Returns:
an array of RepositoryLogEntry
Throws:
RepositoryAuthentificationException

getMode

java.lang.Integer getMode()
Specified by:
getMode in interface IModelBusHelper

setMode

void setMode(java.lang.Integer mode)
Specified by:
setMode in interface IModelBusHelper

commitChangeModel

boolean commitChangeModel(Session session,
                          java.lang.String messageId,
                          URI modelUri,
                          java.lang.String changeModelAsString)
                          throws RepositoryAuthentificationException,
                                 java.io.IOException,
                                 InvalidValueException
Commits a serialized EMF ChangeModel. The change set is applied to the remote model. Connected clients are notified and receive the ChangeModel.

Parameters:
session - the current session for authentication
messageId - a unique identifier
modelUri - should be empty (not used)
changeModelAsString - the serialized ChangeModel
Returns:
true, if commitChangeModel was successful, otherwise false
Throws:
java.io.IOException
InvalidValueException
RepositoryAuthentificationException

ping

long ping(IRepositoryHelper.PingType type,
          Session session)
          throws ModelBusException
Parameters:
type - The type of the ping request. Could be PingType.WSDL_REQUEST or PingType.SERVICE_REQUEST
session - The session to use for the request. Can be null if using type PingType.WSDL_REQUEST
Returns:
duration for the request
Throws:
ModelBusException

getExtendedLogEntry

ExtendedRepositoryLogEntry getExtendedLogEntry(Session session,
                                               java.lang.String revision,
                                               java.lang.Long date)
                                               throws RepositoryRuntimeException,
                                                      RepositoryAuthentificationException,
                                                      InvalidValueException,
                                                      ConstraintViolationException
Returns an log entry for a given commit extended with information about its previous commit. Expects either a revision string or a revision date.

Parameters:
session - the current session for authentication
revision - the revision (HEAD: -1)
date - the date of the requested revision
Returns:
the log entry
Throws:
RepositoryAuthentificationException
RepositoryRuntimeException
ConstraintViolationException
InvalidValueException