|
Oracle Application Server Wireless Java API Reference B10400-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, "Okan.Alper@oracle.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, 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! Possible options are AFTERMAX_DEVICE and AFTERMAX_DISCARD |
AlertConditionValue[] |
getConditions() Returns an array of condition values for with the Subscription |
java.lang.String |
getDisplayName() Returns the display name |
int |
getEndHour() Returns the end hour for interval type subscriptiona |
int |
getEndMinute() Returns the end minute for this subscription (Used for interval type subscriptions) |
java.util.Calendar |
getExpirationDate() Returns the subscription expiration date |
AlertTimeFrequency |
getFrequency() Returns the frequency with which Subscription is scheduled to alert |
int |
getHour() Returns the hour for which the Susbscription is scheduled to 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 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 alert |
int |
getPriority() Returns the priority for this subscription (NOT IMPLEMENTED IN THIS VERSION) return int priority |
java.util.Calendar |
getStartDate() Returns when this subscription will be activated |
DeviceAddress |
getSubscriptionDevice() Returns the device 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! Possible options are AFTERMAX_DEVICE and AFTERMAX_DISCARD |
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 the 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 alert case |
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 alert case 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 |
setFrequency(AlertTimeFrequency frequency) Sets the alert frequency. |
void |
setHour(int hour) Sets the hour of alert. |
void |
setInterval(int minute) Sets the alert sending interval 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 of alert. |
void |
setPriority(int priority) Sets the priority for this subscription (NOT IMPLEMENTED IN THIS VERSION) param priority priority |
void |
setStartDate(java.util.Calendar startAt) Sets when this subscription will be activated |
void |
setSubscriptionDevice(DeviceAddress deviceAddress) Sets the device 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_PILEUP
public static final java.lang.String AFTERMAX_DISCARD
public static final java.lang.String TYPENAME
public static final int TYPEID
Method Detail |
public long getId()
getId
in interface ModelObject
public MAlertServiceMapping getMapping()
public Link getLink()
public User getUser()
public AlertInputParamValue[] getInputParameters()
public AlertConditionValue[] getConditions()
public int getHour()
public void setHour(int hour) throws PanamaException
PanamaException
public int getMinute()
public void setMinute(int minute) throws PanamaException
PanamaException
public int getEndHour()
public void setEndHour(int hour) throws PanamaException
hour
- end hour of the end timePanamaException
public int getEndMinute()
public void setEndMinute(int minute) throws PanamaException
PanamaException
public int getInterval()
public void setInterval(int minute) throws PanamaException
PanamaException
public java.util.Calendar getSuspendStartDate()
public void setSuspendStartDate(java.util.Calendar suspendOn) throws PanamaException
PanamaException
public java.util.Calendar getSuspendEndDate()
public void setSuspendEndDate(java.util.Calendar suspendExpireOn) throws PanamaException
PanamaException
public void setSubscriptionDevice(DeviceAddress deviceAddress) throws PanamaException
PanamaException
public DeviceAddress getSubscriptionDevice() throws PanamaException
PanamaException
public void removeSubscriptionDevice() throws PanamaException
PanamaException
public void setAlternativeType(java.lang.String type) throws PanamaException
AFTERMAX_DEVICE
and AFTERMAX_DISCARD
PanamaException
public java.lang.String getAlternativeType() throws PanamaException
AFTERMAX_DEVICE
and AFTERMAX_DISCARD
PanamaException
public void setAlternativeDevice(DeviceAddress deviceAddress) throws PanamaException
PanamaException
public DeviceAddress getAlternativeDevice() throws PanamaException
PanamaException
public void removeAlternativeDevice() throws PanamaException
PanamaException
public int getPriority() throws PanamaException
PanamaException
public void setPriority(int priority) throws PanamaException
PanamaException
public AlertTimeFrequency getFrequency()
public void setFrequency(AlertTimeFrequency frequency) throws PanamaException
PanamaException
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, if null means never expiredstartAt
- a Calendar object for subscription start date, if null means start 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
- the hour of next alertendhr
- the end hour for interval based alerts (-1 if not applicable)endmin
- the end minute for interval based alerts (-1 if not applicable)intervl
- the interval for interval based alerts in minutes (-1 if not applicable)frequency
- the AlertFrequency of next alertPanamaException
- 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
- the hour of next alertendhr
- the end hour for interval based alerts (-1 if not applicable)endmin
- the end minute for interval based alerts (-1 if not applicable)intervl
- the interval for interval based alerts in minutes (-1 if not applicable)frequency
- the AlertFrequency of next alertexpireAt
- a Calendar object for subscription expiration date, if null means never expiresstartAt
- a Calendar object for subscription start date, if null means start immediatelyPanamaException
- when set condition failspublic void setLocationCondition(LBCondition lbCondition) throws PanamaException
lbCondition
- location conditionPanamaException
- when set location condition failspublic LBCondition getLocationCondition()
public boolean isArmed()
public java.util.Calendar getStartDate()
public void setStartDate(java.util.Calendar startAt)
startAt
- start date for this subscriptionpublic java.util.Calendar getExpirationDate()
public void setExpirationDate(java.util.Calendar expireAt)
expireAt
- expiration datepublic java.lang.String getDisplayName()
public void setDisplayName(java.lang.String aDisplayName)
aDisplayName
- The display name of the subscriptionpublic void save() throws PanamaException, BillingException
PanamaException
BillingException
|
Oracle Application Server Wireless Java API Reference B10400-01 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |