© 2001 BEA Systems, Inc.

com.bea.commerce.campaign
Interface ScenarioRepository


public interface ScenarioRepository

Scenario repository EJB object interface.


Method Summary
 boolean deleteScenario(java.lang.String scenarioId)
          Permanently delete a scenario.
 java.util.Collection findScenarioInfo(java.lang.String query, java.lang.String sortBy, int max)
          Get a list of ScenarioInfos that match the query.
 java.lang.String getScenario(java.lang.String scenarioId)
          Get the XML of the specified scenario.
 boolean setScenario(java.lang.String scenario)
          Set the XML of the specified scenario.
 

Method Detail

findScenarioInfo

public java.util.Collection findScenarioInfo(java.lang.String query,
                                             java.lang.String sortBy,
                                             int max)
                                      throws java.lang.IllegalArgumentException,
                                             javax.ejb.EJBException,
                                             java.rmi.RemoteException
Get a list of ScenarioInfos that match the query.

The following property names are allowed in the query string:

Example Queries:

The sortBy may reference any of the previously listed property names, except for 'validClassifications'.

Parameters:
query - the query string.
sortBy - the sorting clause.
max - the maximum number to return (<= 0 for all).
Returns:
a list of ScenarioInfo objects.
Throws:
java.lang.IllegalArgumentException - thrown on an invalid query or sortBy string.
EJBException - thrown on an error.
java.rmi.RemoteException - thrown on a communications error.

getScenario

public java.lang.String getScenario(java.lang.String scenarioId)
                             throws javax.ejb.EJBException,
                                    java.rmi.RemoteException
Get the XML of the specified scenario.
Parameters:
scenarioId - the id of the scenario.
Returns:
the scenario's XML, or null on no such scenario.
Throws:
EJBException - thrown on an error.
java.rmi.RemoteException - thrown on a communications error.

setScenario

public boolean setScenario(java.lang.String scenario)
                    throws java.lang.IllegalArgumentException,
                           javax.ejb.EJBException,
                           java.rmi.RemoteException
Set the XML of the specified scenario.

The scenario XML should be in UTF-8. Additionally, the top-level scenario tag should have an xsi:schemaLocation for 'scenario.xsd'.

Parameters:
scenario - the XML of the scenario.
Returns:
true if the scenario was modified, false if it was created.
Throws:
java.lang.IllegalArgumentException - throw on invalid XML.
EJBException - thrown on an error.
java.rmi.RemoteException - thrown on a communications error.

deleteScenario

public boolean deleteScenario(java.lang.String scenarioId)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
Permanently delete a scenario.

This will remove the scenario definition from the repository, making the scenario no longer available.

Parameters:
scenarioId - the id of the scenario.
Returns:
true if the scenario was removed, false if it did not exist.
Throws:
EJBException - thrown on an error.
java.rmi.RemoteException - thrown on a communications error.

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved