org.eclipse.emf.emfstore.internal.server.core.subinterfaces
Class ChangePackageFragmentUploadAdapter

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.AdapterImpl
      extended by org.eclipse.emf.emfstore.internal.server.core.subinterfaces.ChangePackageFragmentUploadAdapter
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal

public class ChangePackageFragmentUploadAdapter
extends org.eclipse.emf.common.notify.impl.AdapterImpl

Adapter that is meant to be attached to a session and stores all change package fragments.

Author:
emueller

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Constructor Summary
ChangePackageFragmentUploadAdapter()
           
 
Method Summary
 void addFragment(String proxyId, List<AbstractOperation> fragment)
          Adds a single fragment.
 void clearCompleted(String proxyId)
          Removes the completed change package matching the given ID.
 com.google.common.base.Optional<ChangePackage> convertFileBasedToInMemoryChangePackage(String proxyId)
          Returns the aggregated change package.
 com.google.common.base.Optional<FileBasedChangePackage> getFileBasedChangePackage(String proxyId)
          Returns the temporary file based changepackage for the given proxy id, if present.
 void markAsComplete(String proxyId)
          Mark a list of change package as completed.
 
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, isAdapterForType, notifyChanged, setTarget, unsetTarget
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangePackageFragmentUploadAdapter

public ChangePackageFragmentUploadAdapter()
Method Detail

addFragment

public void addFragment(String proxyId,
                        List<AbstractOperation> fragment)
                 throws ESException
Adds a single fragment.

Parameters:
proxyId - the ID identifying the list of fragments this fragment belongs to
fragment - the actual fragment to be added
Throws:
ESException - in case the fragment could not be added

markAsComplete

public void markAsComplete(String proxyId)
                    throws ESException
Mark a list of change package as completed.

Parameters:
proxyId - the ID of the set of change package fragments that is supposed to be completed
Throws:
ESException - in case

convertFileBasedToInMemoryChangePackage

public com.google.common.base.Optional<ChangePackage> convertFileBasedToInMemoryChangePackage(String proxyId)
Returns the aggregated change package. Fragments considered as complete need to be marked as such by calling {markAsComplete(String).

Parameters:
proxyId - the ID that identifies a list of change package fragments from which the change package will be created
Returns:
the aggregated ChangePackage as an Optional

getFileBasedChangePackage

public com.google.common.base.Optional<FileBasedChangePackage> getFileBasedChangePackage(String proxyId)
Returns the temporary file based changepackage for the given proxy id, if present. The change package is backed by temporary files on server side, so FileBasedChangePackage.move(String) might be needed.

Parameters:
proxyId - the ID that identifies the FileBasedChangePackage
Returns:
the file based change package as an Optional

clearCompleted

public void clearCompleted(String proxyId)
Removes the completed change package matching the given ID.

Parameters:
proxyId - the ID of the change package proxy


Copyright © 2016. All Rights Reserved.