psdi.dm.pkg

Class DMPackage

    • Constructor Detail

      • DMPackage

        public DMPackage(MboSet ms)
                  throws java.rmi.RemoteException
        Construct the Pkg object
        Throws:
        java.rmi.RemoteException
    • Method Detail

      • add

        public void add()
                 throws MXException,
                        java.rmi.RemoteException
        Add a new package
        Specified by:
        add in interface MboRemote
        Overrides:
        add in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • canDelete

        public void canDelete()
                       throws MXException,
                              java.rmi.RemoteException
        Check if package can be deleted or not.
        Overrides:
        canDelete in class Mbo
        Throws:
        MXException
        java.rmi.RemoteException
      • delete

        public void delete(long accessModifier)
                    throws MXException,
                           java.rmi.RemoteException
        Description copied from class: Mbo
        Mark the object to be deleted depending on the access modifier. This will usually be overridden in the subclass of Mbo as there may be application specific rules as to if and when an object can be deleted. Object is not actually deleted in the database until save() is called. This method will also mark all associated Long Description and Translation Mbos for deletion.
        Specified by:
        delete in interface MboRemote
        Overrides:
        delete in class Mbo
        Parameters:
        accessModifier - The bitwise flag specified to determine if certain normal security checks are to be bypassed for this delete request. For example: if the accessModifer is NOACCESSCHECK, then the check for the object's NODELETE flag and the call to the object's canDelete() method will not be performed. If the accessModifer is NONE, then all the access checks are performed before this object is marked delete.
        Throws:
        MXException
        java.rmi.RemoteException
        See Also:
        Mbo.delete(long)
      • deleteForPreview

        public void deleteForPreview(long accessModifier)
                              throws MXException,
                                     java.rmi.RemoteException
        Delete package metadata to preview again.
        Specified by:
        deleteForPreview in interface DMPackageRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • writeMosToXML

        public boolean writeMosToXML(java.lang.String type,
                                     java.lang.String defClassName,
                                     java.lang.String mosName,
                                     MboSetRemote mosMboSet,
                                     boolean isChange,
                                     int batchSize,
                                     boolean useDefaultXMLAction)
                              throws MXException,
                                     java.rmi.RemoteException
        Write the provided MOS mboset into an xml.
        Specified by:
        writeMosToXML in interface DMPackageRemote
        Parameters:
        mosName - The name of the MOS (configuration object).
        mosMboSet - The mboset that represents data for this MOS.
        isChange - Boolean to indicate whether this is a snapshot or change type.
        batchSize - The number of top level mbos to process at each batch.
        Throws:
        MXException
        java.rmi.RemoteException
      • getStatusHandler

        protected StatusHandler getStatusHandler()
        Gets a status handler to change the package status.
        Specified by:
        getStatusHandler in class StatefulMbo
        Returns:
        a status handler to change the package status.
      • canDistribute

        public void canDistribute()
                           throws MXException,
                                  java.rmi.RemoteException
        Throws an exception if this package can not be distributed due to its status.
        Specified by:
        canDistribute in interface DMPackageRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • distributeZipPackage

        public boolean distributeZipPackage()
                                     throws MXException,
                                            java.rmi.RemoteException
        Creates a zip file in the dmroot directory for download in the browser. If the file is already present, does nothing. This is used for package distribution in multitenant environments.
        Specified by:
        distributeZipPackage in interface DMPackageRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • deployPackage

        public void deployPackage(MboSetRemote pkgDefSet)
                           throws MXException,
                                  java.rmi.RemoteException
        Start deploy thread at target server.
        Specified by:
        deployPackage in interface DMPackageRemote
        Parameters:
        pkgDefSet - The package def set passed from UI. Used for writing longop messages.
        Throws:
        MXException
        java.rmi.RemoteException
      • getLongopPreviewOKMsg

        public void getLongopPreviewOKMsg(java.lang.String pkgName,
                                          UserInfo ui,
                                          MboSetRemote defSet)
                                   throws java.lang.Exception
        Write preview done messages to longop.
        Parameters:
        pkgName -
        ui -
        defSet -
        Throws:
        java.lang.Exception
      • changeMaxStatus

        public void changeMaxStatus(java.lang.String status,
                                    java.lang.String progressStatus,
                                    java.util.Date asOfDate,
                                    java.lang.String memo,
                                    long accessModifier)
                             throws MXException,
                                    java.rmi.RemoteException
        Change status, using the default values for the status and progress status.
        Specified by:
        changeMaxStatus in interface DMPackageRemote
        Parameters:
        status - MaxValue of the status to change to.
        progressStatus - MaxValue of the progress status to change to
        asOfDate - The date of the status change
        memo - Memo
        accessModifier - access flag
        Throws:
        MXException
        java.rmi.RemoteException
      • previewLogger

        public void previewLogger(java.lang.String pkgName,
                                  boolean load)
                           throws MXException,
                                  java.rmi.RemoteException
        Load and unload preview logger dynamically
        Parameters:
        pkgName -
        load -
        Throws:
        MXException
        java.rmi.RemoteException
      • processPreviewXML

        public void processPreviewXML(MXTransaction mxTrans,
                                      UserInfo ui,
                                      java.lang.String mos,
                                      byte[] content,
                                      boolean recordRollback)
                               throws MXException,
                                      java.rmi.RemoteException
        Process xml using preview mode.
        Parameters:
        mxTrans -
        mos -
        rollbackpoint -
        content -
        Throws:
        MXException
        java.rmi.RemoteException
      • uploadCompiledSrcFile

        public void uploadCompiledSrcFile(java.lang.String fileName,
                                          byte[] content)
                                   throws MXException,
                                          java.rmi.RemoteException
        Upload compiled source file into the staging table.
        Specified by:
        uploadCompiledSrcFile in interface DMPackageRemote
        Parameters:
        fileName - The compiled source file name.
        content - Content of the file
        Throws:
        MXException
        java.rmi.RemoteException
      • canDownloadPkg

        public java.lang.String canDownloadPkg()
                                        throws MXException,
                                               java.rmi.RemoteException
        Check whether a package file exists for download.
        Specified by:
        canDownloadPkg in interface DMPackageRemote
        Throws:
        MXException
        java.rmi.RemoteException
      • getPkgFile

        public byte[] getPkgFile()
                          throws MXException,
                                 java.rmi.RemoteException
        Throws:
        MXException
        java.rmi.RemoteException
      • getRedistribute

        public boolean getRedistribute()
                                throws MXException,
                                       java.rmi.RemoteException
        Returns true if the package is set to be redistributed.
        Specified by:
        getRedistribute in interface DMPackageRemote
        Returns:
        Throws:
        java.rmi.RemoteException
        MXException
      • setRedistribute

        public void setRedistribute(boolean isRedistribute)
        Set redistribute flag for the package
        Parameters:
        isRedistribute -
      • save

        protected void save()
                     throws MXException,
                            java.rmi.RemoteException
        Description copied from class: StatefulMbo
        Overrides the save of Mbo so that a row is added to the status history table when a new object is saved.
        Overrides:
        save in class StatefulMbo
        Throws:
        MXException
        java.rmi.RemoteException
      • mosGrpResolver

        public java.util.HashMap mosGrpResolver(java.util.HashMap objMap)
                                         throws MXException,
                                                java.rmi.RemoteException
        Find group for a mos and find start and end number of Mos and group
        Parameters:
        objMap -
        Returns:
        HashMap
        Throws:
        MXException
        java.rmi.RemoteException
      • applyFix

        public void applyFix()
                      throws MXException,
                             java.rmi.RemoteException
        Update the file where the error occurred with the updated XML.
        Specified by:
        applyFix in interface DMPackageRemote
        Throws:
        MXException
        java.rmi.RemoteException