psdi.app.ci

Class CIStatusHandler

  • All Implemented Interfaces:
    MboConstants


    public class CIStatusHandler
    extends StatusHandler
    Handles all the status changes for a CI object
    • Constructor Detail

      • CIStatusHandler

        public CIStatusHandler(StatefulMbo sm)
        Constructor
    • Method Detail

      • checkStatusChangeAuthorization

        public void checkStatusChangeAuthorization(java.lang.String desiredExternalStatus)
                                            throws MXException,
                                                   java.rmi.RemoteException
        Checks to see if the user is authorised to make a status changes. In other words , it checks if the user has the required privilege to change the status. After ensuring that the user has the required privilege, this methods checks if the status change is legal.
        Specified by:
        checkStatusChangeAuthorization in class StatusHandler
        Parameters:
        currentExternalStatus - The current external status of the CI.
        desiredExternalStatus - The desired external status of the CI.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        checkUserSecurity, possibleStatusChange
      • checkUserSecurity

        public void checkUserSecurity(java.lang.String desiredMaxStatus)
                               throws MXException,
                                      java.rmi.RemoteException
        Check out the users security rights to call the specified status. Note the status passed in is the INTERNAL status code.
        Note that the SigOption Option Name doesn't always match the status name.
        Parameters:
        status - The status to check if we can change to.
        Throws:
        MXAccessException - Throws an access exception "notauthorized" if the check fails.
        MXException
        java.rmi.RemoteException
      • canChangeStatus

        public void canChangeStatus(java.lang.String currentStatus,
                                    java.lang.String desiredStatus,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Defines which status changes are legal. If a status change is not legal, an exception is thrown. This method does check user's security clearance in mbo level.
        Overrides:
        canChangeStatus in class StatusHandler
        Parameters:
        currentMaxStatus - CI's current status
        desiredStatus - Status to change to
        accessModifier - Flag which can be set to NOACCESSCHECK
        Throws:
        MXApplicationException - (ci, invalidstatus) is thrown if the desired status is not legal.
        MXException
        java.rmi.RemoteException
      • canNotready

        protected void canNotready(java.lang.String currentMaxStatus)
                            throws MXException,
                                   java.rmi.RemoteException
        Can change to Notready? This is an empty method implementation. Any business rules that need to be implemented before the CI can be changed to a status of NOTREADY , must be coded in this method.
        Throws:
        MXException
        java.rmi.RemoteException
      • canOperating

        protected void canOperating(java.lang.String currentMaxStatus)
                             throws MXException,
                                    java.rmi.RemoteException
        Can change to Operating? This is an empty method implementation. Any business rules that need to be implemented before the CI can be changed to a status of OPERATING , must be coded in this method.
        Throws:
        MXException
        java.rmi.RemoteException
      • canDecommission

        protected void canDecommission(java.lang.String currentMaxStatus)
                                throws MXException,
                                       java.rmi.RemoteException
        Can change to Discommissioned?
        Throws:
        MXException
        java.rmi.RemoteException
      • changeStatus

        public void changeStatus(java.lang.String currentStatus,
                                 java.lang.String desiredStatus,
                                 java.util.Date date,
                                 java.lang.String memo)
                          throws MXException,
                                 java.rmi.RemoteException
        Changes the status from the current state to a desired state.
        Overrides:
        changeStatus in class StatusHandler
        Parameters:
        currentMaxStatus - CI's current status
        desiredStatus - Status to change to
        date - Date as of the status change is to be made
        memo - memo text
        Throws:
        MXException
        java.rmi.RemoteException
      • postStatusChange

        public void postStatusChange(java.lang.String currentStatus,
                                     java.lang.String status,
                                     java.util.Date asOfDate,
                                     java.lang.String memo)
                              throws MXException,
                                     java.rmi.RemoteException
        This method is called by the framework's changestatus method. Any post processing that needs to be done after status changes must be included in this method.
        Overrides:
        postStatusChange in class StatusHandler
        Throws:
        MXException
        java.rmi.RemoteException