|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.rees.scope.conversation.ConversationUtil
public class ConversationUtil
Provides static methods intended primarily for use internally and in unit testing. Use outside of these contexts should come only as a last resort.
| Constructor Summary | |
|---|---|
ConversationUtil()
|
|
| Method Summary | ||
|---|---|---|
static ConversationContext |
begin(String name,
ConversationAdapter adapter,
long maxIdleTimeMillis)
A convenience method for beginning a conversation programmatically |
|
static ConversationContext |
begin(String name,
long maxIdleTimeMillis)
A convenience method for beginning a conversation programmatically |
|
static ConversationContext |
end(String name)
A convenience method for ending a conversation programmatically. |
|
static ConversationContext |
end(String name,
ConversationAdapter adapter)
A convenience method for ending a conversation programmatically. |
|
static ConversationContext |
getContext(String name)
Given the conversation name, returns that conversation's context for the current request. |
|
static String[] |
getConversations()
An array of all active conversations for the current request. |
|
static Object |
getField(String fieldName)
Given a conversation field's name, the value of the field is returned from a conversation map in the current thread. |
|
static
|
getField(String fieldName,
Class<T> fieldClass)
Given a conversation field's name and class, the value of the field is returned from a conversation map in the current thread. |
|
static
|
getField(String fieldName,
Class<T> fieldClass,
String[] conversations)
Given a conversation field's name and class and an Array of conversation names, the value of the field is returned from the first conversation in the Array that contains an instance of the field. |
|
static String |
getId(String conversationName)
Given a conversation name, returns the ID of the conversation for the currently executing thread. |
|
static String[] |
getIds()
Returns an array of all the conversation IDs on the current request |
|
static ConversationContext |
persist(String name)
Persist a conversation programmatically |
|
static ConversationContext |
persist(String name,
ConversationAdapter adapter)
Persist a conversation programmatically |
|
static String |
sanitizeName(String conversationName)
Used to remove undesired characters from conversation names |
|
static void |
setField(String fieldName,
Object fieldValue)
Given a conversation field's name and an instance, the value is set for the field in all active conversations of which the field is a member. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConversationUtil()
| Method Detail |
|---|
public static String getId(String conversationName)
conversationName -
public static Object getField(String fieldName)
fieldName -
public static <T> T getField(String fieldName,
Class<T> fieldClass)
T - fieldName - fieldClass -
public static <T> T getField(String fieldName,
Class<T> fieldClass,
String[] conversations)
T - fieldName - fieldClass - conversations -
public static void setField(String fieldName,
Object fieldValue)
fieldName - fieldValue -
public static ConversationContext begin(String name,
long maxIdleTimeMillis)
name - maxIdleTimeMillis -
public static ConversationContext begin(String name,
ConversationAdapter adapter,
long maxIdleTimeMillis)
name - adapter - maxIdleTimeMillis -
public static ConversationContext persist(String name)
name -
ConversationContext or null if the
conversation is not active
public static ConversationContext persist(String name,
ConversationAdapter adapter)
name -
ConversationContext or null if the
conversation is not activepublic static ConversationContext end(String name)
name -
ConversationContext or null if the
conversation is not active
public static ConversationContext end(String name,
ConversationAdapter adapter)
name -
ConversationContext or null if the
conversation is not activepublic static ConversationContext getContext(String name)
name -
ConversationContext or null if the
conversation is not activepublic static String[] getConversations()
public static String[] getIds()
public static String sanitizeName(String conversationName)
conversationName -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||