|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.queue.jdbc.XBFactoryBase org.xmlBlaster.util.queue.jdbc.XBFactory org.xmlBlaster.util.queue.jdbc.XBRefFactory
public class XBRefFactory
Field Summary | |
---|---|
private static int |
BYTE_SIZE
|
private java.lang.String |
deleteWithLimitExclSt
|
private java.lang.String |
deleteWithLimitInclSt
|
private static int |
DURABLE
|
private static int |
FLAG1
|
private java.lang.String |
getAndDeleteSt
|
private java.lang.String |
getByPrioSt
|
private java.lang.String |
getBySamePrioSt
|
private java.lang.String |
getFirstRefAndMeatEntriesStartAtSt
|
private java.lang.String |
getFirstRefEntriesStartAtSt
|
private java.lang.String |
getWithLimitSt
|
private static int |
LAST_ROW
|
private static java.util.logging.Logger |
log
|
private static int |
MEAT_ID
|
private XBMeatFactory |
meatFactory
|
private static int |
META_INFO
|
private static int |
METHOD_NAME
|
private static int |
PRIO
|
private static int |
REF_ID
|
private static int |
STORE_ID
|
Fields inherited from class org.xmlBlaster.util.queue.jdbc.XBFactory |
---|
base, countSt, createSt, deleteAllSt, deleteCompleteSt, deleteSt, deleteTransientsSt, dropSt, getAllSt, getCompleteSt, getFirstEntriesSt, getNumOfAllSt, getSt, inList, insertSt, prefix, table |
Fields inherited from class org.xmlBlaster.util.queue.jdbc.XBFactoryBase |
---|
DB2, FIREBIRD, HSQLDB, LDBC, MYSQL, ORACLE, POSTGRES, SQLITE, SQLSERVER_2000, SQLSERVER_2005, UNKNOWN |
Constructor Summary | |
---|---|
XBRefFactory(java.lang.String prefix)
|
Method Summary | |
---|---|
int |
deleteAllStore(XBStore store,
java.sql.Connection conn,
int timeout)
|
long |
deleteList(XBStore store,
java.sql.Connection conn,
XBEntry[] entries,
int maxStLength,
int maxNumSt,
boolean commitInBetween,
int timeout)
Deletes the specified entries. |
long |
deleteWithLimit(XBStore store,
java.sql.Connection conn,
XBRef limitEntry,
boolean inclusive)
deletes the first numOfEntries of the queue until the limitEntry is reached. |
protected void |
doInit(I_Info info)
|
XBRef |
get(XBStore store,
long id,
java.sql.Connection conn,
int timeout)
|
(package private) ReturnDataHolder |
getAndDeleteLowest(XBStore store,
java.sql.Connection conn,
int numOfEntries,
long numOfBytes,
int maxPriority,
long minUniqueId,
boolean leaveOne,
boolean doDelete,
int maxStLength,
int maxNumSt,
int timeout)
Under the same transaction it gets and deletes all the entries which fit into the constrains specified in the argument list. |
protected long |
getByteSize(java.sql.ResultSet rs,
int offset)
|
java.util.List<XBRef> |
getEntriesByPriority(XBStore store,
java.sql.Connection conn,
int numOfEntries,
long numOfBytes,
int minPrio,
int maxPrio,
boolean onlyId)
gets the first numOfEntries of the queue which have the priority in the range specified by prioMin and prioMax (inclusive). |
java.util.List<XBRef> |
getEntriesBySamePriority(XBStore store,
java.sql.Connection conn,
int numOfEntries,
long numOfBytes)
gets the first numOfEntries of the queue which have the same priority. |
java.util.List<XBRef> |
getFirstRefEntries(XBStore store,
java.sql.Connection conn,
long numOfEntries,
long numOfBytes,
int timeout)
|
java.util.List<XBRef> |
getFirstRefEntriesStartAt(XBStore store,
java.sql.Connection conn,
long numOfEntries,
long numOfBytes,
int timeout,
I_QueueEntry firstEntryExlusive)
|
(package private) static java.lang.String |
getName()
xbrefid NUMBER(20) primary key, xbstoreid NUMBER(20) not null, xbmeatid NUMBER(20) , xbdurable char(1) default 'F' not null , xbbytesize NUMBER(10) , xbmetainfo clob default '', xbflag1 varchar(32) default '', xbprio NUMBER(10) |
java.util.List<XBRef> |
getWithLimit(XBStore store,
java.sql.Connection conn,
XBRef limitRef)
|
void |
insert(XBRef xbRef,
java.sql.Connection conn,
int timeout)
Inserts an entry in the database |
private boolean |
isInsideRange(int numEntries,
int maxNumEntries,
long numBytes,
long maxNumBytes)
Helper method to find out if still to retrieve entries in getAndDeleteLowest or not. |
protected void |
prepareDefaultStatements()
This method must be implemented in all underlying extentions to this class. |
private java.util.List<XBRef> |
rs2List(XBStore store,
java.sql.ResultSet rs,
long numOfEntries,
long numOfBytes,
boolean onlyId)
|
protected XBRef |
rsToEntry(XBStore store,
java.sql.ResultSet rs)
|
Methods inherited from class org.xmlBlaster.util.queue.jdbc.XBFactory |
---|
checkSameStore, count, create, delete, deleteTransients, drop, fillDbCol, getDbCol, getList, getNumOfAll, init, isTrue, readStream, whereInStatement |
Methods inherited from class org.xmlBlaster.util.queue.jdbc.XBFactoryBase |
---|
getDbVendor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger log
private static final int REF_ID
private static final int STORE_ID
private static final int MEAT_ID
private static final int DURABLE
private static final int BYTE_SIZE
private static final int META_INFO
private static final int FLAG1
private static final int PRIO
private static final int METHOD_NAME
private static final int LAST_ROW
private java.lang.String getAndDeleteSt
private java.lang.String getBySamePrioSt
private java.lang.String getByPrioSt
private java.lang.String deleteWithLimitInclSt
private java.lang.String deleteWithLimitExclSt
private java.lang.String getWithLimitSt
private java.lang.String getFirstRefEntriesStartAtSt
private java.lang.String getFirstRefAndMeatEntriesStartAtSt
private XBMeatFactory meatFactory
Constructor Detail |
---|
public XBRefFactory(java.lang.String prefix)
Method Detail |
---|
static java.lang.String getName()
xbrefid NUMBER(20) primary key, xbstoreid NUMBER(20) not null, xbmeatid NUMBER(20) , xbdurable char(1) default 'F' not null , xbbytesize NUMBER(10) , xbmetainfo clob default '', xbflag1 varchar(32) default '', xbprio NUMBER(10)
protected void prepareDefaultStatements()
XBFactory
prepareDefaultStatements
in class XBFactory
protected void doInit(I_Info info) throws XmlBlasterException
doInit
in class XBFactoryBase
XmlBlasterException
public void insert(XBRef xbRef, java.sql.Connection conn, int timeout) throws java.sql.SQLException, java.io.UnsupportedEncodingException
table
- xbMeat
- The object to store. Note thatconn
- The database connection to usetimeout
- the time in seconds it has to wait for a response. If less than 1 it is not
set.
java.sql.SQLException
- If an exception occurs in the backend. For example if the entry already
exists in the database.
java.io.UnsupportedEncodingException
protected XBRef rsToEntry(XBStore store, java.sql.ResultSet rs) throws java.sql.SQLException, java.io.IOException
rsToEntry
in class XBFactory
java.sql.SQLException
java.io.IOException
public java.util.List<XBRef> getFirstRefEntries(XBStore store, java.sql.Connection conn, long numOfEntries, long numOfBytes, int timeout) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.util.List<XBRef> getFirstRefEntriesStartAt(XBStore store, java.sql.Connection conn, long numOfEntries, long numOfBytes, int timeout, I_QueueEntry firstEntryExlusive) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public XBRef get(XBStore store, long id, java.sql.Connection conn, int timeout) throws java.sql.SQLException, java.io.IOException
sql
- The select statement to use to fill the objects.conn
-
java.sql.SQLException
java.io.IOException
private final boolean isInsideRange(int numEntries, int maxNumEntries, long numBytes, long maxNumBytes)
ReturnDataHolder getAndDeleteLowest(XBStore store, java.sql.Connection conn, int numOfEntries, long numOfBytes, int maxPriority, long minUniqueId, boolean leaveOne, boolean doDelete, int maxStLength, int maxNumSt, int timeout) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
I_Queue.takeLowest(int, long,
org.xmlBlaster.util.queue.I_QueueEntry, boolean)
private java.util.List<XBRef> rs2List(XBStore store, java.sql.ResultSet rs, long numOfEntries, long numOfBytes, boolean onlyId) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.util.List<XBRef> getEntriesByPriority(XBStore store, java.sql.Connection conn, int numOfEntries, long numOfBytes, int minPrio, int maxPrio, boolean onlyId) throws java.sql.SQLException, java.io.IOException
storageId
- the storageId of the queue/storage from which to retrieve the information.numOfEntries
- the maximum number of elements to retrieve. If negative there is no constriction.numOfBytes
- the maximum number of bytes to retrieve. If negative, there is no constriction.minPrio
- the minimum priority to retreive (inclusive).maxPrio
- the maximum priority to retrieve (inclusive).
java.sql.SQLException
java.io.IOException
public java.util.List<XBRef> getWithLimit(XBStore store, java.sql.Connection conn, XBRef limitRef) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public java.util.List<XBRef> getEntriesBySamePriority(XBStore store, java.sql.Connection conn, int numOfEntries, long numOfBytes) throws java.sql.SQLException, java.io.IOException
numOfEntries
- the maximum number of elements to retrieve
java.sql.SQLException
java.io.IOException
public long deleteWithLimit(XBStore store, java.sql.Connection conn, XBRef limitEntry, boolean inclusive) throws java.sql.SQLException
numOfEntries
- the maximum number of elements to retrieve
java.sql.SQLException
public int deleteAllStore(XBStore store, java.sql.Connection conn, int timeout) throws java.sql.SQLException
java.sql.SQLException
protected long getByteSize(java.sql.ResultSet rs, int offset) throws java.sql.SQLException
getByteSize
in class XBFactory
java.sql.SQLException
public long deleteList(XBStore store, java.sql.Connection conn, XBEntry[] entries, int maxStLength, int maxNumSt, boolean commitInBetween, int timeout) throws java.sql.SQLException
deleteList
in class XBFactory
store
- the store to use.the
- connection to be used.ids
- the array containing all ids to delete.
java.sql.SQLException
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |