SAP NetWeaver '04

com.sapportals.wcm.service.taskqueue
Interface ITaskQueueReader

[contained in: com.sap.netweaver.bc.sf.service.par - bc.sf.service.taskqueue_api.jar]
public interface ITaskQueueReader

A reader provides read-acces to a task queue belonging to a specific namespace.

Copyright (c) SAP AG 2003


Method Summary
 ITask get()
          Removes the task at the top of the task queue and returns it.
 ITask get(long timeout)
          Removes the task at the top of the task queue and returns it.
 java.lang.String getNamespace()
          Returns the namespace of this reader.
 java.lang.String getUser()
          Returns the user of this reader.
 boolean isEmpty()
          Indicates if the queue still holds some tasks to process (and the get-method will return a task.
 void setState(ITask task, TaskState state)
          Sets the task's state to a new state .
 ITask top()
          Returns the top elemet of the task queue.
 

Method Detail

get

public ITask get()
          throws WcmException
Removes the task at the top of the task queue and returns it. The head-element is the first added (and currently not fetched) task with the highest priority.

The task' state (former set to NEW by a writer is set ACTIVE during this operation.

Returns:
Returns the next task to process or null if no task exists.
Throws:
WcmException - Exception raised in failure situation

get

public ITask get(long timeout)
          throws WcmException
Removes the task at the top of the task queue and returns it. The head-element is the first added (and currently not fetched) task with the highest priority.

This method returns when a task is found in the queue or a timeout delay is reached. The task' state (former set to NEW by a writer is set ACTIVE during this operation.

Parameters:
timeout - The timeout delay in ms. If timeout is 0 the method behaves like get(). When set to a negative value it will never timeout.
Returns:
Returns the next task to process or null if no task exists.
Throws:
WcmException - Exception raised in failure situation
See Also:
get()

top

public ITask top()
          throws WcmException
Returns the top elemet of the task queue. The head-element is the first added (and currently not fetched) task with the highest priority.

Returns:
 

setState

public void setState(ITask task,
                     TaskState state)
              throws WcmException
Sets the task's state to a new state . The task must belong to the reader's namespace. The new state must be a legal transition of the old state (see ITask.getState()) for details.

Interactive users of the taskqueue service are only allowed to set the state to TaskState.DONE and TaskState.ERROR. Other states are set by the task queue service.

Parameters:
state - The state to set.
task - The task to set the state.
Throws:
WcmException - Exception raised in failure situation

isEmpty

public boolean isEmpty()
Indicates if the queue still holds some tasks to process (and the get-method will return a task.
Returns:
Indicates if the queue still holds some tasks to process.

getUser

public java.lang.String getUser()
Returns the user of this reader.
Returns:
Returns the user of this reader.

getNamespace

public java.lang.String getNamespace()
Returns the namespace of this reader.
Returns:
Returns the namespace of this reader.

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.