Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.mobilealert
Interface MAlertServiceMapping

All Superinterfaces:
java.io.Serializable

public interface MAlertServiceMapping
extends java.io.Serializable

This interface defines the mapping information between a master alert service and a master service. Alert Engine generates the notification message content by invoking a service. Hence, each master alert service has to be mapped to a service that will be used to generate the content. Also, it is possible to pass data that is available to the alert engine at runtime to the service. For this, master alert service input/output parameters can be mapped to the service input arguments. At runtime, values will be passed to the service using this parameter mapping.

 Sample Usage:
        //Locate the existing master notification service
        MasterAlertService mAS = s.lookupMobileMasterAlertService("StockNotification");

        //Locate the existing stock trade master service
        MasterService masterService = s.lookupMasterService("/master/examples/StockTradeMasterService");

        //Create the mapping definition between the notification service and master service
        MAlertServiceMapping map = mAS.createMapping(masterService, "StockNotificationMapping");

        //Retrieve input arguments for the master service
        Arguments args = masterService.getInputArguments();
        InputArgument inpArgTicker = args.getInput("symbol");
        InputArgument inpArgPrice  = args.getInput("price");

        //Retrieve notification parameters (including input and output)
        AlertParameterMeta[] alertParams = mAS.getParameters(); //returns symbol, price

        //Map notification master service parameter "symbol" to stock trade input argument "ticker?
        map.addChainParameter(alertParams[0], inpArgTicker);

        //Map notification master service parameter "price" to stock trade input argument "price"
        map.addChainParameter(alertParams[1], inpArgPrice);

        //This invocation has to be performed in ?personalized content mode?, for each user separately
        map.setInvocationType(false);

        //Commit changes
        mAS.save();
See Also:
AlertChainParamMeta

Field Summary
static boolean MASS_INVOKE
           
static boolean SEPARATE_INVOKE
           

 

Method Summary
 AlertChainParamMeta addChainParameter(AlertParameterMeta alertParam, InputArgument serviceParam)
          Add a parameter chaining for this mapping with the provided alert and service parameters.
 AlertChainParamMeta[] getChainParameters()
          Get all meta data for chained parameters
 long getId()
          Get the id for this mapping object
 boolean getInvocationType()
          Get invocation type
 MasterAlertService getMAlert()
          Get the MasterAlertService object that this mapping is created for
 java.lang.String getMappingName()
          Get the name for this mapping object
 MasterService getMasterService()
          Get the MasterService object that this mapping is created for
 boolean isChanged()
          Is this mapping definition changed after the last save
 void remove()
          Marks this mapping definiton as removed so that it can be removed at the next save() call.
 void removeChainParameter(AlertChainParamMeta param)
          Remove the specified chain parameter meta data for this mapping
 void save()
          Applies changes to the persistent store.
Note that this method DOES NOT perform a commit.
 void setInvocationType(boolean massInvocation)
          Sets the service invocation type.
 void setMappingName(java.lang.String mapName)
          Set the name of this mapping object

 

Field Detail

MASS_INVOKE

public static final boolean MASS_INVOKE
See Also:
Constant Field Values

SEPARATE_INVOKE

public static final boolean SEPARATE_INVOKE
See Also:
Constant Field Values
Method Detail

getId

public long getId()
Get the id for this mapping object
Returns:
long id

getMappingName

public java.lang.String getMappingName()
Get the name for this mapping object
Returns:
String mapping name

setMappingName

public void setMappingName(java.lang.String mapName)
Set the name of this mapping object
Parameters:
mapName - name for this mapping.

getMAlert

public MasterAlertService getMAlert()
Get the MasterAlertService object that this mapping is created for
Returns:
MasterAlertService master alert service

getMasterService

public MasterService getMasterService()
Get the MasterService object that this mapping is created for
Returns:
MasterService master service
See Also:
MasterService

getChainParameters

public AlertChainParamMeta[] getChainParameters()
                                         throws PanamaException
Get all meta data for chained parameters
Returns:
AlertChainParamMeta[] array of chain parameter meta data.
PanamaException

addChainParameter

public AlertChainParamMeta addChainParameter(AlertParameterMeta alertParam,
InputArgument serviceParam)
                                      throws PanamaException
Add a parameter chaining for this mapping with the provided alert and service parameters.
Parameters:
alertParam - source parameter retrieved from the master alert
serviceParam - target parameter retrieved from the master service
Returns:
AlertChainParamMeta created chain param meta data.
PanamaException

removeChainParameter

public void removeChainParameter(AlertChainParamMeta param)
                          throws PanamaException
Remove the specified chain parameter meta data for this mapping
Parameters:
param - chain param meta data to remove
PanamaException

setInvocationType

public void setInvocationType(boolean massInvocation)
Sets the service invocation type.
There are two types of service invocation: Mass invocation and separate invocation.
Mass Invocation is used in cases where the content generated by the service is not user specific and it can be shared among various users. For example, a weather service that returns the weather information for a given city can be invoked once for all usersthat requests the same city.
Separate invocation is used in cases where the content is user specific, and the service has to be invoked separately for each and every user. A typical example is a stock trading service, which has to be invoked separately for every user.
Mass Invocation improves the alert engine performance since it will decrease the number of service invocations!
Parameters:
massInvocation - true if the master service can be invoked for once in behalf of many users

getInvocationType

public boolean getInvocationType()
Get invocation type
Returns:
boolean true if the master service can be invoked for once in behalf of many users

isChanged

public boolean isChanged()
Is this mapping definition changed after the last save
Returns:
boolean true if changed

remove

public void remove()
Marks this mapping definiton as removed so that it can be removed at the next save() call.

save

public void save()
          throws PanamaException
Applies changes to the persistent store.
Note that this method DOES NOT perform a commit. MasterAlertService.save has to be called at the end to commit changes!
Throws:
PanamaException - exception thrown when save failes

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.