org.eodisp.core.common
Class ReposServiceProxy

java.lang.Object
  extended by org.eodisp.core.common.ReposServiceProxy

public class ReposServiceProxy
extends java.lang.Object

Version:
$Id:$
Author:
eglimi

Field Summary
(package private) static org.apache.log4j.Logger logger
          Log4J logger for this class
 
Constructor Summary
ReposServiceProxy(ReposModelService reposService)
           
 
Method Summary
 java.lang.String addSom(java.lang.String somName, java.lang.String somVersion, java.lang.String somDescription, java.io.File somFile)
           
 void deleteSom(java.lang.String somName, java.lang.String somVersion)
           
 org.eclipse.emf.ecore.sdo.EDataObject getRootObject()
           
 SomFile getSom(java.lang.String somName, java.lang.String somVersion)
           
 boolean isDirty()
          Checks if there are some changes to be saved.
 boolean isScheduledForReload()
           
 void load()
           
 void save()
          Saves the changes made to the data graph.
 void setScheduledForReload(boolean isScheduledForReload)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Log4J logger for this class

Constructor Detail

ReposServiceProxy

public ReposServiceProxy(ReposModelService reposService)
Method Detail

getRootObject

public org.eclipse.emf.ecore.sdo.EDataObject getRootObject()
                                                    throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

load

public void load()
          throws java.io.IOException
Throws:
java.io.IOException

save

public void save()
          throws java.io.IOException
Saves the changes made to the data graph. This method does two things
  1. Makes a copy of the original data graph and sends this copy to the real service that will handle the save to the persistent storage
  2. If the save was successful, it applies the changes on the original (local) data graph as well.
    1. The advantage of this procedure is its simplicity, because no reload of the data is necessary. This is useful especially for the trees that display this data in order to not reload the whole tree. It should work most of the time since it is not expected that multiple applications share the same project data. Therefore, the data in the local data graph should be the same as the data in the remote data graph.

      Reloading the data from the persistent storage must therefore be handled separately.

      Throws:
      java.io.IOException

isDirty

public boolean isDirty()
Checks if there are some changes to be saved.

Returns:
True, if there are changes, otherwise false.

addSom

public java.lang.String addSom(java.lang.String somName,
                               java.lang.String somVersion,
                               java.lang.String somDescription,
                               java.io.File somFile)
                        throws java.rmi.RemoteException,
                               java.lang.IllegalArgumentException,
                               java.io.IOException
Throws:
java.rmi.RemoteException
java.lang.IllegalArgumentException
java.io.IOException

getSom

public SomFile getSom(java.lang.String somName,
                      java.lang.String somVersion)
               throws java.rmi.RemoteException,
                      SomNotKnownException,
                      java.io.IOException
Throws:
java.rmi.RemoteException
SomNotKnownException
java.io.IOException

deleteSom

public void deleteSom(java.lang.String somName,
                      java.lang.String somVersion)
               throws java.rmi.RemoteException,
                      SomNotKnownException
Throws:
java.rmi.RemoteException
SomNotKnownException

isScheduledForReload

public boolean isScheduledForReload()
Returns:
Returns the isScheduledForReload.

setScheduledForReload

public void setScheduledForReload(boolean isScheduledForReload)
Parameters:
isScheduledForReload - The isScheduledForReload to set.