com.sapportals.wcm.service.taskqueue

Interface ITaskQueueReader


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.
 String getNamespace()
          Returns the namespace of this reader.
 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

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

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

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:
the top element of the task queue.
Throws:
WcmException

setState

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

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

String getUser()
Returns the user of this reader.

Returns:
Returns the user of this reader.

getNamespace

String getNamespace()
Returns the namespace of this reader.

Returns:
Returns the namespace of this reader.
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice