Class BaseStorageModule

    • Constructor Detail

      • BaseStorageModule

        public BaseStorageModule()
    • Method Detail

      • canHandle

        public boolean canHandle​(java.lang.String action,
                                 Message msg,
                                 java.util.Map<java.lang.Object,​java.lang.Object> options)
        Specified by:
        canHandle in interface ProcessorModule
      • init

        public void init​(Session session,
                         java.util.Map<java.lang.String,​java.lang.String> options)
                  throws OpenAS2Exception
        Description copied from interface: Component
        Component lifecycle hook. After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.
        Specified by:
        init in interface Component
        Overrides:
        init in class BaseComponent
        Parameters:
        session - the component uses this object to access other components
        options - configuration values for the component
        Throws:
        OpenAS2Exception - If an error occurs while initializing the component
        See Also:
        Session
      • getModuleAction

        protected abstract java.lang.String getModuleAction()
      • getFile

        protected java.io.File getFile​(Message msg,
                                       java.lang.String fileParam)
                                throws java.io.IOException,
                                       OpenAS2Exception
        Add one more method "getFile" to make no impact to all modules who call this method with only two parameter "Message msg" & "String fileParam"
        Parameters:
        msg - the context object
        fileParam - Name of the file
        Returns:
        a File object
        Throws:
        java.io.IOException - - IO system has a problem
        OpenAS2Exception - - internally handled error condition occurred
      • getFile

        protected java.io.File getFile​(Message msg,
                                       java.lang.String fileParam,
                                       java.lang.String action)
                                throws java.io.IOException,
                                       OpenAS2Exception
        Extracts name of the file from the file parameter and returns a File object with the file name
        Parameters:
        msg - the context object
        fileParam - The parameter containing the format string for the file name
        action - what to do
        Returns:
        a File object
        Throws:
        java.io.IOException - - IO system has a problem
        OpenAS2Exception - - internally handled error condition occurred
      • store

        protected void store​(java.io.File msgFile,
                             java.io.InputStream in)
                      throws java.io.IOException,
                             OpenAS2Exception
        Throws:
        java.io.IOException
        OpenAS2Exception
      • writeStream

        protected void writeStream​(java.io.InputStream in,
                                   java.io.File destination)
                            throws java.io.IOException
        Throws:
        java.io.IOException