com.ibm.workflow.portlet.client
Class RegistrationMap

java.lang.Object
  |
  +--com.ibm.workflow.portlet.client.RegistrationMap

public class RegistrationMap
extends java.lang.Object

The RegistrationMap for keeping track of the various user portlet instances of a user. REMARK: This class is far from complete. - The entry class should probably be a top level class. - the protocoll as describe in the design docuemnt is not yet fully implemented. - at the moment modifying a Entry involves fetching a whole Entry with getEntry and modifying this instance subsequently. It might be useful have more specialized method for altering certain parts of an entry. Refrained from making extended javadoc comments as this class will be probably reorganized.


Inner Class Summary
static class RegistrationMap.Entry
          REMARK : Should be made a top level class in my opinion (Andreas) Should the constants also be stored in this class instead of in RegistrationMap !?
 
Field Summary
static int ACTION_TYPE
           
static int ACTIVE_STATUS
           
static int FREE_STATUS
           
static int LIST_TYPE
           
static int LOGON_FAILED
          If logon failed for an instance, the status is set to LOGON_FAILED
static int LOGON_NOT_ATTEMPTED
          Default value for the logon status
static int LOGOUT_DONE
          Does signal that the user has been logged out.
static int LOGOUT_FAILED
          If a Client Exception is thrown during a logoff the LOGON status is set to this constant.
static int PAGE_ID_NOT_YET_SET
           
static int SEND_STATUS
           
static java.util.HashMap traceLookupMap
           
 
Constructor Summary
RegistrationMap()
           
 
Method Summary
 java.util.Enumeration getAvailablePortlets(int type)
          Returns all instances of a certain type which are not processing a workflow request.
 java.util.Enumeration getAvailablePortletsOnPage(RegistrationMap.Entry pageEntry, int type)
          Returns all instances of a certain type in a certain page which are not processing a workflow request.
 RegistrationMap.Entry getEntry(java.lang.String userPortletInstanceId)
           
 RegistrationMap.Entry getFirstAvailablePortlet(int type)
          Returns the first instance of the given type which is available.
 RegistrationMap.Entry getFirstAvailablePortletOnPage(RegistrationMap.Entry pageEntry, int type, java.lang.String actionType)
          Returns the first instance of the given type on the page of the instance which is represented through pageEntry.
 int getLogonStatus()
          Returns the logon status as defined by the integer constants in this class.
static java.lang.String getTraceString(int number)
          Convert the number to a more meaningful string used for tracing
static void putTraceString(int number, java.lang.String text)
          Convenience method for adding the describing texts for the constants below
 void registerUserPortletInstance(java.lang.String userPortletInstanceId, int workflowType, int status, int pageId, com.ibm.workflow.portlet.client.RequestPreferences preferences)
          QUESTION: Does this method name make sense.
 boolean removeEntry(java.lang.String userPortletInstanceId)
          Returns true if empty
 void setLogonStatus(int status)
          Does set the logon status as defined by the integer constants in this class
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGON_NOT_ATTEMPTED

public static final int LOGON_NOT_ATTEMPTED
Default value for the logon status

LOGON_FAILED

public static final int LOGON_FAILED
If logon failed for an instance, the status is set to LOGON_FAILED

LOGOUT_DONE

public static final int LOGOUT_DONE
Does signal that the user has been logged out. Other instances are not required to log out too.

LOGOUT_FAILED

public static final int LOGOUT_FAILED
If a Client Exception is thrown during a logoff the LOGON status is set to this constant. No instance will attempt to logout after that had happened any more

ACTION_TYPE

public static final int ACTION_TYPE

LIST_TYPE

public static final int LIST_TYPE

FREE_STATUS

public static final int FREE_STATUS

SEND_STATUS

public static final int SEND_STATUS

ACTIVE_STATUS

public static final int ACTIVE_STATUS

PAGE_ID_NOT_YET_SET

public static final int PAGE_ID_NOT_YET_SET

traceLookupMap

public static final java.util.HashMap traceLookupMap
Constructor Detail

RegistrationMap

public RegistrationMap()
Method Detail

registerUserPortletInstance

public void registerUserPortletInstance(java.lang.String userPortletInstanceId,
                                        int workflowType,
                                        int status,
                                        int pageId,
                                        com.ibm.workflow.portlet.client.RequestPreferences preferences)
QUESTION: Does this method name make sense.

getEntry

public RegistrationMap.Entry getEntry(java.lang.String userPortletInstanceId)

removeEntry

public boolean removeEntry(java.lang.String userPortletInstanceId)
Returns true if empty

getAvailablePortlets

public java.util.Enumeration getAvailablePortlets(int type)
Returns all instances of a certain type which are not processing a workflow request.
Parameters:
type - as defined in RegistrationMap.
Returns:
enumeration of all instances that satisfy the criteria.

getAvailablePortletsOnPage

public java.util.Enumeration getAvailablePortletsOnPage(RegistrationMap.Entry pageEntry,
                                                        int type)
Returns all instances of a certain type in a certain page which are not processing a workflow request.
Parameters:
pageEntry - The instance of this entry determines the page.
type - The type of instances as defined in RegistrationMap
Returns:
enumeration of all the instances that statisfy the criterias.

getFirstAvailablePortlet

public RegistrationMap.Entry getFirstAvailablePortlet(int type)
Returns the first instance of the given type which is available.
Returns:
The instance or null.

getFirstAvailablePortletOnPage

public RegistrationMap.Entry getFirstAvailablePortletOnPage(RegistrationMap.Entry pageEntry,
                                                            int type,
                                                            java.lang.String actionType)
Returns the first instance of the given type on the page of the instance which is represented through pageEntry.
Returns:
The not occupied instance or null.

getLogonStatus

public int getLogonStatus()
Returns the logon status as defined by the integer constants in this class.
Returns:
the logon status

setLogonStatus

public void setLogonStatus(int status)
Does set the logon status as defined by the integer constants in this class
Parameters:
the - logon status

getTraceString

public static java.lang.String getTraceString(int number)
Convert the number to a more meaningful string used for tracing
Parameters:
number - as defined below
Returns:
the describing text

putTraceString

public static void putTraceString(int number,
                                  java.lang.String text)
Convenience method for adding the describing texts for the constants below
Parameters:
number - as defined as integer constant below
text - the describing text used for tracing


© Copyright IBM Corporation 2002, 2008. All Rights Reserved.