oracle.panama.alert
Interface AlertService

All Superinterfaces:
ModelObject, XMLObject

public interface AlertService
extends ModelObject

Interface provides the alert service functionality

Alert is created on a Master Alert. The master alert is further customized for the different inputs by creating Alerts on the Master Alert. A user creates a subscription on an alert by defining his/her own conditions and time frequencies

Usage Example:

  	ModelServices s = m.getModelServices();

  	MasterAlertService mas = s.lookupMasterAlertService("stock_masteralert");

  	AlertService as = f.createAlertService("stock_alert", mas);

  	//lookup user
  	User u = m.lookupUser("John");

  	UserAlertSubscription subs = as.addUserAlertSubscription(u);

  	 //... get all subscriptions 
       //retrieving subscsription
       UserAlertSubscription[] mysubs = as.getUserAlertSubscriptions(u);
       for (int i=0;i

See Also:
UserAlertSubscription

Field Summary
TypeField
static int TYPEID
          Type id for the Alert Service
static java.lang.String TYPENAME
          Type name for the Alert service
 
Method Summary
TypeMethod
 UserAlertSubscription addUserAlertSubscription(User user)
          Add a new user alert subscription for this alert service
 AlertConditionMeta[] getConditionDefinitions()
          Get the conditions defined for the Alert service
 Group[] getGroups()
          Returns the groups which can access this Alert Service
 long getId()
          Get the id for the alert service
 AlertInputParamMeta[] getInputParameters()
          Get the input parameters
 MasterAlertService getMasterAlertService()
          Get the master alert service object
 java.lang.String getName()
          Get the alert service name
 Topic[] getParentTopics()
          Gets the list of topics to which this alert service belongs to
 DeviceAddress getUserAlertDevice(User user)
           
 UserAlertSubscription[] getUserAlertSubscriptions(User user)
          Get the User alert subscriptions for this user
 UserAlertSubscription lookupUserAlertSubscription(User user, long subscriptionId)
          Lookup a subscrption object
 void removeUserAlertDevice(User user)
           
 void removeUserAlertSubscription(UserAlertSubscription sub)
          Remove the user alert subscription
 void resumeUserAlertSubscription(UserAlertSubscription sub)
          Resume the user alert subscription
 void save()
           
 void setName(java.lang.String name)
          Set the name of the alert service
 void setUserAlertDevice(DeviceAddress deviceAddress)
          Set user alert device for this alert service Add or Update user alert device setting, user should have only one alert device per service
 void suspendUserAlertSubscription(UserAlertSubscription sub)
          Suspend user alert subscription
 
Methods inherited from interface oracle.panama.model.ModelObject
delete, getCreatedDate, getLastModifiedDate, getTypeId, getTypeName, isSystem, setSystem, undoAll
 
Methods inherited from interface oracle.panama.model.XMLObject
setXML, toXML
 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
Type name for the Alert service

TYPEID

public static final int TYPEID
Type id for the Alert Service
Method Detail

getId

public long getId()
Get the id for the alert service
Specified by:
getId in interface ModelObject
Returns:
long Id of the alert service

getName

public java.lang.String getName()
Get the alert service name
Specified by:
getName in interface ModelObject
Returns:
String Name of the Alert service

getMasterAlertService

public MasterAlertService getMasterAlertService()
Get the master alert service object
Returns:
MasterAlertService returns the master alert service

getInputParameters

public AlertInputParamMeta[] getInputParameters()
                                         throws PanamaException
Get the input parameters
Returns:
AlertInputParamMeta[] returns an array of input parameters

getConditionDefinitions

public AlertConditionMeta[] getConditionDefinitions()
                                             throws PanamaException
Get the conditions defined for the Alert service
Returns:
AlertConditionMeta[] return an array of condition definitions

setName

public void setName(java.lang.String name)
Set the name of the alert service
Specified by:
setName in interface ModelObject
Throws:
PanamaException - when setting failed

getUserAlertSubscriptions

public UserAlertSubscription[] getUserAlertSubscriptions(User user)
Get the User alert subscriptions for this user
Parameters:
user - The user object
Returns:
UserAlertSubscription[] array of subscription objects

addUserAlertSubscription

public UserAlertSubscription addUserAlertSubscription(User user)
                                               throws PanamaException
Add a new user alert subscription for this alert service
Parameters:
user - The user for this this subscription is created
AlertInputParamValue[] - The alert input param array
AlertConditionValue[] - The alert input condition array
Returns:
UserAlertSubscription The user alert subscription object

removeUserAlertSubscription

public void removeUserAlertSubscription(UserAlertSubscription sub)
                                 throws PanamaException
Remove the user alert subscription
Parameters:
UserAlertSubscription - The subscription object to remove
Throws:
PanamaException - Exception thrown when remove failed

suspendUserAlertSubscription

public void suspendUserAlertSubscription(UserAlertSubscription sub)
                                  throws PanamaException
Suspend user alert subscription
Parameters:
UserAlertSubscription - The subscription object to suspend
Throws:
PanamaException - Exception thrown when suspend operation failed

resumeUserAlertSubscription

public void resumeUserAlertSubscription(UserAlertSubscription sub)
                                 throws PanamaException
Resume the user alert subscription
Parameters:
UserAlertSubscription - The subscription object to remove
Throws:
PanamaException - Exception thrown when resume operation failed

setUserAlertDevice

public void setUserAlertDevice(DeviceAddress deviceAddress)
                        throws PanamaException
Set user alert device for this alert service Add or Update user alert device setting, user should have only one alert device per service
Parameters:
deviceAddress - The alert address of the user

getUserAlertDevice

public DeviceAddress getUserAlertDevice(User user)
                                 throws PanamaException

removeUserAlertDevice

public void removeUserAlertDevice(User user)
                           throws PanamaException

save

public void save()

lookupUserAlertSubscription

public UserAlertSubscription lookupUserAlertSubscription(User user,
                                                         long subscriptionId)
                                                  throws PanamaException
Lookup a subscrption object
Parameters:
user - the user owning the subscription
subscriptionId - the id of the subscription
Throws:
PanamaException - if the UserAlertSubscription cannot be found

getParentTopics

public Topic[] getParentTopics()
                        throws PanamaException
Gets the list of topics to which this alert service belongs to
Throws:
PanamaException - on error

getGroups

public Group[] getGroups()
Returns the groups which can access this Alert Service