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

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

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

Adapter that is supposed to be attached to a session and split incoming complete change packages into single 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
ChangePackageFragmentProviderAdapter()
           
 
Method Summary
 void addAsFragments(String proxyId, AbstractChangePackage changePackage)
          Splits the given change package into fragments and stores them.
 List<AbstractOperation> getFragment(String proxyId, int fragmentIndex)
          Returns a single fragment.
 int getFragmentSize(String proxyId)
          Returns the number of fragments for the given ID.
 void markAsConsumed(String proxyId)
          Removes the fragments that belong to given ID.
 
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

ChangePackageFragmentProviderAdapter

public ChangePackageFragmentProviderAdapter()
Method Detail

addAsFragments

public void addAsFragments(String proxyId,
                           AbstractChangePackage changePackage)
Splits the given change package into fragments and stores them.

Parameters:
proxyId - an ID that needs to be unique for the change package to be splitted. Necessary when there are multiple change packages available per project
changePackage - the change package to be splitted

getFragment

public List<AbstractOperation> getFragment(String proxyId,
                                           int fragmentIndex)
                                    throws ESException
Returns a single fragment.

Parameters:
proxyId - ID that identifies a list of fragments
fragmentIndex - the index of the fragment to be returned
Returns:
the fragment
Throws:
ESException - in case no fragments for the given proxy ID are present

getFragmentSize

public int getFragmentSize(String proxyId)
Returns the number of fragments for the given ID.

Parameters:
proxyId - the ID identifying the list of change package fragments
Returns:
the number of available fragments

markAsConsumed

public void markAsConsumed(String proxyId)
Removes the fragments that belong to given ID.

Parameters:
proxyId - identifies the change package fragments to be removed


Copyright © 2016. All Rights Reserved.