|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.tn.db.DeliveryStore
public class DeliveryStore
API for registering/unregistering delivery service definitions and job entries in the shared database.
Constructor Summary | |
---|---|
DeliveryStore()
|
Method Summary | |
---|---|
static boolean |
activeJobs()
|
static boolean |
deleteJob(java.lang.String job_id)
Remove a job from the database. |
static int |
deleteJobs(DeliveryJobQuery query)
Delete jobs from the table via a query. |
static boolean |
deleteService(java.lang.String svc_nm)
Remove a service from the database. |
static int |
deleteServices(DeliveryServiceQuery query)
Delete services from the table via a query. |
static GuaranteedJob |
dequeueOldestJob(java.lang.String queue)
Dequeues the oldest job on a virtual delivery queue. |
static GuaranteedJob[] |
dequeueOldestJobs(java.lang.String queue,
int jobCount)
Dequeues jobCount no. |
static java.util.Hashtable |
getActiveJobs()
Get all active jobs (PENDING or NEW). |
static java.util.List |
getAllPendingServerIds(java.lang.String partnerID)
This method will get all the serverID's from DeliveryJob tab in which the partnerId is same as the one specified and the job status is 'PENDING' |
static GuaranteedJob |
getAnyJob(java.lang.String id,
boolean content)
Get any job info from any server. |
static java.util.Hashtable |
getDbUpdateFailedJobs()
For internal use only |
static long |
getDbUpdateRetrySweepTime()
For internal use only |
static GuaranteedJob |
getJob(java.lang.String id,
boolean content)
Get a job on this server. |
static java.lang.Object[] |
getOrderedActiveJobs()
Get all active jobs (PENDING or NEW) ordered by creation time. |
static DeliveryService |
getService(java.lang.String name)
Get service info. |
static void |
init(java.lang.String serverId,
boolean force)
Fills the cache of service definitions and outstanding jobs. |
static boolean |
insertJob(GuaranteedJob j)
Insert a new delivery job into the database. |
static boolean |
insertService(DeliveryService s)
Insert a new service definition into the database. |
static boolean |
isDbUpdateNotifyRetries()
For internal use only |
static boolean |
isDbUpdateRetryEnabled()
For internal use only |
static java.lang.String[] |
listActiveJobs()
Returns a list of the job IDs of all ACTIVE delivery jobs marked for this server. |
static java.lang.String[] |
listJobs()
Returns a list of the job IDs of all delivery jobs marked for this server. |
static java.lang.String[] |
listServices()
Returns a list of the immediate delivery services defined. |
static java.lang.String[] |
listServices(int type)
Returns the names of the registered delivery services. |
static int |
numActiveJobs()
|
static com.wm.data.IData |
queryJobs(DeliveryJobQuery query,
int pageSize,
int maxRowCount,
int queryTimeout,
int threshold,
java.lang.String queryId)
Get job information via a query. |
static com.wm.data.IData |
queryServices(DeliveryServiceQuery query,
int pageSize,
int maxRowCount,
int queryTimeout,
int threshold,
java.lang.String queryId)
Get service information via a query. |
static void |
refreshJobCache()
Refresh the job cache due to updates in the DB (useful when in a cluster). |
static void |
refreshServiceCache()
Refresh the service cache due to updates in the DB (useful when in a cluster). |
static void |
setDbUpdateNotifyRetries(java.lang.String enabled)
For internal use only |
static void |
setDbUpdateRetryEnabled(java.lang.String enabled)
For internal use only |
static void |
setDbUpdateRetrySweepTime(java.lang.String seconds)
For internal use only |
static void |
setUpdaterThreadStarted(boolean flag)
For internal use only |
static void |
startJobUpdaterThread()
For internal use only |
static boolean |
updateJob(GuaranteedJob j)
Update a job in the database. |
static boolean |
updateService(DeliveryService s)
Update a service in the database. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DeliveryStore()
Method Detail |
---|
public static void init(java.lang.String serverId, boolean force) throws DatastoreException
serverId
- the ID of this server (used to fetch outstanding job information)force
- forces re-initialization if this method has already been called
DatastoreException
- if a database error prevents the fetchpublic static boolean activeJobs()
public static int numActiveJobs()
public static java.util.Hashtable getDbUpdateFailedJobs()
public static void setDbUpdateRetryEnabled(java.lang.String enabled)
public static boolean isDbUpdateRetryEnabled()
public static void setDbUpdateRetrySweepTime(java.lang.String seconds)
public static long getDbUpdateRetrySweepTime()
public static void setDbUpdateNotifyRetries(java.lang.String enabled)
public static boolean isDbUpdateNotifyRetries()
public static void setUpdaterThreadStarted(boolean flag)
public static void startJobUpdaterThread()
public static java.lang.String[] listJobs()
public static java.lang.String[] listActiveJobs()
public static java.lang.String[] listServices(int type)
type
- which type of DelvieryServices to return. Must be one of the TYPE values defined in the
DeliveryService class.
DeliveryService
public static java.lang.String[] listServices()
public static DeliveryService getService(java.lang.String name)
name
- the name of the service to fetch
public static boolean insertService(DeliveryService s) throws DatastoreException
s
- the delivery service to be added
DatastoreException
- if a database error prevented the insertpublic static boolean updateService(DeliveryService s) throws DatastoreException
s
- the service being updated
DatastoreException
- if a database error prevented the updatepublic static boolean deleteService(java.lang.String svc_nm) throws DatastoreException
svc_nm
- the name of the service to delete
DatastoreException
- if a database error prevented the updatepublic static com.wm.data.IData queryServices(DeliveryServiceQuery query, int pageSize, int maxRowCount, int queryTimeout, int threshold, java.lang.String queryId) throws DatastoreException, java.io.IOException, com.wm.app.repo.RepositoryException, com.wm.app.b2b.server.ServiceException
query
- the delivery service query to satisfypageSize
- the number of rows per page; specify -1 to disable pagingmaxRowCount
- the maximum number of rows to return -- excess rows will be silently dropped. 0 means
unlimitedqueryTimeout
- the maximum number of seconds to wait for the query to return. 0 means unlimited.threshold
- the number of rows to be stored in the session object; this allows you to override the
tn.query.threshold parameter in properties.cnf. In a cluster, this should be disabled by setting it to -1. If the
value is set to -1, its value from tn.query.threshold parameter in properties.cnfqueryId
- specifies the unique identifier to store the paged query results. This is applicable only when the
results are paged. If this value is not set, an Id is automatically generated
DatastoreException
- if a database exception prevents getting the query results
java.io.IOException
com.wm.app.repo.RepositoryException
com.wm.app.b2b.server.ServiceException
public static int deleteServices(DeliveryServiceQuery query) throws DatastoreException
query
- all delivery services satisfying this query will be deleted
DatastoreException
- if a database exception prevents the deletepublic static java.util.Hashtable getActiveJobs()
public static java.lang.Object[] getOrderedActiveJobs()
public static GuaranteedJob getAnyJob(java.lang.String id, boolean content)
id
- the id of the job to fetchcontent
- indicate whether or not to retrieve the content of the associated bizdoc
public static GuaranteedJob getJob(java.lang.String id, boolean content)
id
- the id of the job to fetchcontent
- indicate whether or not to retrieve the content of the associated bizdoc
public static boolean insertJob(GuaranteedJob j) throws DatastoreException
j
- the delivery job to be added
DatastoreException
- if a database error prevented the insertpublic static boolean updateJob(GuaranteedJob j) throws DatastoreException
j
- the job being updated
DatastoreException
- if a database error prevented the updatepublic static GuaranteedJob dequeueOldestJob(java.lang.String queue) throws DeliveryException
queue
- the virtual queue to dequeue from
com.wm.app.tn.db.DeliveryException
- if a database error prevented the operation
DeliveryException
public static GuaranteedJob[] dequeueOldestJobs(java.lang.String queue, int jobCount)
queue
- the virtual queue to dequeue from
com.wm.app.tn.db.DeliveryException
- if a database error prevented the operationpublic static boolean deleteJob(java.lang.String job_id) throws DatastoreException
job_id
- the id of the job to delete
DatastoreException
- if a database error prevented the updatepublic static com.wm.data.IData queryJobs(DeliveryJobQuery query, int pageSize, int maxRowCount, int queryTimeout, int threshold, java.lang.String queryId) throws DatastoreException, java.io.IOException, com.wm.app.repo.RepositoryException, com.wm.app.b2b.server.ServiceException
query
- the delivery job query to satisfypageSize
- the number of rows per page; specify -1 to disable pagingmaxRowCount
- the maximum number of rows to return -- excess rows will be silently dropped. 0 means
unlimitedqueryTimeout
- the maximum number of seconds to wait for the query to return. 0 means unlimited.threshold
- the number of rows to be stored in the session object; this allows you to override the
tn.query.threshold parameter in properties.cnf. In a cluster, this should be disabled by setting it to -1. If the
value is set to -1, its value from tn.query.threshold parameter in properties.cnfqueryId
- specifies the unique identifier to store the paged query results. This is applicable only when the
results are paged. If this value is not set, an Id is automatically generated
DatastoreException
- if a database exception prevents getting the query results
java.io.IOException
com.wm.app.repo.RepositoryException
com.wm.app.b2b.server.ServiceException
public static int deleteJobs(DeliveryJobQuery query) throws EXMLException
query
- all delivery jobs satisfying this query will be deleted
DatastoreException
- if a database exception prevents the delete
EXMLException
public static void refreshJobCache() throws DatastoreException
DatastoreException
- if a database exception prevents the refreshpublic static void refreshServiceCache() throws DatastoreException
DatastoreException
- if a database exception prevents the refreshpublic static java.util.List getAllPendingServerIds(java.lang.String partnerID) throws java.sql.SQLException
partnerID
- Id of the partner to serarch
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |