|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UserProcedure
Represents a user procedure, in which a user starts an action or discloses information to the network or to a server, with a limited validity period. User procedures have events that are related to the validity period or to the reception of requested information. User procedures also have update methods to change the validity period or the published or requested information. Registration, the publication of presence information, the subscription to presence information and subscription to subscription events on presence information are examples of a user procedure.
After creating a user procedure, normally additional information is set before starting the user procedure towards the network with the update() method. This applies especially to the expiration time. When a user procedure is created, the expiration time has a default of 3600 seconds. This period can be changed with the setExpirationTime() method.
Events (UserProcedureEvent.Type) indicating whether the procedure is accepted or not
are received each time the update() method is invoked.
Users of this interface must take into account that the remote end point may reduce the expiration time. In such case, after the receipt of an acknowledgment of one of the messages caused by the invocation of the update() operation, the user is able to check what the real expiration time is using getExpirationTime(). Note that there is also an event indicating that the validity period of a user procedure is about to expire.
The state machine for UserProcedure is illustrated in the following diagram:
UserProcedureEvent.Type,
CommunicationSession| Nested Class Summary | |
|---|---|
static class |
UserProcedure.State
|
| Method Summary | ||
|---|---|---|
|
addAgent(String name,
Agent<T> agent)
Set an agent instance in the communication. |
|
void |
end()
Ends the procedure. |
|
|
getAgent(String name)
Gets the agent from its name. |
|
|
getAgents()
Retrieve the agent instance pertaining to the communication. |
|
Date |
getExpirationTime()
Returns the expiration time. |
|
UserProcedureMessage |
getMessage()
Returns the message in the user procedure. |
|
UserProcedure.State |
getState()
Returns the current state of the procedure. |
|
String |
getUserId()
Returns the user who initiated the procedure. |
|
|
removeAgent(String name)
Method to remove an agent from the communication. |
|
void |
setExpirationTime(Date expires)
Sets the expiration time. |
|
void |
update()
Starts the procedure or requests a refresh or update of remote data by sending a message. |
|
| Method Detail |
|---|
String getUserId()
void update()
void end()
UserProcedure.State getState()
UserProcedureMessage getMessage()
void setExpirationTime(Date expires)
expires - expiration time as absolute time.
java.lang.InvalidArgumentException - If expiration time is not valid.
IllegalStateException - If the state is not INITIATED or ACTIVE.Date getExpirationTime()
<T> void addAgent(String name,
Agent<T> agent)
T - Type of Agent.agent - An instance of Agent.Agent<T> Collection<Agent<T>> getAgents()
T - Type of Agent being returned.
<T> Agent<T> getAgent(String name)
name - Name of the Agent
<T> Agent<T> removeAgent(String name)
T - typename - name of the agent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||