|
Oracle Application Server Wireless Java API Reference B14043-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Location Event Agent class. The agent is used to activate/deactivate location based conditions, check whehter a specific condition is satisfied and process the incoming location based event by starting the location event listeners. When a location event listener receives a location based event, it invokes the location event handler to process the event.
oracle.panana.lbevent.LBEventHandler
Field Summary | |
static int |
MAX_AGENT_NAME_LEN The maximum length of the name of an agent. |
static java.lang.String |
RESULT_CONDITION_DELETED If a condition evluation result is RESULT_CONDITION_DELETED , it means the condition has been deleted. |
static java.lang.String |
RESULT_INVALIDMSID If a condition evaluation result is RESULT_INVALIDMSID , it means at least one target's MSID can not be recoginized by any of the working MP provider in the system. |
static java.lang.String |
RESULT_INVALIDREGIONID If a condition evluation result is RESULT_INVALIDREGIONID , it means at least one region id in the condition can not be recoginized by the system. |
static java.lang.String |
RESULT_NOT_AVAILABLE If a condition evaluation result is RESULT_NOT_AVAILABLE , it means the location event server has not generated the evaluation result for the condition. |
static java.lang.String |
RESULT_NOT_SATISFIED If a condition evaluation result is RESULT_NOT_SATISFIED , it means that the condition associated with the event is not satisfied. |
static java.lang.String |
RESULT_PRIVACYCHECK_FAILED If a condition evaluation result is RESULT_PRIVACYCHECK_FAILED , it means the condition associated with the event is no longer evaluated because the condition does not pass the location privacy checking. |
static java.lang.String |
RESULT_SATISFIED If the result is RESULT_STATISFIED , it means the condition associated with the event is satisfied. |
static java.lang.String |
RESULT_USER_SUSPENDED If a condition evaluation result is RESULT_USER_SUSPENDED , it means the location based condition is suspended because the creator or one of the target users is suspended. |
Method Summary | |
void |
activateCondition(LBCondition condition, java.lang.String evalMode, java.util.Calendar exprTime, java.lang.String recipient, boolean silent) activate a LBCondition. |
java.lang.String |
checkStatusNoWait(LBCondition condition) Check whether the condition is satisfied or not using the default tolerance. |
java.lang.String |
checkStatusNoWait(LBCondition condition, int tolerance) Check whether the condition is satisfied or not. |
void |
deActivateCondition(LBCondition condition) deactivate a condition. |
boolean |
isActive() Test whether the agent is still active. |
java.lang.String |
isSatisfied(LBCondition condition) Check whether the condition is satisfied or not using the default tolerance. |
java.lang.String |
isSatisfied(LBCondition condition, int tolerance) Check whether the condition is satisfied or not. |
void |
registerLBEventHandler(LBEventHandler handler) Register a handler to handle the location based event. |
void |
startListenerThread() Start listener threads to listen to the location based events using the default number of listeners. |
void |
startListenerThread(int numberOfThreads) Start listener threads to listen to the location based events. |
void |
stopListenerThread() Stop all the listener threads of this agent |
void |
terminate() terminate an agent. |
Field Detail |
public static final int MAX_AGENT_NAME_LEN
public static final java.lang.String RESULT_CONDITION_DELETED
RESULT_CONDITION_DELETED
, it means the condition has been deleted. This can happen when the one or more objects referred by this condition are deleted.
public static final java.lang.String RESULT_INVALIDMSID
RESULT_INVALIDMSID
, it means at least one target's MSID can not be recoginized by any of the working MP provider in the system. The MSID may be an invalid one or the provider that can process this MSID is down.
public static final java.lang.String RESULT_INVALIDREGIONID
RESULT_INVALIDREGIONID
, it means at least one region id in the condition can not be recoginized by the system.
public static final java.lang.String RESULT_NOT_AVAILABLE
RESULT_NOT_AVAILABLE
, it means the location event server has not generated the evaluation result for the condition. This result may be returned when the no wait pull query is issued and the server does not have a result ready.
public static final java.lang.String RESULT_NOT_SATISFIED
RESULT_NOT_SATISFIED
, it means that the condition associated with the event is not satisfied.
public static final java.lang.String RESULT_PRIVACYCHECK_FAILED
RESULT_PRIVACYCHECK_FAILED
, it means the condition associated with the event is no longer evaluated because the condition does not pass the location privacy checking.
public static final java.lang.String RESULT_SATISFIED
RESULT_STATISFIED
, it means the condition associated with the event is satisfied.
public static final java.lang.String RESULT_USER_SUSPENDED
RESULT_USER_SUSPENDED
, it means the location based condition is suspended because the creator or one of the target users is suspended.
Method Detail |
public void activateCondition(LBCondition condition, java.lang.String evalMode, java.util.Calendar exprTime, java.lang.String recipient, boolean silent) throws LBEventException
condition
- the condition to be activatedevalMode
- the evaluation mode for this activation. If evalMode is null, the default evaluation mode is used. If evalMode is null and default evaluation mode is not set, an IllegalArgumentException is thrown.exprTime
- the expiration time for this evaluation. If the evalMode is LBCondition.MODE_REPEAT either exprTime or the default expiration time for the condition should be set, otherwise an IllegalArgumentException is thrown.recipient
- the name of the recipient agentsilent
- if silent is true, the evaluation of this condition does not generate any eventLBEventException
public java.lang.String checkStatusNoWait(LBCondition condition) throws LBEventException
condition
- The condition whose evaluation result is to be obtained.RESULT_SATISFIED
is returned. if the condition is not satisfied,RESULT_NOT_SATISFIED
is returned. if there is no result availabe,RESULT_NOT_AVAILABLE
is returned.If
- the agent has been terminated, a LBEventException is thrown.LBEventException
public java.lang.String checkStatusNoWait(LBCondition condition, int tolerance) throws LBEventException
condition
- The condition whose evaluation result is to be obtained.tolerance
- Specifies the requirements on the freshness of the result. The value is specified in SECONDs. For example, if tolerance is 60, it means that the result generated during the previous minute is acceptable. Tolerance should not be 0.RESULT_SATISFIED
is returned. if the condition is not satisfied,RESULT_NOT_SATISFIED
is returned. if there is no result availabe,RESULT_NOT_AVAILABLE
is returned.If
- the agent has been terminated, a LBEventException is thrown.LBEventException
public void deActivateCondition(LBCondition condition) throws LBEventException
condition
- the condition to be deactivedLBEventException
public boolean isActive()
public java.lang.String isSatisfied(LBCondition condition) throws LBEventException
condition
- the condition whose evaluation result is to be obtained.if
- an agent with the same agent name has already issued the poll request on the same condition and is waiting for the result, a new request will cause a LBEventException thrown. If the agent has been terminated, a LBEventException is thrown.LBEventException
public java.lang.String isSatisfied(LBCondition condition, int tolerance) throws LBEventException
condition
- The condition whose evaluation result is to be obtained.tolerance
- Specifies the requirements on the freshness of the result. The value is specified in SECONDs. For example, if tolerance is 60, it means that the result generated during the previous minute is acceptable.if
- an agent with the same agent name has already issued the poll request on the same condition and is waiting for the result, a new request will cause a LBEventException thrown. If the agent has been terminated, a LBEventException is thrown.LBEventException
public void registerLBEventHandler(LBEventHandler handler)
public void startListenerThread() throws LBEventException
LBEventException
public void startListenerThread(int numberOfThreads) throws LBEventException
LBEventException
public void stopListenerThread()
public void terminate() throws LBEventException
LBEventException
|
Oracle Application Server Wireless Java API Reference B14043-01 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |