Class BackupServerApp

  • All Implemented Interfaces:
    ActionListener, EventListener, org.jbundle.base.db.util.log.BackupConstants, org.jbundle.model.App, org.jbundle.model.Freeable, org.jbundle.model.PropertyOwner, org.jbundle.model.Service

    public class BackupServerApp
    extends org.jbundle.thin.base.screen.ThinApplication
    implements org.jbundle.base.db.util.log.BackupConstants, ActionListener
    Main Class for BackupServerApp java -Xms256m -Xmx512m org.jbundle.base.db.util.log.BackupServerApp filenametemplate=ftp://download:donwpp@www.donandann.com/backup/trxlog_{0}.txt cycletime=15 // Max minutes to start a new file (Default = use same file) timeouttime=15000 // Max timeout in ms (optional - for ftp, network connections.) (default = no timeout) (or instead of filenametemplate) folder=ftp://download:donwpp@www.donandann.com/backup/
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Vector<Object> FAKE_TRX  
      protected int iCycleTime  
      protected Timer m_cycletimer  
      protected double m_lastWrite  
      protected org.jbundle.thin.base.message.BaseMessageFilter m_messageFilter
      The message filter.
      protected String m_strFilenameTemplate  
      protected Timer m_timeouttimer  
      protected ObjectOutputStream m_writer  
      • Fields inherited from class org.jbundle.thin.base.util.Application

        ANDROID_IMAGE_UTIL, BASE_CLASS, BUNDLE, CREATE_USER_REQUIRED, DEFAULT_CONNECTION_TYPE, gTaskScheduler, LOCAL_SERVICE, LOGIN_REQUIRED, m_mainRemoteTask, m_mapTasks, m_muffinManager, m_PhysicalDatabaseParent, m_properties, m_resources, m_taskMain, MAIL_TO, PROPERTIES, PROXY, REMOTE_SERVICE, RESOURCES, SWING_IMAGE_UTIL, THIN_RES_PATH, TOKENS
      • Fields inherited from interface org.jbundle.base.db.util.log.BackupConstants

        BACKUP_QUEUE_NAME, BACKUP_QUEUE_TYPE, DEFAULT_PATTERN, DEFAULT_REGEX, MESSAGE_PARAM, NOTRX, SEND
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(ActionEvent e)
      Timer handling.
      void backupTrxLog​(Object objMessage)
      Add this data to the backup stream.
      void checkTimeout()  
      String dateToString​(Date date)  
      void flush​(boolean bSendFakeTrx)
      Flush the buffer.
      void free()  
      String getBackupFilename​(String strFilenameTemplate)  
      String getFilename()  
      ObjectOutputStream getWriter()
      Get the backup stream writer.
      void init​(Object env, Map<String,​Object> properties, Object applet)
      Chat Screen Constructor.
      static void main​(String[] args)
      The main() method acts as the applet's entry point when it is run as a standalone application.
      void startCycleTimer​(int iDelayMS)
      Wait, then close the file so a new file can open.
      void startNextFile()  
      void startTimeoutTimer​(int iDelayMS)
      Wait, then close the file so a new file can open.
      • Methods inherited from class org.jbundle.thin.base.screen.ThinApplication

        getMessageManager
      • Methods inherited from class org.jbundle.thin.base.util.Application

        addTask, addUserParamsToURL, changePassword, checkSecurity, classMatch, createNewUser, createRemoteTask, getAppServerName, getBaseServletPath, getCodeBase, getCodeBase, getConnectionType, getLanguage, getLocale, getMainTask, getMessageManager, getMuffinManager, getParameterByReflection, getPDatabaseParent, getProperties, getProperty, getRemoteTask, getRemoteTask, getRemoteTask, getResourceBundle, getResourcePath, getResources, getResourceURL, getResPackage, getRootApplet, getSecurityErrorText, getServerProperties, getString, getSystemRecordOwner, getTaskList, getTaskScheduler, login, registerUniqueApplication, removeTask, retrieveUserProperties, setLanguage, setMuffinManager, setProperties, setProperty, setResourceBundle, setRootApplet, setTaskScheduler, showTheDocument
    • Field Detail

      • m_strFilenameTemplate

        protected String m_strFilenameTemplate
      • m_cycletimer

        protected Timer m_cycletimer
      • m_timeouttimer

        protected Timer m_timeouttimer
      • m_lastWrite

        protected double m_lastWrite
      • iCycleTime

        protected int iCycleTime
      • m_messageFilter

        protected org.jbundle.thin.base.message.BaseMessageFilter m_messageFilter
        The message filter.
    • Constructor Detail

      • BackupServerApp

        public BackupServerApp()
        Chat Screen Constructor.
      • BackupServerApp

        public BackupServerApp​(String[] args)
        Chat Screen Constructor.
        Parameters:
        parent - Typically, you pass the BaseApplet as the parent.
    • Method Detail

      • init

        public void init​(Object env,
                         Map<String,​Object> properties,
                         Object applet)
        Chat Screen Constructor.
        Specified by:
        init in interface org.jbundle.model.App
        Overrides:
        init in class org.jbundle.thin.base.screen.ThinApplication
        Parameters:
        parent - Typically, you pass the BaseApplet as the parent.
      • free

        public void free()
        Specified by:
        free in interface org.jbundle.model.Freeable
        Overrides:
        free in class org.jbundle.thin.base.screen.ThinApplication
      • backupTrxLog

        public void backupTrxLog​(Object objMessage)
        Add this data to the backup stream.
        Parameters:
        strMessage - the data to log.
      • startNextFile

        public void startNextFile()
      • getWriter

        public ObjectOutputStream getWriter()
        Get the backup stream writer.
        Returns:
      • getFilename

        public String getFilename()
        Returns:
      • main

        public static void main​(String[] args)
        The main() method acts as the applet's entry point when it is run as a standalone application. It is ignored if the applet is run from within an HTML page.
      • getBackupFilename

        public String getBackupFilename​(String strFilenameTemplate)
      • dateToString

        public String dateToString​(Date date)
      • startCycleTimer

        public void startCycleTimer​(int iDelayMS)
        Wait, then close the file so a new file can open.
      • startTimeoutTimer

        public void startTimeoutTimer​(int iDelayMS)
        Wait, then close the file so a new file can open.
      • checkTimeout

        public void checkTimeout()
      • flush

        public void flush​(boolean bSendFakeTrx)
        Flush the buffer.
        Parameters:
        bSendFakeTrx - Send a fake trx before flushing (This guarantees activity on the stream before the flush [In case it just autoflushed the entire buffer])