public static long nextID(int type) {
        if (managers.containsKey(type)) {
            return managers.get(type).nextUniqueID();
        }
        else {
            // Verify type is valid from the db, if so create an instance for the type
            // And return the next unique id
            SequenceManager manager = new SequenceManager(type, 1);
            return manager.nextUniqueID();
        }
    }
Returns the next ID of the specified type.

@param type the type of unique ID.
@return the next unique ID of the specified type.
xmppserver/src/main/java/org/jivesoftware/database/SequenceManager.java