oracle.panama.alert
Interface MasterAlertService

All Superinterfaces:
ModelObject, XMLObject

public interface MasterAlertService
extends ModelObject

Interface exposes the master alert service features

Master Alert is created on a datafeeder. The feeder data is filtered by adding conditions on the feeder's output parameters. The master alert is further customized for the different inputs by creating Alerts on the Master Alert.

 Sample usage example.

  	MetaLocator m = MetaLocator.getInstance();

  	ModelFactory f = m.getModelFactory();

  	ModelServices s = m.getModelServices();

  	// use feed locator get the datafeeder information
  	DataFeeder df = s.lookupDataFeeder("StockFeed")

  	try {
  	  // create a master alert with time base enabled
  	  stockMS = f.createMasterAlertService("StockAlert", true, " Stock Master Alert", df);
  	  stockMS.save();
  	} catch (PanamaException pe) {
  	  System.out.println(pe.toString());
  	}

  	FeedMetaData fmdPrice = df.getOutputParameter("price");
      AlertConditionType actGT = s.getAlertConditionTypeByName("GT");
  	// add some conditions to the master alert
  	AlertConditionMeta m1 = stockMS.addConditionDefinition("price_max", fmdPrice, actGT, "30");
      AlertConditionType actLT = s.getAlertConditionTypeByName("LT");
  	AlertConditionMeta m2 = stockMS.addConditionDefinition("price_min", fmdPrice, actLT, "15");


  	// any create/update operation must be committed with the save. Alert object do not use the wireless caching/persistence framework
  	stockMS.save();

  	// Lookup condition definitions
  	AlertConditionMeta[] acm = stockMS.getConditionDefinitions();
  	for (int i=0; iDataFeeder, 
FeedMetaData, 
ModelObject

Field Summary
TypeField
static int TYPEID
          The typeid of the topic object
static java.lang.String TYPENAME
          The typename of the topic object
 
Method Summary
TypeMethod
 AlertConditionMeta addConditionDefinition(java.lang.String name, FeedMetaData param, AlertConditionType type, java.lang.String defaultValue)
          Add a new condition to this master alert service
 void addFilteringHookClassName(java.lang.String filteringHookClassName)
          Add a filtering hook class name
 void delete()
          Delete the master alert service
 void enableTimeBaseAlert(boolean enabled)
          Enables time base
 AlertConditionMeta[] getConditionDefinitions()
          Gets the condition meta data
 DataFeeder getDataFeeder()
          Get the data feeder object used by the master alert
 java.lang.String getDescription()
          Get description for the master alert
 java.lang.String[] getFilteringHookClassNames()
          Returns the filtering hook class names
 java.lang.String getFormattedHookClassName()
          Get the format hook class name
 java.lang.String getFormattedXMLTemplate()
          Get the formatted xml template
 long getId()
          Get the Master Alert id
 AlertInputParamMeta[] getInputParameters()
          Gets the input parameter meta data
 java.lang.String getName()
          Get the master alert name
 boolean isAlertPersonalizabled()
          Checks if the master alert is personalizable
 boolean isDeviceTranscodeRequired()
          Checks if device transcode is required
 boolean isTimeBaseEnabled()
          Checks if time base is enabled
 void removeCondition(AlertConditionMeta condition)
          Removes the condition for the master alert
 void removeFilteringHookClassName(java.lang.String filteringHookClassName)
          Removes the filtering hook class name
 void removeFormattingHookClassName(java.lang.String formattingHookClassName)
          Removes the formatting hook class name
 void save()
          Commits the changes to the database Any create/update operation must be committed with the save.
 void setDescription(java.lang.String desc)
          Set description for the Master Alert Service
 void setFormattedHookName(java.lang.String formattedHookClassName)
          Set the format hook class name
 void setFormattedXMLTemplate(java.lang.String simpleResultXml)
          Set the formatted xml template for this master service
 
Methods inherited from interface oracle.panama.model.ModelObject
getCreatedDate, getLastModifiedDate, getTypeId, getTypeName, isSystem, setName, setSystem, undoAll
 
Methods inherited from interface oracle.panama.model.XMLObject
setXML, toXML
 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
The typename of the topic object

TYPEID

public static final int TYPEID
The typeid of the topic object
Method Detail

getId

public long getId()
Get the Master Alert id
Specified by:
getId in interface ModelObject
Returns:
long the id of the master alert

getName

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

getFormattedXMLTemplate

public java.lang.String getFormattedXMLTemplate()
Get the formatted xml template
Returns:
String The formatted xml template against this master service

setFormattedXMLTemplate

public void setFormattedXMLTemplate(java.lang.String simpleResultXml)
                             throws PanamaException
Set the formatted xml template for this master service
Parameters:
simpleResultXml - the String contaning the formatted xml
Throws:
PanamaException - Exception thrown when the set formatted xml failed

getFormattedHookClassName

public java.lang.String getFormattedHookClassName()
Get the format hook class name
Returns:
the format hook class name

setFormattedHookName

public void setFormattedHookName(java.lang.String formattedHookClassName)
                          throws PanamaException
Set the format hook class name
Parameters:
formattedHookClassName - String containg the format hook class name
Throws:
PanamaException - Exception thrown when the setting failed

getFilteringHookClassNames

public java.lang.String[] getFilteringHookClassNames()
Returns the filtering hook class names
Returns:
String[] array of filtering hook class names

addFilteringHookClassName

public void addFilteringHookClassName(java.lang.String filteringHookClassName)
                               throws PanamaException
Add a filtering hook class name
Parameters:
filteringHookClassName - the class name
Throws:
PanamaException - exception thrown when addition failed

removeFilteringHookClassName

public void removeFilteringHookClassName(java.lang.String filteringHookClassName)
                                  throws PanamaException
Removes the filtering hook class name
Parameters:
filteringHookClassName - the filtering hook class name
Throws:
PanamaException - exception thrown when remove failed

removeFormattingHookClassName

public void removeFormattingHookClassName(java.lang.String formattingHookClassName)
                                   throws PanamaException
Removes the formatting hook class name
Parameters:
formattingHookClassName - the formatting hook class name
Throws:
PanamaException - exception thrown when remove failed

isAlertPersonalizabled

public boolean isAlertPersonalizabled()
Checks if the master alert is personalizable
Returns:
boolean if personalizable then return true

isDeviceTranscodeRequired

public boolean isDeviceTranscodeRequired()
Checks if device transcode is required
Returns:
boolen true if device transcode is required

isTimeBaseEnabled

public boolean isTimeBaseEnabled()
Checks if time base is enabled
Returns:
boolean true if time base is enabled

enableTimeBaseAlert

public void enableTimeBaseAlert(boolean enabled)
                         throws PanamaException
Enables time base
Parameters:
enabled - set to true to enable, false to disable
Throws:
PanamaException - Exception when enabling failed

getInputParameters

public AlertInputParamMeta[] getInputParameters()
Gets the input parameter meta data
Returns:
AlertInputParamMeta[] Array of input param meta data

getConditionDefinitions

public AlertConditionMeta[] getConditionDefinitions()
Gets the condition meta data
Returns:
AlertConditionMeta[] Array of condition meta data

addConditionDefinition

public AlertConditionMeta addConditionDefinition(java.lang.String name,
                                                 FeedMetaData param,
                                                 AlertConditionType type,
                                                 java.lang.String defaultValue)
                                          throws PanamaException
Add a new condition to this master alert service
Parameters:
name - Name of the condition
param - FeedMetaData object for the parameter
type - AlertConditionType the alert condition type
defaultValue - String containing the default value
Throws:
PaanamaException - the exception thrown when addition failed

getDataFeeder

public DataFeeder getDataFeeder()
Get the data feeder object used by the master alert
Returns:
DataFeeder the data feeder object

removeCondition

public void removeCondition(AlertConditionMeta condition)
                     throws PanamaException
Removes the condition for the master alert
Parameters:
condition - AlertConditionMeta condition object to remove
Throws:
PanamaException - exception thrown when remove condition failed

save

public void save()
          throws PanamaException
Commits the changes to the database Any create/update operation must be committed with the save. Alert objects does not use the wireless caching/persistence framework
Throws:
PanamaException - the exception when commit failed

delete

public void delete()
Delete the master alert service
Specified by:
delete in interface ModelObject

setDescription

public void setDescription(java.lang.String desc)
Set description for the Master Alert Service
Parameters:
desc - The description

getDescription

public java.lang.String getDescription()
Get description for the master alert
Returns:
String The description associated with the master alert