org.egothor.slotter
Class SlotMap

java.lang.Object
  extended by org.egothor.slotter.SlotMap

public class SlotMap
extends java.lang.Object

This object represents some map of slots (Barrels).

Author:
galambos, Jakub Podhorny

Constructor Summary
SlotMap(java.lang.String filename, int versionID)
           
 
Method Summary
 Slot addUnderControl(int slot)
           
 void assignNewListener()
           
 void destroy(Slot slot)
           
 void destroySlots()
           
 Sequence<Barrel> elements()
           
 TransactionLog execute()
           
 Barrel get(int slot)
           
 Barrel get(Slot slot)
           
 java.lang.String getFilename()
           
 int getRootVersionID()
           
 long getUid()
           
static SlotMap open(java.lang.String filename, int versionID)
          Returns the slotter on the filename (canonical form of the filename will be used).
 Slot pullOverBarrel(BarrelReader reader, java.lang.String srcLocation)
          Pulls over (moves) srcLocation barrel into this databes.
 boolean removeDoc(long gid, int slot, long lid)
           
 TransactionLog rollback()
           
 Slot save(BarrelReader reader)
           
 void setListenSlotMap(ListenSlotMap listener)
           
 void softDestroy(Slot slot)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SlotMap

public SlotMap(java.lang.String filename,
               int versionID)
Method Detail

setListenSlotMap

public void setListenSlotMap(ListenSlotMap listener)

open

public static SlotMap open(java.lang.String filename,
                           int versionID)
                    throws java.io.IOException
Returns the slotter on the filename (canonical form of the filename will be used). If the versionID is a positive integer and it differs from the versionID of the slotter available, null value is returned. It also assigns a new listener.

Throws:
java.io.IOException
See Also:
getRootVersionID()

assignNewListener

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

getRootVersionID

public int getRootVersionID()

getUid

public long getUid()

getFilename

public java.lang.String getFilename()

addUnderControl

public Slot addUnderControl(int slot)

elements

public Sequence<Barrel> elements()

get

public Barrel get(int slot)

get

public Barrel get(Slot slot)

destroy

public void destroy(Slot slot)

softDestroy

public void softDestroy(Slot slot)

save

public Slot save(BarrelReader reader)

pullOverBarrel

public Slot pullOverBarrel(BarrelReader reader,
                           java.lang.String srcLocation)
Pulls over (moves) srcLocation barrel into this databes.

Parameters:
reader - Reader that is being pulled over
srcLocation - Reader's location that is being pulled over
Returns:

destroySlots

public void destroySlots()

rollback

public TransactionLog rollback()

execute

public TransactionLog execute()

removeDoc

public boolean removeDoc(long gid,
                         int slot,
                         long lid)