org.opengts.rule.tables
Class Rule

java.lang.Object
  extended by org.opengts.dbtools.DBRecord<RT>
      extended by org.opengts.db.AccountRecord<Rule>
          extended by org.opengts.rule.tables.Rule

public class Rule
extends AccountRecord<Rule>


Nested Class Summary
static class Rule.Key
           
static class Rule.TriggerReset
          BorderCrossing enabled state enumeration
 
Nested classes/interfaces inherited from class org.opengts.db.AccountRecord
AccountRecord.AccountKey<RT extends DBRecord>
 
Nested classes/interfaces inherited from class org.opengts.dbtools.DBRecord
DBRecord.DBChangeListener
 
Field Summary
static java.lang.String _TABLE_NAME
           
static java.lang.String FLD_actionMask
           
static java.lang.String FLD_cannedActions
           
static java.lang.String FLD_description
           
static java.lang.String FLD_emailSubject
           
static java.lang.String FLD_emailText
           
static java.lang.String FLD_isActive
           
static java.lang.String FLD_isCronRule
           
static java.lang.String FLD_minNotifyAge
           
static java.lang.String FLD_notifyEmail
           
static java.lang.String FLD_priority
           
static java.lang.String FLD_ruleDisable
           
static java.lang.String FLD_ruleEnable
           
static java.lang.String FLD_ruleID
           
static java.lang.String FLD_ruleTag
           
static java.lang.String FLD_selector
           
static java.lang.String FLD_sendCommand
           
static java.lang.String FLD_smsText
           
static java.lang.String FLD_triggerReset
           
static java.lang.String FLD_useEmailWrapper
           
static java.lang.String SYSADMIN_RULE_E
           
static java.lang.String SYSADMIN_RULE_S
           
static java.lang.String SYSTEM_RULE_PREFIX
           
 
Fields inherited from class org.opengts.db.AccountRecord
FLD_accountID, FLD_displayName, FLD_notes
 
Fields inherited from class org.opengts.dbtools.DBRecord
errorDescription, excludedUpdateFields, FLD_creationMillis, FLD_creationTime, FLD_lastUpdateAccount, FLD_lastUpdateTime, FLD_lastUpdateUser, hasError, ID_SIZE, isValidating, lastSQLException, NOTIFY_GROUP, PSEUDO_FIELD_CHAR, tempProps
 
Constructor Summary
Rule()
           
Rule(Rule.Key key)
           
 
Method Summary
static boolean checkSelectorSyntax(java.lang.String selector)
           
 boolean clearRuleListEntries()
          Clear RuleList entries for this rule (internal use only)
static java.lang.String CreateDefaultSmsText(java.lang.String emailSubj, java.lang.String emailBody, java.lang.String smsText)
          Gets the default SMS text to send to the recipient.
static Rule createNewRule(Account account, java.lang.String ruleID)
           
 boolean elapsedMinimumNotifyAge(Account account)
          Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.
 boolean elapsedMinimumNotifyAge(Device device)
          Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.
 boolean elapsedMinimumNotifyAge(EventData event)
          Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.
static boolean exists(java.lang.String acctID, java.lang.String ruleID)
           
 int getActionMask()
          Gets the "actionMask" field value
 int getActionMask(boolean checkSysRule)
          Gets the ActionMask of this rule, or the referring SysAdmin rule if applicable
static java.util.Collection<java.lang.String> getAllRuleIDs(java.lang.String acctId, boolean inclSysRules)
           
 java.lang.String getCannedActions()
          Gets the "cannedActions" field value
 java.lang.String getCannedActions(boolean checkSysRule)
          Gets the CannedActions of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getDefaultSmsText(boolean checkSysRule)
          Gets the default SMS text to send to the recipient.
 java.lang.String getDescription()
          Returns the description of this Rule
 java.lang.String getDescription(boolean checkSysRule)
          Gets the description of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getEmailSubject()
          Gets the notification text used for the EMail "subject"
 java.lang.String getEmailSubject(boolean checkSysRule)
          Gets the EmailSubject of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getEmailText()
          Gets the notification text used for the EMail "body"
 java.lang.String getEmailText(boolean checkSysRule)
          Gets the EmailText of this rule, or the referring SysAdmin rule if applicable
static org.opengts.rule.event.EventSelector getEventSelector()
           
static DBFactory<Rule> getFactory()
           
 boolean getIsCronRule()
          Gets the "isCronRule" field value
 boolean getIsCronRule(boolean checkSysRule)
          Gets the "isCronRule" state of this rule, or the referring SysAdmin rule if applicable
static int getMaximumNotifyEmailLength()
          Gets the maximum Notify Email length
 long getMinNotifyAge()
          Gets the minimum notification age
 java.lang.String getNotifyEmail()
          Gets the "notifyEmail" field value
 int getPriority()
          Gets the "priority" field value (EXPERIMENTAL - not used in production)
 int getPriority(boolean checkSysRule)
          Gets the Priority of this rule, or the referring SysAdmin rule if applicable
static Rule getRule(Account account, java.lang.String ruleId)
           
static Rule getRule(Account account, java.lang.String ruleId, boolean create)
           
static Rule getRule(java.lang.String accountID, java.lang.String ruleId)
           
 java.lang.String getRuleDisable()
          Gets the "ruleDisable" field value (EXPERIMENTAL - not used in production)
 java.lang.String getRuleDisable(boolean checkSysRule)
          Gets the RuleDisable of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getRuleEnable()
          Gets the "ruleEnable" field value (EXPERIMENTAL - not used in production)
 java.lang.String getRuleEnable(boolean checkSysRule)
          Gets the RuleEnable of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getRuleID()
          Gets the "ruleID" field value
static java.util.Collection<java.lang.String> getRuleIDs(java.lang.String acctId, boolean activeOnly, boolean inclCronRules, boolean inclSysRules)
           
 java.lang.String getRuleTag()
          Gets the "ruleTag" field value
 java.lang.String getRuleTag(boolean checkSysRule)
          Gets the RuleTag of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getSelector()
          Gets the "selector" field value
 java.lang.String getSelector(boolean checkSysRule)
          Gets the Selector of this rule, or the referring SysAdmin rule if applicable
static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector, Account account)
           
static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector, Device device)
           
static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector, EventData evdb)
           
 java.lang.String getSendCommand()
          Gets the "sendCommand" field value (EXPERIMENTAL - not used in production)
 java.lang.String getSendCommand(boolean checkSysRule)
          Gets the SendCommand of this rule, or the referring SysAdmin rule if applicable
 java.lang.String getSmsText()
          Gets the text used for SMS message notification
 java.lang.String getSmsText(boolean checkSysRule)
          Gets the SmsText of this rule, or the referring SysAdmin rule if applicable
 Rule getSysRuleFromSelector()
          Returns the SystemAdmin rule for this selector, or null if this rule does not refer to a system rule
static java.lang.String GetSysRuleIDFromSelector(java.lang.String sel)
           
static java.util.Map<java.lang.String,java.lang.String> getSystemAdminRuleIDMap(boolean inclCronRules)
           
static java.lang.String getTableDescription(java.util.Locale loc)
          Returns the description of this table
 int getTriggerReset()
          Gets the "triggerReset" field value
 boolean getUseEmailWrapper()
          Gets the "useEmailWrapper" field value (EXPERIMENTAL)
 boolean getUseEmailWrapper(boolean checkSysRule)
          Gets the UseEmailWrapper of this rule, or the referring SysAdmin rule if applicable
 boolean hasCannedActions()
          Returns true if this rule has non-blank "cannedActions"
 boolean hasRuleTag()
          Returns true if this rule has a non-blank "ruleTag"
 boolean hasSelector()
          Returns true if this rule has a non-blank "selector"
static boolean isSelectorMatch(java.lang.String selector, Account account)
           
static boolean isSelectorMatch(java.lang.String selector, Device device)
           
static boolean isSelectorMatch(java.lang.String selector, EventData evdb)
           
static boolean isSystemAdminRuleID(java.lang.String ruleID)
          Returns true if the specified rule is a system-wide/syste-admin rule
(EXPERIMENTAL - currently returns 'false')
static java.lang.StringBuffer listRule(Rule rule, int indent, java.lang.StringBuffer sb)
           
static java.lang.StringBuffer listRule(java.lang.String accountID, java.lang.String ruleID, java.lang.String ruleTag, int indent, java.lang.StringBuffer sb)
           
static java.lang.StringBuffer listRules(java.lang.String accountID, java.util.Collection<java.lang.String> ruleList, java.lang.String ruleTag, int indent, java.lang.StringBuffer sb)
           
static java.lang.StringBuffer listRules(java.lang.String accountID, java.lang.String ruleTag, int indent, java.lang.StringBuffer sb)
           
static void main(java.lang.String[] args)
           
 boolean resetActiveRuleTrigger()
          Returns true if the active RuleTrigger should be reset.
 void setActionMask(int v)
          Sets the "actionMask" field value
 void setCannedActions(java.lang.String v)
          Sets the "cannedActions" field value
 void setCreationDefaultValues()
          Override to set the default field values when creating a new record
 void setEmailSubject(java.lang.String v)
          Sets the notification text used for the EMail "subject"
 void setEmailText(java.lang.String v)
          Sets the notification text used for the EMail "body"
 void setIsCronRule(boolean v)
          Sets the "isCronRule" field value
 void setMinNotifyAge(long v)
          Sets the minimum notification age
 void setNotifyEmail(java.lang.String v)
          Sets the "notifyEmail" field value
 void setPriority(int v)
          Sets the "priority" field value (EXPERIMENTAL - not used in production)
 void setRuleDisable(java.lang.String v)
          Sets the "ruleDisable" field value (EXPERIMENTAL - not used in production)
 void setRuleEnable(java.lang.String v)
          Sets the "ruleEnable" field value (EXPERIMENTAL - not used in production)
 void setRuleTag(java.lang.String v)
          Sets the "ruleTag" field value
 void setSelector(java.lang.String v)
          Sets the "selector" field value
 void setSendCommand(java.lang.String v)
          Sets the "sendCommand" field value (EXPERIMENTAL - not used in production)
 void setSingleDeviceRuleListEntry(java.lang.String deviceID, int statusCode)
          set RuleList device/codes (internal use only)
 void setSingleGroupRuleListEntry(java.lang.String groupID, int statusCode)
          Set RuleList group/codes (internal use only)
 void setSmsText(java.lang.String v)
          Sets the text used for SMS message notification
 boolean setSystemRuleSettings()
          If this rule delegates to a sysadmin rule, then sets various system-rule settings from the delegated sysadmin rule, otherwie does nothing.
 void setTriggerReset(boolean v)
          Sets the "triggerReset" field value
 void setTriggerReset(int v)
          Sets the "triggerReset" field value
 void setTriggerReset(Rule.TriggerReset v)
          Sets the "triggerReset" field value
 void setUseEmailWrapper(boolean v)
          Sets the "useEmailWrapper" field value (EXPERIMENTAL)
static java.lang.String TABLE_NAME()
           
 java.lang.String toString()
          Gets the String representation of this instance
 
Methods inherited from class org.opengts.db.AccountRecord
createSystemAdminAccount, getAccount, getAccountDescription, getAccountID, getDisplayName, getFilteredID, getFilteredID, getIsActive, getNotes, GetSimpleLocalString, getSystemAdminAccount, getSystemAdminAccountID, hasAccount, hasSystemAdminAccountID, isAccountManager, isActive, isSystemAdmin, isSystemAdmin, isSystemAdminAccountID, isValidID, newField_accountID, newField_accountID, newField_displayName, newField_displayName, newField_isActive, newField_isActive, newField_notes, newField_notes, setAccount, setDisplayName, setIsActive, setNotes, setRuntimeDefaultValues
 
Methods inherited from class org.opengts.dbtools.DBRecord
_getFactory, _reload, addChangedNotification, addExcludedUpdateFields, adjustStringLength_1, adjustStringLength, appendFieldValues, clearChanged, clearError, clearExcludedUpdateFields, clearLastCaughtSQLException, equals, excludeFieldFromUpdate, excludeFieldFromUpdate, fireChangeNotification, geKeyValue, getCreationDateTime, getCreationMillis, getCreationTime, GetCurrentAccount, GetCurrentUser, getDefaultFieldValueKey, getErrorDescription, getFactory, getFactory, getField, getFieldBoolean, getFieldDateTime, getFieldDouble, getFieldFloat, getFieldInt, getFieldLong, getFieldName, getFieldString, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getKeyValue, getLastCaughtSQLException, getLastUpdateAccount, getLastUpdateTime, getLastUpdateTime, getLastUpdateUser, getNextGroup, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getOptionalFieldValue, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordCount, getRecordKey, getRecords, getRecords, getTemporaryProperties, getValue, getVirtual, hasChanged, hasError, hasField, hasFieldValue, hasOptionalFieldValue, hasTemporaryProperties, insert, isFieldUnsigned, isLastCaughtSQLExceptionErrorCode, isOkToReload, isOkToSave, isValidating, isVirtual, lock, lockRead, lockWrite, newField_creationMillis, newField_creationTime, newField_creationTime, newField_description, newField_description, newField_lastUpdateAccount, newField_lastUpdateAccount, newField_lastUpdateTime, newField_lastUpdateUser, newField_lastUpdateUser, printXML, printXML, printXML, printXML, printXML, printXML, recordDidInsert, recordDidUpdate, recordWillInsert, recordWillUpdate, reload, reload, removeChangedNotification, save, select, select, select, setAllFieldValues, setAllFieldValues, setAllFieldValues, setAllFieldValues, setChanged, setChanged, setCreationMillis, setCreationTime, SetCurrentAccount, SetCurrentUser, setDescription, setError, setError, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setFieldValue, setIgnoreInvalidFields, setKeyValue, setLastCaughtSQLException, setLastUpdateAccount, setLastUpdateTime, setLastUpdateUser, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setOptionalFieldValue, setValidating, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVirtual, toXML, toXML, toXML, toXML, toXML, unlock, update, update, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SYSTEM_RULE_PREFIX

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

SYSADMIN_RULE_S

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

SYSADMIN_RULE_E

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

_TABLE_NAME

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

FLD_ruleID

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

FLD_isCronRule

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

FLD_ruleTag

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

FLD_selector

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

FLD_actionMask

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

FLD_cannedActions

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

FLD_priority

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

FLD_minNotifyAge

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

FLD_triggerReset

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

FLD_notifyEmail

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

FLD_emailSubject

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

FLD_emailText

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

FLD_smsText

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

FLD_useEmailWrapper

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

FLD_ruleDisable

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

FLD_ruleEnable

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

FLD_sendCommand

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

FLD_description

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

FLD_isActive

public static final java.lang.String FLD_isActive
See Also:
Constant Field Values
Constructor Detail

Rule

public Rule()

Rule

public Rule(Rule.Key key)
Method Detail

GetSysRuleIDFromSelector

public static java.lang.String GetSysRuleIDFromSelector(java.lang.String sel)

TABLE_NAME

public static java.lang.String TABLE_NAME()

getFactory

public static DBFactory<Rule> getFactory()

getTableDescription

public static java.lang.String getTableDescription(java.util.Locale loc)
Returns the description of this table

Returns:
Table description

getRuleID

public java.lang.String getRuleID()
Gets the "ruleID" field value

Returns:
The "ruleID" field value

isSystemAdminRuleID

public static boolean isSystemAdminRuleID(java.lang.String ruleID)
Returns true if the specified rule is a system-wide/syste-admin rule
(EXPERIMENTAL - currently returns 'false')

Parameters:
ruleID - The rule-id to test
Returns:
True if the specified rule is a system-wide/syste-admin rule

getSysRuleFromSelector

public Rule getSysRuleFromSelector()
Returns the SystemAdmin rule for this selector, or null if this rule does not refer to a system rule

Returns:
The system-admin rule, or null if this rule does not refer to a system rule

getDescription

public java.lang.String getDescription()
Returns the description of this Rule

Overrides:
getDescription in class DBRecord<Rule>
Returns:
The rule description

getDescription

public java.lang.String getDescription(boolean checkSysRule)
Gets the description of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin description if applicable
Returns:
The rule description

getIsCronRule

public boolean getIsCronRule()
Gets the "isCronRule" field value

Returns:
The "isCronRule" field value

setIsCronRule

public void setIsCronRule(boolean v)
Sets the "isCronRule" field value

Parameters:
v - The "isCronRule" field value to set

getIsCronRule

public boolean getIsCronRule(boolean checkSysRule)
Gets the "isCronRule" state of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin "isCronRule" state if applicable
Returns:
The rule "isCronRule" state

hasRuleTag

public boolean hasRuleTag()
Returns true if this rule has a non-blank "ruleTag"

Returns:
True if this rule has a non-blank "ruleTag"

getRuleTag

public java.lang.String getRuleTag()
Gets the "ruleTag" field value

Returns:
The "ruleTag" field value

setRuleTag

public void setRuleTag(java.lang.String v)
Sets the "ruleTag" field value

Parameters:
v - The "ruleTag" field value to set

getRuleTag

public java.lang.String getRuleTag(boolean checkSysRule)
Gets the RuleTag of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin RuleTag if applicable
Returns:
The rule RuleTag

setSystemRuleSettings

public boolean setSystemRuleSettings()
If this rule delegates to a sysadmin rule, then sets various system-rule settings from the delegated sysadmin rule, otherwie does nothing.

Returns:
True if this rule instance was updated, false otherwise.

hasSelector

public boolean hasSelector()
Returns true if this rule has a non-blank "selector"

Returns:
True if this rule has a non-blank "selector"

getSelector

public java.lang.String getSelector()
Gets the "selector" field value

Returns:
The "selector" field value

setSelector

public void setSelector(java.lang.String v)
Sets the "selector" field value

Parameters:
v - The "selector" field value to set

getSelector

public java.lang.String getSelector(boolean checkSysRule)
Gets the Selector of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin Selector if applicable
Returns:
The rule Selector

getActionMask

public int getActionMask()
Gets the "actionMask" field value

Returns:
The "actionMask" field value

setActionMask

public void setActionMask(int v)
Sets the "actionMask" field value

Parameters:
v - The "actionMask" field value to set

getActionMask

public int getActionMask(boolean checkSysRule)
Gets the ActionMask of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin ActionMask if applicable
Returns:
The rule ActionMask

hasCannedActions

public boolean hasCannedActions()
Returns true if this rule has non-blank "cannedActions"

Returns:
True if this rule has non-blank "cannedActions"

getCannedActions

public java.lang.String getCannedActions()
Gets the "cannedActions" field value

Returns:
The "cannedActions" field value

setCannedActions

public void setCannedActions(java.lang.String v)
Sets the "cannedActions" field value

Parameters:
v - The "cannedActions" field value to set

getCannedActions

public java.lang.String getCannedActions(boolean checkSysRule)
Gets the CannedActions of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin CannedActions if applicable
Returns:
The rule CannedActions

getPriority

public int getPriority()
Gets the "priority" field value (EXPERIMENTAL - not used in production)

Returns:
The "priority" field value

setPriority

public void setPriority(int v)
Sets the "priority" field value (EXPERIMENTAL - not used in production)

Parameters:
v - The "priority" field value to set

getPriority

public int getPriority(boolean checkSysRule)
Gets the Priority of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin Priority if applicable
Returns:
The rule Priority

getMinNotifyAge

public long getMinNotifyAge()
Gets the minimum notification age

Returns:
The minimum notification age

setMinNotifyAge

public void setMinNotifyAge(long v)
Sets the minimum notification age

Parameters:
v - The minimum notification age

elapsedMinimumNotifyAge

public boolean elapsedMinimumNotifyAge(Account account)
Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.

Parameters:
account - The account to test for prior notifications
Returns:
True if ok to notify, false otherwise

elapsedMinimumNotifyAge

public boolean elapsedMinimumNotifyAge(Device device)
Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.

Parameters:
device - The device to test for prior notifications
Returns:
True if ok to notify, false otherwise

elapsedMinimumNotifyAge

public boolean elapsedMinimumNotifyAge(EventData event)
Returns true if the minimum notification age has elapsed, or if there are no minimum notification age limitations.

Parameters:
event - The event instance containing the device to test for prior notifications
Returns:
True if ok to notify, false otherwise

getTriggerReset

public int getTriggerReset()
Gets the "triggerReset" field value

Returns:
The "triggerReset" field value

setTriggerReset

public void setTriggerReset(int v)
Sets the "triggerReset" field value

Parameters:
v - The "triggerReset" field value to set

setTriggerReset

public void setTriggerReset(Rule.TriggerReset v)
Sets the "triggerReset" field value

Parameters:
v - The "triggerReset" field value to set

setTriggerReset

public void setTriggerReset(boolean v)
Sets the "triggerReset" field value

Parameters:
v - The "triggerReset" field value to set

resetActiveRuleTrigger

public boolean resetActiveRuleTrigger()
Returns true if the active RuleTrigger should be reset. (resetting the RuleTrigger will restart the minimum notification elapsed time).


getNotifyEmail

public java.lang.String getNotifyEmail()
Gets the "notifyEmail" field value

Returns:
The "notifyEmail" field value

setNotifyEmail

public void setNotifyEmail(java.lang.String v)
Sets the "notifyEmail" field value

Parameters:
v - The "notifyEmail" field value to set

getMaximumNotifyEmailLength

public static int getMaximumNotifyEmailLength()
Gets the maximum Notify Email length


getEmailSubject

public java.lang.String getEmailSubject()
Gets the notification text used for the EMail "subject"

Returns:
The notification text used for the EMail "subject"

setEmailSubject

public void setEmailSubject(java.lang.String v)
Sets the notification text used for the EMail "subject"

Parameters:
v - The notification text to use for the EMail "subject"

getEmailSubject

public java.lang.String getEmailSubject(boolean checkSysRule)
Gets the EmailSubject of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin EmailSubject if applicable
Returns:
The rule EmailSubject

getEmailText

public java.lang.String getEmailText()
Gets the notification text used for the EMail "body"

Returns:
The notification text used for the EMail "body"

setEmailText

public void setEmailText(java.lang.String v)
Sets the notification text used for the EMail "body"

Parameters:
v - The notification text to use for the EMail "body"

getEmailText

public java.lang.String getEmailText(boolean checkSysRule)
Gets the EmailText of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin EmailText if applicable
Returns:
The rule EmailText

getSmsText

public java.lang.String getSmsText()
Gets the text used for SMS message notification

Returns:
The text used for SMS message notification

setSmsText

public void setSmsText(java.lang.String v)
Sets the text used for SMS message notification

Parameters:
v - The text to use for SMS message notification

getSmsText

public java.lang.String getSmsText(boolean checkSysRule)
Gets the SmsText of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin SmsText if applicable
Returns:
The rule SmsText

CreateDefaultSmsText

public static java.lang.String CreateDefaultSmsText(java.lang.String emailSubj,
                                                    java.lang.String emailBody,
                                                    java.lang.String smsText)
Gets the default SMS text to send to the recipient. If the defined SMS text is blank, this method will return the contatenated email subject plus body strings.

Returns:
The default SMS text sent to the recipient

getDefaultSmsText

public java.lang.String getDefaultSmsText(boolean checkSysRule)
Gets the default SMS text to send to the recipient. If the defined SMS text is blank, this method will return the contatenated email subject plus body strings.

Returns:
The default SMS text sent to the recipient

getUseEmailWrapper

public boolean getUseEmailWrapper()
Gets the "useEmailWrapper" field value (EXPERIMENTAL)

Returns:
The "useEmailWrapper" field value

setUseEmailWrapper

public void setUseEmailWrapper(boolean v)
Sets the "useEmailWrapper" field value (EXPERIMENTAL)

Parameters:
v - The "useEmailWrapper" field value to set

getUseEmailWrapper

public boolean getUseEmailWrapper(boolean checkSysRule)
Gets the UseEmailWrapper of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin UseEmailWrapper if applicable
Returns:
The rule UseEmailWrapper

getRuleDisable

public java.lang.String getRuleDisable()
Gets the "ruleDisable" field value (EXPERIMENTAL - not used in production)

Returns:
The "ruleDisable" field value

setRuleDisable

public void setRuleDisable(java.lang.String v)
Sets the "ruleDisable" field value (EXPERIMENTAL - not used in production)

Parameters:
v - The "ruleDisable" field value to set

getRuleDisable

public java.lang.String getRuleDisable(boolean checkSysRule)
Gets the RuleDisable of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin RuleDisable if applicable
Returns:
The rule RuleDisable

getRuleEnable

public java.lang.String getRuleEnable()
Gets the "ruleEnable" field value (EXPERIMENTAL - not used in production)

Returns:
The "ruleEnable" field value

setRuleEnable

public void setRuleEnable(java.lang.String v)
Sets the "ruleEnable" field value (EXPERIMENTAL - not used in production)

Parameters:
v - The "ruleEnable" field value to set

getRuleEnable

public java.lang.String getRuleEnable(boolean checkSysRule)
Gets the RuleEnable of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin RuleEnable if applicable
Returns:
The rule RuleEnable

getSendCommand

public java.lang.String getSendCommand()
Gets the "sendCommand" field value (EXPERIMENTAL - not used in production)

Returns:
The "sendCommand" field value

setSendCommand

public void setSendCommand(java.lang.String v)
Sets the "sendCommand" field value (EXPERIMENTAL - not used in production)

Parameters:
v - The "sendCommand" field value to set

getSendCommand

public java.lang.String getSendCommand(boolean checkSysRule)
Gets the SendCommand of this rule, or the referring SysAdmin rule if applicable

Parameters:
checkSysRule - True to return the SysAdmin SendCommand if applicable
Returns:
The rule SendCommand

toString

public java.lang.String toString()
Gets the String representation of this instance

Overrides:
toString in class DBRecord<Rule>
Returns:
The String representation of this instance

setCreationDefaultValues

public void setCreationDefaultValues()
Override to set the default field values when creating a new record

Overrides:
setCreationDefaultValues in class DBRecord<Rule>

getEventSelector

public static org.opengts.rule.event.EventSelector getEventSelector()

checkSelectorSyntax

public static boolean checkSelectorSyntax(java.lang.String selector)

getSelectorResult

public static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector,
                                                                          EventData evdb)
                                                                   throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

isSelectorMatch

public static boolean isSelectorMatch(java.lang.String selector,
                                      EventData evdb)
                               throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

getSelectorResult

public static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector,
                                                                          Device device)
                                                                   throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

isSelectorMatch

public static boolean isSelectorMatch(java.lang.String selector,
                                      Device device)
                               throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

getSelectorResult

public static org.opengts.rule.selector.Selector.Result getSelectorResult(java.lang.String selector,
                                                                          Account account)
                                                                   throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

isSelectorMatch

public static boolean isSelectorMatch(java.lang.String selector,
                                      Account account)
                               throws org.opengts.rule.selector.ParserException
Throws:
org.opengts.rule.selector.ParserException

exists

public static boolean exists(java.lang.String acctID,
                             java.lang.String ruleID)
                      throws DBException
Throws:
DBException

getRule

public static Rule getRule(java.lang.String accountID,
                           java.lang.String ruleId)
                    throws DBException
Throws:
DBException

getRule

public static Rule getRule(Account account,
                           java.lang.String ruleId)
                    throws DBException
Throws:
DBException

getRule

public static Rule getRule(Account account,
                           java.lang.String ruleId,
                           boolean create)
                    throws DBException
Throws:
DBException

createNewRule

public static Rule createNewRule(Account account,
                                 java.lang.String ruleID)
                          throws DBException
Throws:
DBException

getRuleIDs

public static java.util.Collection<java.lang.String> getRuleIDs(java.lang.String acctId,
                                                                boolean activeOnly,
                                                                boolean inclCronRules,
                                                                boolean inclSysRules)
                                                         throws DBException
Throws:
DBException

getAllRuleIDs

public static java.util.Collection<java.lang.String> getAllRuleIDs(java.lang.String acctId,
                                                                   boolean inclSysRules)
                                                            throws DBException
Throws:
DBException

getSystemAdminRuleIDMap

public static java.util.Map<java.lang.String,java.lang.String> getSystemAdminRuleIDMap(boolean inclCronRules)
                                                                                throws DBException
Throws:
DBException

listRule

public static java.lang.StringBuffer listRule(Rule rule,
                                              int indent,
                                              java.lang.StringBuffer sb)
                                       throws DBException
Throws:
DBException

listRule

public static java.lang.StringBuffer listRule(java.lang.String accountID,
                                              java.lang.String ruleID,
                                              java.lang.String ruleTag,
                                              int indent,
                                              java.lang.StringBuffer sb)
                                       throws DBException
Throws:
DBException

listRules

public static java.lang.StringBuffer listRules(java.lang.String accountID,
                                               java.util.Collection<java.lang.String> ruleList,
                                               java.lang.String ruleTag,
                                               int indent,
                                               java.lang.StringBuffer sb)
                                        throws DBException
Throws:
DBException

listRules

public static java.lang.StringBuffer listRules(java.lang.String accountID,
                                               java.lang.String ruleTag,
                                               int indent,
                                               java.lang.StringBuffer sb)
                                        throws DBException
Throws:
DBException

clearRuleListEntries

public boolean clearRuleListEntries()
Clear RuleList entries for this rule (internal use only)


setSingleDeviceRuleListEntry

public void setSingleDeviceRuleListEntry(java.lang.String deviceID,
                                         int statusCode)
set RuleList device/codes (internal use only)


setSingleGroupRuleListEntry

public void setSingleGroupRuleListEntry(java.lang.String groupID,
                                        int statusCode)
Set RuleList group/codes (internal use only)


main

public static void main(java.lang.String[] args)