Oracle Application Server Wireless Java API Reference
B14043-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 for generating the content. Also, it is possible to pass data that is available to the alert engine at runtime to the service. For this purpose, 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.<BR/><BR/> Sample Usage:

 //Locate the existing master notification service
 MasterAlertService mAS = s.lookupMobileMasterAlertService("StockNotification");<BR/>
 //Locate the existing stock trade master service
 MasterService masterService = s.lookupMasterService("/master/examples/StockTradeMasterService");<BR/>
 //Create the mapping definition between the notification service and master service
 MAlertServiceMapping map = mAS.createMapping(masterService, "StockNotificationMapping");<BR/>
 //Retrieve input arguments for the master service
 Arguments args = masterService.getInputArguments();
 InputArgument inpArgTicker = args.getInput("symbol");
 InputArgument inpArgPrice  = args.getInput("price");<BR/>
 //Retrieve notification parameters (including input and output)
 AlertParameterMeta[] alertParams = mAS.getParameters(); //returns symbol, price<BR/>
 //Map notification master service parameter "symbol" to stock trade input argument "ticker?
 map.addChainParameter(alertParams[0], inpArgTicker);<BR/>
 //Map notification master service parameter "price" to stock trade input argument "price"
 map.addChainParameter(alertParams[1], inpArgPrice);<BR/>
 //This invocation has to be performed in ?personalized content mode?, for each user separately
 map.setInvocationType(false);<BR/>
 //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 meta data for all 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 from this mapping
void save()
Applies changes to the persistent store.
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

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:
Created chain parameter meta data object.
Throws:
PanamaException

getChainParameters

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

getId

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

getInvocationType

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

getMAlert

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

getMappingName

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

getMasterService

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

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.

removeChainParameter

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

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

setInvocationType

public void setInvocationType(boolean massInvocation)
Sets the service invocation type.
There are two types of service invocations: 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 users that request 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

setMappingName

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

Oracle Application Server Wireless Java API Reference
B14043-01


Copyright © 2004 Oracle Corporation. All Rights Reserved.