org.opends.server.backends.jeb.importLDIF
Class LongImportIDSet

java.lang.Object
  extended by org.opends.server.backends.jeb.importLDIF.LongImportIDSet
All Implemented Interfaces:
ImportIDSet

public class LongImportIDSet
extends java.lang.Object
implements ImportIDSet

A import ID set backed by an array of longs.


Constructor Summary
LongImportIDSet()
          Create an empty instance.
LongImportIDSet(EntryID id)
          Create instance and add specified entry ID to the set.
 
Method Summary
 void addEntryID(EntryID entryID, int limit, boolean maintainCount)
          Add an entry ID to the set.
 int getMemorySize()
          Return the memory size of a set.
 long getUndefinedSize()
          Return the undefined size.
 boolean isDefined()
          Return if a set is defined or not.
 boolean merge(byte[] DBbytes, ImportIDSet importIdSet, int limit, boolean maintainCount)
          Merge a byte array read from DB with a ID set.
 void merge(ImportIDSet importIDSet, int limit, boolean maintainCount)
          Merge the specified import ID set with the current import ID set using the specified entry limit an maintain count values.
 void reset()
          Reset set.
 void setEntryID(EntryID id)
          Set the first entry ID to the specified entry ID.
 void setUndefined()
          Set the import ID set to the undefined state.
 int size()
          Return the size of the set.
 byte[] toDatabase()
          Convert a set to a byte array suitable for saving to DB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongImportIDSet

public LongImportIDSet()
Create an empty instance.


LongImportIDSet

public LongImportIDSet(EntryID id)
Create instance and add specified entry ID to the set.

Parameters:
id - The entry ID.
Method Detail

setEntryID

public void setEntryID(EntryID id)
Set the first entry ID to the specified entry ID.

Specified by:
setEntryID in interface ImportIDSet
Parameters:
id - The entry ID to use.

reset

public void reset()
Reset set.

Specified by:
reset in interface ImportIDSet

isDefined

public boolean isDefined()
Return if a set is defined or not.

Specified by:
isDefined in interface ImportIDSet
Returns:
True if a set is defined.

setUndefined

public void setUndefined()
Set the import ID set to the undefined state.

Specified by:
setUndefined in interface ImportIDSet

getUndefinedSize

public long getUndefinedSize()
Return the undefined size.

Specified by:
getUndefinedSize in interface ImportIDSet
Returns:
The undefined count.

getMemorySize

public int getMemorySize()
Return the memory size of a set.

Specified by:
getMemorySize in interface ImportIDSet
Returns:
The sets current memory size.

merge

public void merge(ImportIDSet importIDSet,
                  int limit,
                  boolean maintainCount)
Merge the specified import ID set with the current import ID set using the specified entry limit an maintain count values.

Specified by:
merge in interface ImportIDSet
Parameters:
importIDSet - The import ID set to merge.
limit - The entry limit to use.
maintainCount - True if maintain count is being kept.

merge

public boolean merge(byte[] DBbytes,
                     ImportIDSet importIdSet,
                     int limit,
                     boolean maintainCount)
Merge a byte array read from DB with a ID set.

Specified by:
merge in interface ImportIDSet
Parameters:
DBbytes - The byte array read from DB.
importIdSet - The import ID set to merge.
limit - The entry limit.
maintainCount - Maintain count of iDs if in undefined mode.
Returns:
True if the merged set is undefined.

addEntryID

public void addEntryID(EntryID entryID,
                       int limit,
                       boolean maintainCount)
Add an entry ID to the set.

Specified by:
addEntryID in interface ImportIDSet
Parameters:
entryID - The entry ID to add.
limit - The entry limit.
maintainCount - Maintain count of IDs if in undefined mode.

toDatabase

public byte[] toDatabase()
Convert a set to a byte array suitable for saving to DB.

Specified by:
toDatabase in interface ImportIDSet
Returns:
A byte array representing the set.

size

public int size()
Return the size of the set.

Specified by:
size in interface ImportIDSet
Returns:
The size of the ID set.