oracle.sysman.dbTarget.db.changemgr.emo.cpapi
Class ChangePlan

java.lang.Object
  extended by oracle.sysman.dbTarget.db.changemgr.emo.cpapi.ChangePlanInfo
      extended by oracle.sysman.dbTarget.db.changemgr.emo.cpapi.ChangePlan

public class ChangePlan
extends ChangePlanInfo

ChangePlan provides methods that allow a client to access and manipulate a single Change Manager Change Plan. To use this class:


Method Summary
 void addChangeItem(ChangeItem item)
          Adds a change item to the Change Plan.
 ChangeItemInfo[] getChangeItems()
          Gets a list of change items contained in the Change Plan.
 ChangeItem getOneChangeItem(ChangeItemInfo itemInfo)
          Gets the contents of a single change item from the Change Plan.
 java.lang.String getPostScript()
          Returns the script that executes at the destination database after the script that is generated to carry out the the actions of the change items.
 java.lang.String getPreScript()
          Returns the script that executes at the destination database before the script that is generated to carry out the the actions of the change items.
 void removeChangeItem(ChangeItemInfo itemInfo)
          Removes a change item from the Change Plan.
 void setPostScript(java.lang.String script)
          Establishes a script that is executed at the destination database after the script that is generated to carry out the the actions of the change items.
 void setPreScript(java.lang.String script)
          Establishes a script that is executed at the destination database before the script that is generated to carry out the the actions of the change items.
 java.lang.String toString()
           
 void updateChangeItem(ChangeItem item)
          Updates the content of an existing change item in the Change Plan.
 int userActionAllowed(int userAction)
          Indicates whether a specified action can be performed by the logged-in user on this Change Plan.
 
Methods inherited from class oracle.sysman.dbTarget.db.changemgr.emo.cpapi.ChangePlanInfo
getPlanDescription, getPlanName, getPlanOwner, setPlanDescription, setPlanName, setPlanOwner
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getChangeItems

public ChangeItemInfo[] getChangeItems()
                                throws ChangePlanAccessException,
                                       java.sql.SQLException
Gets a list of change items contained in the Change Plan.

Returns:
an array of ChangeItemInfo objects, each of which contains the action, object type, name, and schema of a change item.
Throws:
java.sql.SQLException - if an unexpected SQLException occurs
ChangePlanAccessException

getOneChangeItem

public ChangeItem getOneChangeItem(ChangeItemInfo itemInfo)
                            throws ChangePlanAccessException,
                                   java.sql.SQLException
Gets the contents of a single change item from the Change Plan.

Parameters:
itemInfo - a ChangeItemInfo object identifying the change item to be retrieved.
Returns:
a ChangeItem object containing the change item's definition and other attributes in addition to its identifying information.
Throws:
ChangePlanAccessException - if the specified change item does not exist, or if the logged-in user does not have permission to view the specified change item.
java.sql.SQLException - if an unexpected SQLException occurs

addChangeItem

public void addChangeItem(ChangeItem item)
                   throws ChangePlanAccessException,
                          java.sql.SQLException
Adds a change item to the Change Plan.

Parameters:
item - a ChangeItem object containing all the information needed to initialize a change item of the specified action type.
Throws:
ChangePlanAccessException - if the specified change item already exists, if arguments required to create change items of the specified action type are omitted, or if the logged-in user does not have permission to add the specified change item.
java.sql.SQLException - if an unexpected SQLException occurs

updateChangeItem

public void updateChangeItem(ChangeItem item)
                      throws ChangePlanAccessException,
                             java.sql.SQLException
Updates the content of an existing change item in the Change Plan.

NOTE: The current design of this package assumes that XML comparison and change conflict detection take place in the client-side code, that is, when the ChangeItem is created or updated. If this is not the case, comparison and conflict detection will take place in the CM mid-tier code running in the EM server. In that case, this method will need to return a list of conflicts detected (if any) and the update operation will fail if any conflicts are detected.

Parameters:
item - a ChangeItem object containing the updated change item information'
Throws:
ChangePlanAccessException - if the specified change item does not exist, if arguments required to update change items of the specified action type are omitted, or if the logged-in user does not have permission to update the specified change item.
java.sql.SQLException - if an unexpected SQLException occurs

removeChangeItem

public void removeChangeItem(ChangeItemInfo itemInfo)
                      throws ChangePlanAccessException,
                             java.sql.SQLException
Removes a change item from the Change Plan.

Parameters:
itemInfo - a ChangeItemInfo object identifying the change item to be removed.
Throws:
ChangePlanAccessException - if the specified change item does not exist, or if the logged-in user does not have permission to remove the specified change item.
java.sql.SQLException - if an unexpected SQLException occurs

userActionAllowed

public int userActionAllowed(int userAction)
                      throws ChangePlanAccessException,
                             java.sql.SQLException
Indicates whether a specified action can be performed by the logged-in user on this Change Plan. (This method needs work.)

Parameters:
userAction - Specifies the desired action:
  • CP_ADD_CHANGE_ITEM: Can the user add a change item to the Change Plan
  • CP_VIEW_CHANGE_ITEM: Can the user view the detailed information for change item in the Change Plan
  • CP_REMOVE_CHANGE_ITEM: Can the user remove a change item from the Change Plan
  • CP_UPDATE_CHANGE_ITEM: Can the user update a change item in the Change Plan
Returns:
  • CP_ACTION_ALLOWED
  • CP_ACTION_NOT_ALLOWED
  • CP_ACTION_NOT_APPLICABLE: Action is not applicable given the current state of the ChangePlan.
Throws:
ChangePlanAccessException
java.sql.SQLException

setPreScript

public void setPreScript(java.lang.String script)
                  throws java.sql.SQLException
Establishes a script that is executed at the destination database before the script that is generated to carry out the the actions of the change items.

Parameters:
script - the script to be executed.
Throws:
ChangePlanAccessException - if the logged-in user does not have permission to add the script.
java.sql.SQLException - if an unexpected SQLException occurs.

getPreScript

public java.lang.String getPreScript()
                              throws java.sql.SQLException
Returns the script that executes at the destination database before the script that is generated to carry out the the actions of the change items.

Returns:
the script to be executed, or null if no script has been set.
Throws:
java.sql.SQLException - if an unexpected SQLException occurs.

setPostScript

public void setPostScript(java.lang.String script)
                   throws java.sql.SQLException
Establishes a script that is executed at the destination database after the script that is generated to carry out the the actions of the change items.

Parameters:
script - the script to be executed.
Throws:
ChangePlanAccessException - if the logged-in user does not have permission to add the script.
java.sql.SQLException - if an unexpected SQLException occurs.

getPostScript

public java.lang.String getPostScript()
                               throws java.sql.SQLException
Returns the script that executes at the destination database after the script that is generated to carry out the the actions of the change items.

Returns:
the script to be executed, or null if no script has been set.
Throws:
java.sql.SQLException - if an unexpected SQLException occurs.

toString

public java.lang.String toString()
Overrides:
toString in class ChangePlanInfo