org.eodisp.core.common
Interface ReposModelService

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
ReposModelServiceImpl

public interface ReposModelService
extends java.rmi.Remote

This is the service that can be used to access data store in the model repository. This interface is exported by the eodisp_remote package. Therefore, any remote application can use it.

Version:
$Id:$
Author:
eglimi

Field Summary
static java.lang.String REGISTRY_NAME
          This name is used for two purposes: The model repository application will export this interface with this name (through the eodisp_remote package) All applications can perform a lookup on this name to find the remote (this) interface (through the eodisp_remote package)
 
Method Summary
 java.lang.String addSom(SomFile somFile)
          Adds a physical SOM file to the repository.
 void deleteSom(java.lang.String somName, java.lang.String somVersion)
          Deletes the physical SOM file that is locally stored on in the repository.
 org.eclipse.emf.ecore.sdo.EDataGraph getAllData()
          Returns all data currently stored in the model repository.
 SomFile getSom(java.lang.String somName, java.lang.String somVersion)
          Reads a SOM file locally in the repository and returns it.
 void update(org.eclipse.emf.ecore.sdo.EDataGraph dataGraph)
          Updates a data graph in the resource.
 

Field Detail

REGISTRY_NAME

static final java.lang.String REGISTRY_NAME
This name is used for two purposes:

See Also:
Constant Field Values
Method Detail

getAllData

org.eclipse.emf.ecore.sdo.EDataGraph getAllData()
                                                throws java.rmi.RemoteException,
                                                       java.io.IOException
Returns all data currently stored in the model repository.

Returns:
An EDataGraph containing the data.
Throws:
java.rmi.RemoteException - see documentation of RemoteException
java.io.IOException - Thrown if there is a problem loading the data.

update

void update(org.eclipse.emf.ecore.sdo.EDataGraph dataGraph)
            throws java.rmi.RemoteException,
                   java.io.IOException
Updates a data graph in the resource. The resource is the XML file that holds the repository instance data.

Updates are performed (saved) immediately, without any chance to undo changes.

Parameters:
dataGraph - The data graph with the changes to be committed.
Throws:
java.rmi.RemoteException - see documentation of RemoteException
java.io.IOException - thrown if there is a problem while saving the data to the disk.

addSom

java.lang.String addSom(SomFile somFile)
                        throws java.rmi.RemoteException,
                               java.io.IOException
Adds a physical SOM file to the repository. The SOM file will be locally stored in a location specified in the configuration.

Parameters:
somFile - The object containing the physical file.
Returns:
The path at which the file has been stored.
Throws:
java.rmi.RemoteException - see documentation of RemoteException
java.io.IOException - thrown if the file could not be save in the repository.

getSom

SomFile getSom(java.lang.String somName,
               java.lang.String somVersion)
               throws java.rmi.RemoteException,
                      SomNotKnownException,
                      java.io.IOException
Reads a SOM file locally in the repository and returns it. This is a file that has been stored with addSom(SomFile) method.

The name and version of the SOM will be used to lookup the location of the file on the file system.

Parameters:
somName - The name of the SOM.
somVersion - The version of the SOM.
Returns:
An instance of SomFile, including the byte array representing the data. It always returns a non null object. In case of an error, an exception will be thrown, but never will be a null object returned.
Throws:
java.rmi.RemoteException - see documentation of RemoteException
SomNotKnownException - thrown if no SOM file could be found that corresponds to the given somName and somVersion.
java.io.IOException - thrown in case of an error when reading the file or if the file is too large.

deleteSom

void deleteSom(java.lang.String somName,
               java.lang.String somVersion)
               throws java.rmi.RemoteException,
                      SomNotKnownException
Deletes the physical SOM file that is locally stored on in the repository. The SOM file is identified by the name and version of the SOM. The repository model will be queried to find the location of the file.

An exception will be thrown if the file cannot be deleted, otherwise, the deletion process has succeeded.

Parameters:
somName - The name of SOM.
somVersion - The version of the SOM.
Throws:
java.rmi.RemoteException - see documentation of RemoteException
SomNotKnownException - thrown if no SOM file could be found that corresponds to the given somName and somVersion.