com.ibm.mashups.enabler.services
Interface StrategyService


public StrategyService

Interface allowing to set strategies without the need to actively fetch the model and set it.

Since:
3.0.0.1

Field Summary
 String SERVICE_NAME
           The service name to be used to fetch the service from the ServiceManager
 
Method Summary
 void setStrategy(String model, Strategy[] strategy)
           Sets the specified array of strategies or in case none has been defined falls back to the default strategy
 com.ibm.mashups.enabler.strategy.Strategy[] getStrategies(String model)
           Returns the array of strategies which are in use
 com.ibm.mashups.enabler.strategy.Strategy getStrategy(String model, strategy strategy)
           Returns the specified strategy
 int addStrategy(String model, Strategy strategy)
           Adds a strategy to the strategies array
 void removeStrategy(String model, strategy strategy)
           Removes the specified strategy
 

Field Detail

SERVICE_NAME

String SERVICE_NAME
The service name to be used to fetch the service from the ServiceManager

Method Detail

setStrategy

void setStrategy(String model,
                 Strategy[] strategy)
Sets the specified array of strategies or in case none has been defined falls back to the default strategy

Parameters:
model - class name of the model that strategy belongs to
strategy - array of strategies to set; may be null

getStrategies

com.ibm.mashups.enabler.strategy.Strategy[] getStrategies(String model)
Returns the array of strategies which are in use

Parameters:
model - class name of the model that strategy belongs to
Returns:
array of strategies in use, null if no strategies are in use

getStrategy

com.ibm.mashups.enabler.strategy.Strategy getStrategy(String model,
                                                      strategy strategy)
Returns the specified strategy

Parameters:
model - class name of the model that strategy belongs to
strategy - class name or array index of strategy
Returns:
strategy in use, null if no strategy with the specified type is in use

addStrategy

int addStrategy(String model,
                Strategy strategy)
Adds a strategy to the strategies array

Parameters:
model - class name of the model that strategy belongs to
strategy - strategy to add; must not be null
Returns:
index where the strategy was added in the strategies array

removeStrategy

void removeStrategy(String model,
                    strategy strategy)
Removes the specified strategy

Parameters:
model - class name of the model that strategy belongs to
strategy - class name or array index of the strategy; must not be null


Copyright IBM Corp. 2010 All Rights Reserved.