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

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

public class IntegerImportIDSet
extends java.lang.Object
implements ImportIDSet

An import ID set backed by an array of ints.


Constructor Summary
IntegerImportIDSet()
          Create an empty import set.
IntegerImportIDSet(EntryID id)
          Create an import set and add the specified entry ID to it.
 
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

IntegerImportIDSet

public IntegerImportIDSet()
Create an empty import set.


IntegerImportIDSet

public IntegerImportIDSet(EntryID id)
Create an import set and add the specified entry ID to it.

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.

getUndefinedSize

public long getUndefinedSize()
Return the undefined size.

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

setUndefined

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

Specified by:
setUndefined in interface ImportIDSet

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.

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.

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.

size

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

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

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.