Oracle Application Server Wireless Java API Reference
B14043-01


oracle.panama.lbevent
Interface LBCondition


public interface LBCondition

A LBCondition represents a location based condition. A location based condition is a set of location based criteria plus related information such as the condition creator, default expiration time, the default evaluation mode, etc. Only when all the criteria in the condition are satisfied, the condition is considered satisfied.


Field Summary
static java.lang.String MODE_ONCE
          The evalution mode : once.
static java.lang.String MODE_REPEAT
          The evalution mode : repeat.
static java.lang.String STATE_ACTIVATED
          The state of the condition after the condition is activated.
static java.lang.String STATE_NOT_ACTIVATED
          The state of the condition when the condition is not activated.
static java.lang.String TARGETTYPE_COMM
          The community target type
static java.lang.String TARGETTYPE_MSID
          The MSID target type
static java.lang.String TARGETTYPE_USER
          The user target type
static java.lang.String TYPE_IN
          The criteria type IN.
static java.lang.String TYPE_OUT
          The criteria type OUT.
static java.lang.String TYPENAME
           

 

Method Summary
 void addCriteria(java.lang.String target, java.lang.String targetType, java.lang.String criteriaType, long regionId)
          Add a criteria to a condition.
 void delete(boolean force)
          Delete the condition
 long getConditionId()
          get the object ID of the lbcondition.
 User getCreator()
          Get the user who created the condition.
 LBCriteriaEnumeration getCriteria()
          Get all the criteria in the condition
 java.lang.String getDefaultEvalMode()
          Get the default evaluation mode for the condition.
 java.util.Calendar getDefaultExprTime()
          Get the default expiration time for the condition.
 LocationPrivacyDomain getPrivacyDomain()
          Get the Location Privacy Domain in which the location based condition is created.
 java.lang.String getState()
          get the current state of the lbcondition.
 java.util.Enumeration getTargetsDisallowPosition()
          Get all the targets who currently do not allow the creator of the condition to position them.
 void removeCriteria(java.lang.String target, java.lang.String targetType, java.lang.String criteriaType, long regionId)
          Remove a criteria from a condition.
 void setDefaultEvalMode(java.lang.String mode)
          Set default evaluation mode for the condition.
 void setDefaultExprTime(java.util.Calendar expirationTime)
          Set default expiration time for the condition.

 

Field Detail

MODE_ONCE

public static final java.lang.String MODE_ONCE
The evalution mode : once. If a condition is activated with this mode, it will be evaluated until it is satisfied.
See Also:
Constant Field Values

MODE_REPEAT

public static final java.lang.String MODE_REPEAT
The evalution mode : repeat. If a condition is activated with this mode, it will be evaluated till the specified expiration time.
See Also:
Constant Field Values

STATE_ACTIVATED

public static final java.lang.String STATE_ACTIVATED
The state of the condition after the condition is activated.
See Also:
Constant Field Values

STATE_NOT_ACTIVATED

public static final java.lang.String STATE_NOT_ACTIVATED
The state of the condition when the condition is not activated.
See Also:
Constant Field Values

TARGETTYPE_COMM

public static final java.lang.String TARGETTYPE_COMM
The community target type
See Also:
Constant Field Values

TARGETTYPE_MSID

public static final java.lang.String TARGETTYPE_MSID
The MSID target type
See Also:
Constant Field Values

TARGETTYPE_USER

public static final java.lang.String TARGETTYPE_USER
The user target type
See Also:
Constant Field Values

TYPE_IN

public static final java.lang.String TYPE_IN
The criteria type IN. When a target is INSIDE the specified region, the criteria is considered satisfied. On the region border is considered INSIDE.
See Also:
Constant Field Values

TYPE_OUT

public static final java.lang.String TYPE_OUT
The criteria type OUT. When a target is OUTSIDE the specified region, the criteria is considered satisfied. On the region border is considered INSIDE.
See Also:
Constant Field Values

TYPENAME

public static final java.lang.String TYPENAME
See Also:
Constant Field Values

Method Detail

addCriteria

public void addCriteria(java.lang.String target,
                        java.lang.String targetType,
                        java.lang.String criteriaType,
                        long regionId)
                 throws LBEventException
Add a criteria to a condition.
Parameters:
target - The person whose position will be checked
targetType - The type of the target. If the target type is "user", the target is id of the user. If the target type is "community", the target is the id of the community. If the target type is "MSID" the target is the Mobile Station ID of the target.
criteriaType - The type of the criteira. It can be IN or OUT
regionId - The id of the region with which the target's position will be compared.
Throws:
If - the condition has already been activated, a LBEventException will be thrown.
LBEventException
See Also:
LBEventException

delete

public void delete(boolean force)
            throws LBEventException
Delete the condition
Parameters:
force - if force is false, the activated condition will not be deleted. if force</dode> is true, the condition will be deleted no matter it is activated or not
Throws:
LBEventException

getConditionId

public long getConditionId()
get the object ID of the lbcondition. A LBCondition object is uniquely identified by a its ID.

getCreator

public User getCreator()
Get the user who created the condition.
Returns:
A user object representing the creator of the condition.

getCriteria

public LBCriteriaEnumeration getCriteria()
                                  throws LBEventException
Get all the criteria in the condition
Returns:
a enumeration of the LBCriteria. The enumeration is based on a JDBC ResultSet enumeration. The close() method of the LBCriteriaEnumeration should be invoked to release the resources once the LBCriteriaEnumeration is no longer accessed.
Throws:
LBEventException
See Also:
LBCriteriaEnumeration

getDefaultEvalMode

public java.lang.String getDefaultEvalMode()
Get the default evaluation mode for the condition.
Returns:
default evaluation mode

getDefaultExprTime

public java.util.Calendar getDefaultExprTime()
Get the default expiration time for the condition.
Returns:
default expiration time

getPrivacyDomain

public LocationPrivacyDomain getPrivacyDomain()
Get the Location Privacy Domain in which the location based condition is created.
Returns:
A LocationPrivacyDomain object.
See Also:
LocationPrivacyDomain

getState

public java.lang.String getState()
                          throws LBEventException
get the current state of the lbcondition.
Throws:
LBEventException

getTargetsDisallowPosition

public java.util.Enumeration getTargetsDisallowPosition()
                                                 throws LBEventException
Get all the targets who currently do not allow the creator of the condition to position them.
Returns:
An enumeration of the user objects.
Throws:
LBEventException

removeCriteria

public void removeCriteria(java.lang.String target,
                           java.lang.String targetType,
                           java.lang.String criteriaType,
                           long regionId)
                    throws LBEventException
Remove a criteria from a condition.
Parameters:
target - The person whose position will be checked
targetType - The type of the target. If the target type is "user", the target is id of the user. If the target type is "community", the target is the id of the community. If the target type is "MSID" the target is the Mobile Station ID of the target.
criteriaType - The type of the criteira. It can be IN or OUT
regionId - The id of the region with which the target's position will be compared.
Throws:
If - the condition has already been activated, a LBEventException will be thrown.
LBEventException
See Also:
LBEventException

setDefaultEvalMode

public void setDefaultEvalMode(java.lang.String mode)
                        throws LBEventException
Set default evaluation mode for the condition. The default evaluation mode will be overridden if a different evaluation mode is specified when the condition is activated.
Throws:
LBEventException

setDefaultExprTime

public void setDefaultExprTime(java.util.Calendar expirationTime)
                        throws LBEventException
Set default expiration time for the condition. When the condition is activated with the REPEAT mode, an expiration time is needed. The default expiration time will be overridden if a different expiration time is specified when the condition is activated.
Parameters:
expirationTime -
Throws:
LBEventException

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.