Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.database.sequence
Class DefaultSequenceProvider

java.lang.Object
  extended by com.jivesoftware.base.database.sequence.DefaultSequenceProvider
All Implemented Interfaces:
SequenceProvider

public class DefaultSequenceProvider
extends java.lang.Object
implements SequenceProvider

Manages sequences of unique ID's that get stored in the database. Database support for sequences varies widely; some don't use them at all. Instead, we handle unique ID generation with a combination VM/database solution.

A special table in the database doles out blocks of unique ID's to each virtual machine that interacts with Jive. This has the following consequences:

Each sequence type that this class manages has a different block size value. Objects that aren't created often have a block size of 1, while frequently created objects such as entries and comments have larger block sizes.


Constructor Summary
DefaultSequenceProvider()
           
 
Method Summary
 long getCurrentSequence(java.lang.String name)
           
 long getNextSequence(int type)
           
 long getNextSequence(java.lang.String name)
           
 boolean isNamedSequencesSupported()
           
 void removeNamedSequence(java.lang.String name)
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSequenceProvider

public DefaultSequenceProvider()
Method Detail

getNextSequence

public long getNextSequence(int type)
Specified by:
getNextSequence in interface SequenceProvider

getNextSequence

public long getNextSequence(java.lang.String name)
Specified by:
getNextSequence in interface SequenceProvider

removeNamedSequence

public void removeNamedSequence(java.lang.String name)
Specified by:
removeNamedSequence in interface SequenceProvider

isNamedSequencesSupported

public boolean isNamedSequencesSupported()
Specified by:
isNamedSequencesSupported in interface SequenceProvider

reset

public void reset()
Specified by:
reset in interface SequenceProvider

getCurrentSequence

public long getCurrentSequence(java.lang.String name)
Specified by:
getCurrentSequence in interface SequenceProvider

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.