com.sapportals.wcm.service.taskqueue

Interface ITaskQueueWriter


public interface ITaskQueueWriter

A writer provides write-acces to a task queue belonging to a specific namespace. In addition, it acts as a validating factory for tasks.


Method Summary
 ITask add(ITask task)
          Adds an entry to the end of the queue.
 ITask createTask()
          Factory method to create task objects.
 ITask createTask(Properties properties)
          Factory method to create task objects.
 ITask createTask(Properties properties, String description)
          Factory method to create task objects.
 ITask createTask(Properties properties, String description, int priority)
          Factory method to create task objects.
 String getNamespace()
          Returns the namespace of this writer.
 String getUser()
          Returns the user of this writer.
 void setState(ITask task, TaskState state)
          Sets the task's state to a new state .
 

Method Detail

add

ITask add(ITask task)
          throws WcmException
Adds an entry to the end of the queue. Raises an excpetion if the entry is already added to the queue.

The task' state is set NEW during this operation. According to the persistence layer a correct task id will be created.

Parameters:
task - The task to add
Throws:
WcmException - raised in failure situation

setState

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

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

createTask

ITask createTask()
                 throws WcmException
Factory method to create task objects. Constructs a task object with correct settings for user, namespace, date of creation, priortiy set to normal.

Returns:
A task belonging to the writer's namespace.
Throws:
WcmException - Exception raised in failure situation

createTask

ITask createTask(Properties properties)
                 throws WcmException
Factory method to create task objects. Adds a set of properties to the task. Only string values are allowed as property values.

Parameters:
properties - Adds a set of properties to the task.
Returns:
The created task
Throws:
WcmException - Exception raised in failure situation
See Also:
createTask()

createTask

ITask createTask(Properties properties,
                 String description)
                 throws WcmException
Factory method to create task objects. Adds a short descritption description to the task. The description string may be null .

Parameters:
properties - Adds a set of properties to the task.
description - Adds a short descritption description to the task.
Returns:
The created task
Throws:
WcmException - Exception raised in failure situation
See Also:
createTask(Properties)

createTask

ITask createTask(Properties properties,
                 String description,
                 int priority)
                 throws WcmException
Factory method to create task objects. Sets a priority priority value to the task. The priory value must lie between 0 and 100.

Parameters:
properties - Adds a set of properties to the task.
description - Adds a short descritption description to the task.
priority - The priority value that affect the processing order of tasks.
Returns:
The created task
Throws:
WcmException - Exception raised in failure situation
See Also:
createTask(Properties,String)

getUser

String getUser()
Returns the user of this writer.

Returns:
Returns the user of this writer.

getNamespace

String getNamespace()
Returns the namespace of this writer.

Returns:
Returns the namespace of this writer.
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