com.ptc.windchill.cadx.common.pageBuilder
Class QueueAbleActionHelper

java.lang.Object
  extended bycom.ptc.windchill.cadx.common.pageBuilder.QueueAbleActionHelper

public class QueueAbleActionHelper
extends Object

This class provides utility methods to create action queues, put action in queues and list actions that are in queues.


Field Summary
private static String BACKGROUND_ACTION_METHOD
           
private static String CADX_MANAGER_QUEUE
           
private static String CADX_OTHERS_QUEUE
           
private static String CADX_QUEUE
           
private static Map finishedActions
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
Constructor Summary
QueueAbleActionHelper()
           
 
Method Summary
private static QueueEntry addEntryToQueue(ProcessingQueue queue, WTPrincipal principal, String targetMethod, String targetClass, QueueAbleAction action)
           
static void addToFinishedActions(String actionId, QueueAbleAction action)
           
static String executeActionInBackground(QueueAbleAction action)
           
static void executeInQueue(QueueAbleAction action)
          This method is the method that is called by the queue services to start the action This method is not to be called by any other API then the queue services.
private static Vector filterUserQueueEntries(WTPrincipal principal, Enumeration entries)
           
private static String getActionQueueName(QueueAbleAction action)
          TODO: the code below should be removed when implementing one queue per user
static Enumeration getCurrentUserQueueActions()
           
static QueueAbleAction getFinishedAction(String actionId)
           
private static Vector getQueueEntries(String queueName, WTPrincipal user)
           
static QueueEntry getQueueEntry(String actionId)
           
static QueueAbleAction getQueueEntryAction(QueueEntry entry)
           
private static Enumeration getUserQueueEntries(WTPrincipal user)
           
static boolean isActionFinished(String actionId)
           
static void removeFinishedAction(String actionId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CADX_QUEUE

private static final String CADX_QUEUE
See Also:
Constant Field Values

BACKGROUND_ACTION_METHOD

private static final String BACKGROUND_ACTION_METHOD
See Also:
Constant Field Values

CADX_MANAGER_QUEUE

private static final String CADX_MANAGER_QUEUE
See Also:
Constant Field Values

CADX_OTHERS_QUEUE

private static final String CADX_OTHERS_QUEUE
See Also:
Constant Field Values

finishedActions

private static Map finishedActions

VERBOSE

private static boolean VERBOSE
Constructor Detail

QueueAbleActionHelper

public QueueAbleActionHelper()
Method Detail

executeActionInBackground

public static String executeActionInBackground(QueueAbleAction action)
                                        throws WTException
Throws:
WTException

executeInQueue

public static void executeInQueue(QueueAbleAction action)
This method is the method that is called by the queue services to start the action This method is not to be called by any other API then the queue services.

Parameters:
action - - the action to run

addEntryToQueue

private static QueueEntry addEntryToQueue(ProcessingQueue queue,
                                          WTPrincipal principal,
                                          String targetMethod,
                                          String targetClass,
                                          QueueAbleAction action)
                                   throws WTException
Throws:
WTException

getQueueEntryAction

public static QueueAbleAction getQueueEntryAction(QueueEntry entry)

getQueueEntry

public static QueueEntry getQueueEntry(String actionId)
                                throws WTException
Throws:
WTException

getCurrentUserQueueActions

public static Enumeration getCurrentUserQueueActions()
                                              throws WTException
Throws:
WTException

addToFinishedActions

public static void addToFinishedActions(String actionId,
                                        QueueAbleAction action)

isActionFinished

public static boolean isActionFinished(String actionId)

getFinishedAction

public static QueueAbleAction getFinishedAction(String actionId)

removeFinishedAction

public static void removeFinishedAction(String actionId)

getActionQueueName

private static String getActionQueueName(QueueAbleAction action)
TODO: the code below should be removed when implementing one queue per user


getUserQueueEntries

private static Enumeration getUserQueueEntries(WTPrincipal user)
                                        throws WTException
Throws:
WTException

getQueueEntries

private static Vector getQueueEntries(String queueName,
                                      WTPrincipal user)
                               throws WTException
Throws:
WTException

filterUserQueueEntries

private static Vector filterUserQueueEntries(WTPrincipal principal,
                                             Enumeration entries)
                                      throws WTException
Throws:
WTException