SAP NetWeaver '04

com.sapportals.wcm.service.taskqueue
Interface ITaskQueueService

[contained in: com.sap.netweaver.bc.sf.service.par - bc.sf.service.taskqueue_api.jar]
All Superinterfaces:
IService

public interface ITaskQueueService
extends IService

The task queue is a base service for clustered systems.

It provides interfaces to write and to read tasks in a platform-spreading queue and to monitor the tasks and (above all) their processing state.

Access to the task queue is provided by a ITaskQueueReader and a ITaskQueueWriter interface. This thin interfaces support the implementation of highly spezialised and customizable distributed services. (For example a service could implement a customized service writer as a wrapper of the task queue writer and a customized service daemon reader as a wrapper of the reader).

Reader and writer are assigned to a special namespace and a service user. A writer can only write tasks belonging to its namespace. A reader can only read task of its namespace. A namespace is a unique application identifier.

A task queue consists of a list (a sequence) of tasks. The tasks can be added to and removed from the list on a priority basis (lowest priority values first, first-in-first-out (FIFO) basis within priority).

This services provides support of different persistence layers. It is recommended to use the database persistence layer in production systems. File system and memory persistence layers are only recommended for testing to offer a high-performance test plattform with some restrictions.

The monitor methods will return only a snapshot of the current task queue. For maintenance a remove method is provided to remove completly progressed or incorrectly aborted tasks from the queue.


Field Summary
static java.lang.String TASKQUEUE_SERVICE
          identifier for TaskQueue Service
 
Method Summary
 ITaskQueueReader getTaskQueueReader(java.lang.String user, java.lang.String namespace)
          Returns a task queue reader for read acccess to the queue service.
 ITaskQueueWriter getTaskQueueWriter(java.lang.String user, java.lang.String namespace)
          Returns a task queue writer for write acccess to the queue service.
 ITask monitorTask(java.lang.String id)
          Returns a task with id id
 ITaskQueueIterator monitorTaskQueue(java.lang.String namespace)
          Returns an iterator for tasks belonging to service .
 ITaskQueueIterator monitorTaskQueue(TaskState state)
          Returns an iterator for tasks that have task state state .
 ITaskQueueIterator monitorTaskQueues()
          Returns an iterator for all queued tasks.
 boolean removeTask(ITask task)
          Removes a task that is queued by this service.
 
Methods inherited from interface com.sapportals.wcm.service.IService
getDescription, getDescription, getID
 

Field Detail

TASKQUEUE_SERVICE

public static final java.lang.String TASKQUEUE_SERVICE
identifier for TaskQueue Service
Method Detail

getTaskQueueWriter

public ITaskQueueWriter getTaskQueueWriter(java.lang.String user,
                                           java.lang.String namespace)
                                    throws WcmException
Returns a task queue writer for write acccess to the queue service.
Parameters:
user - The user of this interface
namespace - The namespace this writer is assigned to.
Returns:
A new task queue writer.
Throws:
WcmException - Exception raised in failure situation

getTaskQueueReader

public ITaskQueueReader getTaskQueueReader(java.lang.String user,
                                           java.lang.String namespace)
                                    throws WcmException
Returns a task queue reader for read acccess to the queue service.
Parameters:
user - The user of this interface
namespace - The namespace this reader is assigned to.
Returns:
A new task queue reader.
Throws:
WcmException - Exception raised in failure situation

monitorTaskQueue

public ITaskQueueIterator monitorTaskQueue(java.lang.String namespace)
                                    throws WcmException
Returns an iterator for tasks belonging to service . This is a snapshot of the current task queue. It does not change during time.
Parameters:
namespace - The namespace to monitor
Returns:
An iterator that includes the snapshot.
Throws:
WcmException - Exception raised in failure situation

monitorTaskQueue

public ITaskQueueIterator monitorTaskQueue(TaskState state)
                                    throws WcmException
Returns an iterator for tasks that have task state state . This is a snapshot of the current task queue. It does not change during time.
Parameters:
state - The state to monitor
Returns:
An iterator that includes the snapshot.
Throws:
WcmException - Exception raised in failure situation

monitorTask

public ITask monitorTask(java.lang.String id)
                  throws WcmException
Returns a task with id id

monitorTaskQueues

public ITaskQueueIterator monitorTaskQueues()
                                     throws WcmException
Returns an iterator for all queued tasks. This is a snapshot of the current task queue. It does not change during time.
Returns:
The total queued tasks.
Throws:
WcmException - Exception raised in failure situation

removeTask

public boolean removeTask(ITask task)
                   throws WcmException
Removes a task that is queued by this service. The task to remove must have been processed (task state was set to TaskState.DONE or TaskState.ERROR).
Parameters:
task - The task to remove
Returns:
indicates if the task was removed (if it was contained in the queue service)
Throws:
WcmException - Raised on illegal task states, persistence failures,...

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.