|
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 |
This interface defines user subscription information.
For time based subscriptions, users can specify a spefic time of the day (i.e. hour:minute), or start/end time and an interval to receive multiple alerts. In this case, user will receive notification messages every n minutes (specified with the setInterval(int)
method) between hour:minute and endhour:endminute.
Sample Usage: //Locate the master notification service MasterAlertService mAS = s.lookupMobileMasterAlertService("StockNotification"); //Locate the stock trade master service MasterService masterService = s.lookupMasterService("/master/examples/StockTradeMasterService"); //Locate the stock trade link Link link = s.lookupLink("/Examples/StockTradeLink"); //Locate the user User user = s.lookupUser("orcladmin"); //Locate primary and alternative device addresses DeviceAddress addr1 = s.lookupDeviceAddress(DeliveryType.SMS, "1234567890"); DeviceAddress addr2 = s.lookupDeviceAddress(DeliveryType.EMAIL, "John.Doe@xyz.com"); //Create a subscription for orcladmin on the stock trade link ServiceAlertSubscription sub = mAS.addUserAlertSubscription(user, link); //Set the data feed input parameter (ticker) to ORCL AlertInputParamValue[] paramVals = sub.getInputParameters(); paramVals[0].setValue("ORCL"); //Set triggering condition values: price:30 and change: 12 AlertConditionValue[] conVals = sub.getConditions(); conVals[0].setValue("30"); //price conVals[1].setValue("12"); //change //Set frequency to daily, receive notifications on weekdays AlertTimeFrequency freq = AlertTimeFrequencyImpl.getAlertTimeFrequencys()[0]; //Activate the notification tomorrow Calendar startDate = Calendar.getInstance(); startDate.add(Calendar.DATE, 1); //User will be subscribed for 365 days Calendar expirationDate = Calendar.getInstance(); expirationDate.add(Calendar.DATE, 366); //User will be going on vacation 30 days from now, //so deactivate them temporarily in that period for 10 days Calendar blackoutStartDate = Calendar.getInstance(); blackoutStartDate.add(Calendar.DATE, 30); Calendar blackoutEndDate = Calendar.getInstance(); blackoutEndDate.add(Calendar.DATE, 40); //Create location condition for monitoring myself for getting into a region with id 18191. LocationPrivacyDomain lbDomain = new LocationPrivacyDomain(masterService); LBCondition lbCondition = f.createLBCondition(LBCondition.MODE_REPEAT, expirationDate, user, lbDomain); lbCondition.addCriteria("orcladmin", "user", "IN", 18191); //Set data and time predicates for this subscription. //This notification will evaluate the conditions starting at 8:00 a.m. till 1:30pm //every 45 minutes, on every weekday (Monday-Friday). sub.setCondition(paramVals, conVals, 8, 0, 13, 30, 45, freq, expirationDate, startDate); //Set the location condition sub.setLocationCondition(lbCondition); //Set the primary device that notifications will be send to sub.setSubscriptionDevice(addr1); //When the max. number of notifications is reached, //send the notifications to the alternative device sub.setAlternativeType(ServiceAlertSubscription.AFTERMAX_DEVICE); //Set the secondary device as alternative device sub.setAlternativeDevice(addr2); //Set blackout periods, activation/deactivation information sub.setSuspendStartDate(blackoutStartDate); sub.setSuspendEndDate(blackoutStartDate); sub.setStartDate(startDate); sub.setExpirationDate(expirationDate); //save the subscription sub.save();
Field Summary | |
static java.lang.String |
AFTERMAX_DEVICE If maximum is reached, send it to another device |
static java.lang.String |
AFTERMAX_DISCARD If maximum is reached, discard alerts |
static java.lang.String |
AFTERMAX_PILEUP If maximum is reached, pile alerts for retrieval through some other means (NOT IMPLEMENTED IN THIS RELEASE). |
static int |
TYPEID The typeid of the subscription object |
static java.lang.String |
TYPENAME The typename of the Subscription XML object |
Fields inherited from interface oracle.wireless.billing.BillingContext |
ALERT_COMPONENT, MESSAGING_COMPONENT, PROVISIONING_COMPONENT, PUSH_COMPONENT, RUNTIME_COMPONENT |
Method Summary | |
DeviceAddress |
getAlternativeDevice() Returns the alternative device for sending alerts when max is reached. |
java.lang.String |
getAlternativeType() Returns what alert engine will do if max number of alerts is reached. |
AlertConditionValue[] |
getConditions() Returns an array of condition values for this subscription |
java.lang.String |
getDisplayName() Returns the display name |
int |
getEndHour() Returns the end hour for interval type subscriptions |
int |
getEndMinute() Returns the end minute for this subscription (Used for interval type subscriptions) |
java.util.Calendar |
getExpirationDate() Returns the subscription expiration date |
java.lang.String |
getExternalUId() Returns external system user id, used for billing purposes! |
AlertTimeFrequency |
getFrequency() Returns the frequency with which Subscription is scheduled to alert |
int |
getHour() Returns the hour for which the susbscription is scheduled to receive an alert |
long |
getId() Returns the subscription id. |
AlertInputParamValue[] |
getInputParameters() Returns an array of input param values for this subscription |
int |
getInterval() Returns the alert sending interval in minutes between the start and end times |
Link |
getLink() Returns the link that user has subscribed to. |
LBCondition |
getLocationCondition() Returns the location condition for this subscription |
MAlertServiceMapping |
getMapping() Returns the mapping definition for this subscription. |
int |
getMinute() Returns the minute for which the Susbscription is scheduled to receive alert |
int |
getPriority() Returns the priority for this subscription (NOT IMPLEMENTED IN THIS VERSION) |
java.util.Calendar |
getStartDate() Returns when this subscription will be activated |
DeviceAddress |
getSubscriptionDevice() Returns the device address that will receive this alert |
java.util.Calendar |
getSuspendEndDate() Returns the suspend end date for this alert |
java.util.Calendar |
getSuspendStartDate() Returns the suspend start date for this alert |
User |
getUser() Returns the user owning this subscription. |
boolean |
isArmed() Returns if the subscription is active or suspended. |
void |
removeAlternativeDevice() Removes the alternative device |
void |
removeSubscriptionDevice() Removes the device that will receive this alert, alerts will be sent to the default device if removed! |
void |
save() Commits any changes to the database. |
void |
setAlternativeDevice(DeviceAddress deviceAddress) Sets the alternative device for sending alerts when max is reached. |
void |
setAlternativeType(java.lang.String type) Sets what alert engine should do if max number of alerts is reached. |
void |
setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds) Sets the condition |
void |
setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, java.util.Calendar expireAt, java.util.Calendar startAt) Sets the condition with start/expiration date set |
void |
setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, int hour, int minute, int endhr, int endmin, int intervl, AlertTimeFrequency frequency) Sets the condition for time based alerts |
void |
setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, int hour, int minute, int endhr, int endmin, int intervl, AlertTimeFrequency frequency, java.util.Calendar expireAt, java.util.Calendar startAt) Sets the condition for time based alerts with the start/expiration date set |
void |
setDisplayName(java.lang.String aDisplayName) Sets the display name |
void |
setEndHour(int hour) Sets the end hour for this subscription (Used by interval type subscriptions) |
void |
setEndMinute(int minute) Sets the end minute for this subscription (Used for interval type subscriptions) |
void |
setExpirationDate(java.util.Calendar expireAt) Sets the subscription expiration date |
void |
setExternalUId(java.lang.String xUID) Sets external system user id, used for billing purposes! |
void |
setFrequency(AlertTimeFrequency frequency) Sets the alert frequency. |
void |
setHour(int hour) Sets the hour for which the susbscription is scheduled to receive an alert |
void |
setInterval(int minute) Sets the alert sending interval in minutes between the start and end times |
void |
setLocationCondition(LBCondition lbCondition) Sets the location condition for location based alerts |
void |
setMinute(int minute) Sets the minute for which the Susbscription is scheduled to receive alert |
void |
setPriority(int priority) Sets the priority for this subscription (NOT IMPLEMENTED IN THIS VERSION) |
void |
setStartDate(java.util.Calendar startAt) Sets when this subscription will be activated |
void |
setSubscriptionDevice(DeviceAddress deviceAddress) Sets the device address that will receive this alert |
void |
setSuspendEndDate(java.util.Calendar suspendExpireOn) Sets the suspend end date for this alert |
void |
setSuspendStartDate(java.util.Calendar suspendOn) Sets the suspend start date for this alert |
Methods inherited from interface oracle.panama.model.ModelObject |
delete, getCreatedDate, getLastModifiedDate, getName, getTypeId, getTypeName, isSystem, setName, setSystem, undoAll |
Methods inherited from interface oracle.panama.model.XMLObject |
setXML, toXML |
Field Detail |
public static final java.lang.String AFTERMAX_DEVICE
public static final java.lang.String AFTERMAX_DISCARD
public static final java.lang.String AFTERMAX_PILEUP
public static final int TYPEID
public static final java.lang.String TYPENAME
Method Detail |
public DeviceAddress getAlternativeDevice() throws PanamaException
PanamaException
public java.lang.String getAlternativeType() throws PanamaException
AFTERMAX_DEVICE
and AFTERMAX_DISCARD
PanamaException
public AlertConditionValue[] getConditions()
public java.lang.String getDisplayName()
public int getEndHour()
public int getEndMinute()
public java.util.Calendar getExpirationDate()
public java.lang.String getExternalUId()
public AlertTimeFrequency getFrequency()
public int getHour()
public long getId()
getId
in interface ModelObject
public AlertInputParamValue[] getInputParameters()
public int getInterval()
public Link getLink()
public LBCondition getLocationCondition()
public MAlertServiceMapping getMapping()
public int getMinute()
public int getPriority() throws PanamaException
PanamaException
public java.util.Calendar getStartDate()
public DeviceAddress getSubscriptionDevice() throws PanamaException
PanamaException
public java.util.Calendar getSuspendEndDate()
public java.util.Calendar getSuspendStartDate()
public User getUser()
public boolean isArmed()
public void removeAlternativeDevice() throws PanamaException
PanamaException
public void removeSubscriptionDevice() throws PanamaException
PanamaException
public void save() throws PanamaException, BillingException
PanamaException
BillingException
public void setAlternativeDevice(DeviceAddress deviceAddress) throws PanamaException
deviceAddress
- Alternative device addressPanamaException
public void setAlternativeType(java.lang.String type) throws PanamaException
AFTERMAX_DEVICE
and AFTERMAX_DISCARD
type
- Alternative typePanamaException
public void setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds) throws PanamaException
params
- Array of parameter valuesconds
- Array of condition valuesPanamaException
public void setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, java.util.Calendar expireAt, java.util.Calendar startAt) throws PanamaException
params
- Array of parameter valuesconds
- Array of condition valuesexpireAt
- a Calendar object for subscription expiration date, null means never expiresstartAt
- a Calendar object for subscription start date, if null starts immediatelyPanamaException
public void setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, int hour, int minute, int endhr, int endmin, int intervl, AlertTimeFrequency frequency) throws PanamaException
params
- Array of parameter valuesconds
- Array of condition valueshour
- Hour of next alertminute
- Minute of next alertendhr
- End hour for interval based alerts (-1 if not applicable)endmin
- End minute for interval based alerts (-1 if not applicable)intervl
- Interval in minutes for interval based alerts(-1 if not applicable)frequency
- AlertFrequencyPanamaException
- when setCondition failspublic void setCondition(AlertInputParamValue[] params, AlertConditionValue[] conds, int hour, int minute, int endhr, int endmin, int intervl, AlertTimeFrequency frequency, java.util.Calendar expireAt, java.util.Calendar startAt) throws PanamaException
params
- Array of parameter valuesconds
- Array of condition valueshour
- Hour of next alertminute
- Minute of next alertendhr
- End hour for interval based alerts (-1 if not applicable)endmin
- End minute for interval based alerts (-1 if not applicable)intervl
- Interval for interval based alerts in minutes (-1 if not applicable)frequency
- AlertFrequencyexpireAt
- A Calendar object for subscription expiration date, null means never expiresstartAt
- A Calendar object for subscription start date, null means start immediatelyPanamaException
- when set condition failspublic void setDisplayName(java.lang.String aDisplayName)
aDisplayName
- The display name of the subscriptionpublic void setEndHour(int hour) throws PanamaException
hour
- end hour of the end timePanamaException
public void setEndMinute(int minute) throws PanamaException
minute
- end minute for the end timePanamaException
public void setExpirationDate(java.util.Calendar expireAt)
expireAt
- expiration datepublic void setExternalUId(java.lang.String xUID)
xUID
- external user idpublic void setFrequency(AlertTimeFrequency frequency) throws PanamaException
frequency
- Alert frequencyPanamaException
public void setHour(int hour) throws PanamaException
hour
- hourPanamaException
public void setInterval(int minute) throws PanamaException
minute
- interval in minutesPanamaException
public void setLocationCondition(LBCondition lbCondition) throws PanamaException
lbCondition
- location condition objectPanamaException
- when set location condition failspublic void setMinute(int minute) throws PanamaException
minute
- minutePanamaException
public void setPriority(int priority) throws PanamaException
priority
- PriorityPanamaException
public void setStartDate(java.util.Calendar startAt)
startAt
- Start date for this subscriptionpublic void setSubscriptionDevice(DeviceAddress deviceAddress) throws PanamaException
deviceAddress
- address of the devicePanamaException
public void setSuspendEndDate(java.util.Calendar suspendExpireOn) throws PanamaException
suspendExpireOn
- date to end suspending this alertPanamaException
public void setSuspendStartDate(java.util.Calendar suspendOn) throws PanamaException
suspendOn
- date to start suspending this alertPanamaException
|
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 |