Class BackupServerApp
- java.lang.Object
-
- org.jbundle.thin.base.util.Application
-
- org.jbundle.thin.base.screen.ThinApplication
-
- org.jbundle.app.program.manual.backup.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_TRXprotected intiCycleTimeprotected Timerm_cycletimerprotected doublem_lastWriteprotected org.jbundle.thin.base.message.BaseMessageFilterm_messageFilterThe message filter.protected Stringm_strFilenameTemplateprotected Timerm_timeouttimerprotected ObjectOutputStreamm_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
-
-
Constructor Summary
Constructors Constructor Description BackupServerApp()Chat Screen Constructor.BackupServerApp(String[] args)Chat Screen Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent e)Timer handling.voidbackupTrxLog(Object objMessage)Add this data to the backup stream.voidcheckTimeout()StringdateToString(Date date)voidflush(boolean bSendFakeTrx)Flush the buffer.voidfree()StringgetBackupFilename(String strFilenameTemplate)StringgetFilename()ObjectOutputStreamgetWriter()Get the backup stream writer.voidinit(Object env, Map<String,Object> properties, Object applet)Chat Screen Constructor.static voidmain(String[] args)The main() method acts as the applet's entry point when it is run as a standalone application.voidstartCycleTimer(int iDelayMS)Wait, then close the file so a new file can open.voidstartNextFile()voidstartTimeoutTimer(int iDelayMS)Wait, then close the file so a new file can open.-
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_writer
protected ObjectOutputStream m_writer
-
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:
initin interfaceorg.jbundle.model.App- Overrides:
initin classorg.jbundle.thin.base.screen.ThinApplication- Parameters:
parent- Typically, you pass the BaseApplet as the parent.
-
free
public void free()
- Specified by:
freein interfaceorg.jbundle.model.Freeable- Overrides:
freein classorg.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.
-
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.
-
actionPerformed
public void actionPerformed(ActionEvent e)
Timer handling.- Specified by:
actionPerformedin interfaceActionListener
-
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])
-
-