public class Rules
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Rules.RuleInfo
The RuleInfo class holds the detailed information for the sync rules.
|
Modifier and Type | Field and Description |
---|---|
static int |
NET_CONFIG
RuleType
|
static Rules.RuleInfo |
NET_CONFIG_ri
Configure network parameters (currently only the network specific proxy configuration is supported)
The configuration rule contains a vector of hashtables with a hashtable representing properties of each
individual network.
|
static java.lang.String |
NET_CONFIG_s
String notation of RuleInfo field
name |
static java.lang.String |
PARAM_AUTODIAL
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_LEVEL
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_NAME
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_NET
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_NREC
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_PERIOD
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_PING
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_PRIORITY
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_PROXY
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_SPEED
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_START_TIME
Hashtable key of RuleInfo field
params |
static java.lang.String |
PARAM_STORE
Hashtable key of RuleInfo field
params |
static int |
RULE_AC_PWR
RuleType
|
static Rules.RuleInfo |
RULE_AC_PWR_ri
Client automatically synchronizes when the AC power is detected; that is, when the device is plugged in.
|
static java.lang.String |
RULE_AC_PWR_s
String notation of RuleInfo field
name |
static int |
RULE_HIGH_BANDWIDTH
RuleType
|
static Rules.RuleInfo |
RULE_HIGH_BANDWIDTH_ri
Client automatically synchronizes when the network bandwidth is greater than
|
static java.lang.String |
RULE_HIGH_BANDWIDTH_s
String notation of RuleInfo field
name |
static int |
RULE_LOW_PWR
RuleType
|
static Rules.RuleInfo |
RULE_LOW_PWR_ri
Client automatically synchronizes when the battery level drops to "number"%, where "number" is a percentage.
|
static java.lang.String |
RULE_LOW_PWR_s
String notation of RuleInfo field
name |
static int |
RULE_MAX_DB_REC
RuleType
|
static Rules.RuleInfo |
RULE_MAX_DB_REC_ri
Client automatically synchronizes if the client database for all automatic publication items
on the client contains more than NREC modified records, where you specify the NREC of modifed records
in the client database to trigger an automatic synchronization.
|
static java.lang.String |
RULE_MAX_DB_REC_s
String notation of RuleInfo field
name |
static int |
RULE_MAX_PI_REC
RuleType
|
static Rules.RuleInfo |
RULE_MAX_PI_REC_ri
Client automatically synchronizes if the number of modified records
for a publication item is great than NREC.
|
static java.lang.String |
RULE_MAX_PI_REC_s
String notation of RuleInfo field
name |
static int |
RULE_MIN_MEM
RuleType
|
static Rules.RuleInfo |
RULE_MIN_MEM_ri
If the available memory is less then the specified
|
static java.lang.String |
RULE_MIN_MEM_s
String notation of RuleInfo field
name |
static int |
RULE_MIN_PWR
RuleType
|
static Rules.RuleInfo |
RULE_MIN_PWR_ri
If power drops below this level, sync agent should not schedule any synchronization.
|
static java.lang.String |
RULE_MIN_PWR_s
String notation of RuleInfo field
name |
static int |
RULE_NET_PRIORITY
RuleType
|
static Rules.RuleInfo |
RULE_NET_PRIORITY_ri
Network quality can be specified using several properties.
|
static java.lang.String |
RULE_NET_PRIORITY_s
String notation of RuleInfo field
name |
static int |
RULE_NOTIFY_MAX_PUB_REC
RuleType
|
static Rules.RuleInfo |
RULE_NOTIFY_MAX_PUB_REC_ri
Client automatically synchronizes if the server out queue contains more than NREC modified records,
where you specify the NREC of modifed records for a given publication.
|
static java.lang.String |
RULE_NOTIFY_MAX_PUB_REC_s
String notation of RuleInfo field
name |
static int |
RULE_TIME_INTERVAL
RuleType
|
static Rules.RuleInfo |
RULE_TIME_INTERVAL_ri
Schedule sync at a given time of day with a certain frequency (interval).
|
static java.lang.String |
RULE_TIME_INTERVAL_s
String notation of RuleInfo field
name |
static java.util.Hashtable |
rulesHash
Hashtable of rules
|
static java.lang.String[] |
rulesList
A list of rule names
|
static int |
UNDEFINED |
Constructor and Description |
---|
Rules() |
Modifier and Type | Method and Description |
---|---|
static java.util.Hashtable |
getSyncRuleParams(int ruleType,
java.lang.String ruleText)
Get rule properties names and their values.
|
static void |
main(java.lang.String[] argv) |
static java.lang.String |
setSyncRuleParams(int ruleType,
java.util.Hashtable params)
Set the sync rule parameters.
|
public static final int NET_CONFIG
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo NET_CONFIG_ri
PARAM_NAME - network name
PARAM_PROXY - proxy url
For example:
NETWORK CONFIGURATION SPEC FOR 3 NETWORKS
Vector v = new Vector(); Hashtable network_1_h = new Hashtable(); Hashtable network_1_h = new Hashtable(); Hashtable network_2_h = new Hashtable(); Hashtable network_3_h = new Hashtable(); network_1_h.put(Rules.PARAM_NAME,"NETWORK_1"); network_1_h.put(Rules.PARAM_PROXY,"PROXY_1"); v.addElement(network_1_h); network_2_h.put(Rules.PARAM_NAME,"NETWORK_2"); network_2_h.put(Rules.PARAM_PROXY,"PROXY_2"); v.addElement(network_2_h); network_3_h.put(Rules.PARAM_NAME,"NETWORK_3"); network_3_h.put(Rules.PARAM_PROXY,"PROXY_3"); v.addElement(network_3_h); params_h.put(Rules.PARAM_NET,v);
public static final java.lang.String NET_CONFIG_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final java.lang.String PARAM_AUTODIAL
params
public static final java.lang.String PARAM_LEVEL
params
public static final java.lang.String PARAM_NAME
params
public static final java.lang.String PARAM_NET
params
public static final java.lang.String PARAM_NREC
params
public static final java.lang.String PARAM_PERIOD
params
public static final java.lang.String PARAM_PING
params
public static final java.lang.String PARAM_PRIORITY
params
public static final java.lang.String PARAM_PROXY
params
public static final java.lang.String PARAM_SPEED
params
public static final java.lang.String PARAM_START_TIME
params
public static final java.lang.String PARAM_STORE
params
public static final int RULE_AC_PWR
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_AC_PWR_ri
public static final java.lang.String RULE_AC_PWR_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_HIGH_BANDWIDTH
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_HIGH_BANDWIDTH_ri
Set the bandwidth value using PARAM_SPEED. For example:
params_h.put(Rules.PARAM_SPEED, "100000");
public static final java.lang.String RULE_HIGH_BANDWIDTH_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_LOW_PWR
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_LOW_PWR_ri
Set this using PARAM_LEVEL to the percentage of battery left, when you want the synchronization to automatically occur. For example:
params_h.put(Rules.PARAM_LEVEL, "30");
public static final java.lang.String RULE_LOW_PWR_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_MAX_DB_REC
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_MAX_DB_REC_ri
Set the number of records in the PARAM_NREC where this condition starts the synchronization. For example:
params_h.put(Rules.PARAM_NREC,"5");
public static final java.lang.String RULE_MAX_DB_REC_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_MAX_PI_REC
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_MAX_PI_REC_ri
Set the number of records in the PARAM_NREC where this condition starts the synchronization. Configure the name of the client snapshot in the PARAM_STORE. For example:
params_h.put(Rules.PARAM_STORE."SNAPSHOT1"); params_h.put(Rules.PARAM_NREC,"5");
public static final java.lang.String RULE_MAX_PI_REC_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_MIN_MEM
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_MIN_MEM_ri
Set this using PARAM_LEVEL. For example:
params_h.put(Rules.PARAM_LEVEL, "5242880");
public static final java.lang.String RULE_MIN_MEM_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_MIN_PWR
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_MIN_PWR_ri
Specify the minimum battery level required in order for an automatic synchronization to start. The battery level is specified as a percentage. Set this using PARAM_LEVEL.
params_h.put(Rules.PARAM_LEVEL, "10");
public static final java.lang.String RULE_MIN_PWR_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_NET_PRIORITY
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_NET_PRIORITY_ri
NETWORK PROPERTY | DESCRIPTION |
---|---|
PARAM_PRIORITY | Data priority, specifies whether or not the network conditions apply to regular or high priority sync. |
PARAM_SPEED | Configure the minimum bandwidth (bits/second) in which the automatic synchronization can occur. |
PARAM_PING | Configure the maximum ping delay (seconds) in which the automatic synchronization can occur. Zero or less ping delay indicates that ping timeout is not assessed. | PARAM_AUTODIAL | The always-on network is used if available. However, if this network is not available, select YES if you want to use any of the dial-up networks. |
For example: Data priority can be either one or zero, where zero is high priority
ri.params_h.put(Rules.PARAM_PRIORITY,"0");Minimum bandwidth of bits/second that must be true for this priority of data to synchronize.
ri.params_h.put(Rules.PARAM_SPEED,"1000");Maximum ping delay for this priority of data to synchronize.
ri.params_h.put(Rules.PARAM_PING,"10");Do you want to autodial the dial-up network if the wireless network is down?
params_h.put(Rules.PARAM_AUTODIAL,"YES");
public static final java.lang.String RULE_NET_PRIORITY_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_NOTIFY_MAX_PUB_REC
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_NOTIFY_MAX_PUB_REC_ri
Set the number of records in the PARAM_NREC where this condition starts the synchronization. For example:
params_h.put(Rules.PARAM_NREC,"5");
public static final java.lang.String RULE_NOTIFY_MAX_PUB_REC_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static final int RULE_TIME_INTERVAL
Corresponding RuleInfo
,
Constant Field Valuespublic static Rules.RuleInfo RULE_TIME_INTERVAL_ri
Specify the time (PARAM_START_TIME) for an automatic synchronization to start. The format of time is standard date string: H24:MI:SS e.g. 00:00:00 or 23:59:00 The time is GMT. If not set, the sync will start when syncagent starts and all other conditions are satisfied Set the period (PARAM_PERIOD), in seconds, to specify the frequency of scheduled syncs
// sync every day at 6:30pm GMT params_h.put(Rules.PARAM_START_TIME, "18:30:00"); params_h.put(Rules.PARAM_PERIOD, "86400"); // every 24h*3600s/h = 86400 seconds or // sync every hour params_h.put(Rules.PARAM_PERIOD, "3600");
public static final java.lang.String RULE_TIME_INTERVAL_s
name
Corresponding RuleInfo
,
Constant Field Valuespublic static java.util.Hashtable rulesHash
public static java.lang.String[] rulesList
public static final int UNDEFINED
public static java.util.Hashtable getSyncRuleParams(int ruleType, java.lang.String ruleText) throws java.lang.Throwable
ruleType
- ruleType example
ruleText
- the text of rulejava.lang.Throwable
public static void main(java.lang.String[] argv) throws java.lang.Throwable
java.lang.Throwable
public static java.lang.String setSyncRuleParams(int ruleType, java.util.Hashtable params) throws java.lang.Throwable
ruleType
- ruleType example
params
- Hashtable key: String prop_name | value: String value;
hashtable key example
java.lang.Throwable