// *** Generated Source File *** // Portions Copyright (c) 1996-2000, SilverStream Software, Inc., All Rights Reserved package com.sssw.gen.forms; // generated by SilverStream: do not edit //Object Imports import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.rmi.RemoteException; import java.util.Calendar; import java.util.Date; import java.util.EventObject; import java.util.Hashtable; import java.util.Locale; import javax.swing.JScrollPane; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import org.apache.log4j.Logger; import com.gpc.backofficecommon.FwoSessionMgr; import com.gpc.backofficecommon.JNDILocator; import com.gpc.backofficecommon.JNDILocatorConstants; import com.gpc.backofficecommon.app.TamsCacheMgr; import com.gpc.backofficecommon.app.TsoProfile; import com.gpc.client.backoffice.FwoFormMaster; import com.gpc.client.backoffice.FwoNavigationMgr; import com.gpc.client.backoffice.FwoToolBarDirector; import com.gpc.client.backoffice.app.TamsFormMaster; import com.gpc.client.backoffice.util.InvokerBridge; import com.gpc.client.common.ClientApplicationContext; import com.gpc.client.common.util.ClientUtil; import com.gpc.common.Profile; import com.gpc.common.TsoConstant; import com.gpc.common.constants.ResourceMonitorConstants; import com.gpc.common.exception.ApplicationException; import com.gpc.common.pattern.FwoDatePattern; import com.gpc.common.pattern.FwoPattern; import com.gpc.common.pattern.PatternFormatException; import com.gpc.common.util.EJBRemoteExceptionHelper; import com.gpc.common.constants.refvalues.RefEODTriggeredSource; import com.gpc.dao.ResourceUsageDAO; import com.gpc.ejb.system.SBSystem; import com.gpc.ejb.system.SBSystemHome; import com.gpc.frame.FwiFormProcess; import com.gpc.tams.eod.client.EODController; import com.gpc.valueobjects.common.ResultsVO; import com.gpc.valueobjects.employee.EmployeeVO; import com.gpc.valueobjects.endofday.EndOfDayMonitorVO; import com.gpc.valueobjects.report.FwoPrintSettings; import com.gpc.valueobjects.report.FwoPrinterSelectionSettings; import com.gpc.valueobjects.sql.ExecuteSQLVO; import com.gpc.valueobjects.system.ResourceUsageVO; import com.gpc.valueobjects.profile.EndOfDayProfileVO; import com.sssw.rt.event.AgiTimerListener; import com.sssw.rt.form.AgfForm; import com.sssw.rt.gui.AgoColorManager; import com.sssw.rt.util.AgoData; import com.sssw.rt.util.AgoSecurityException; import com.sssw.rt.util.AgoUnrecoverableSystemException; import com.sssw.rt.util.DataCursor; public class FrmEOD_EODMonitor_restart extends AgfForm // generated by SilverStream: do not edit implements com.gpc.frame.FwiFormEdit, ActionListener, AgiTimerListener, com.gpc.frame.FwiFormProcess, com.gpc.frame.FwiFormClose { public com.sssw.rt.jform.AgcJButton pbStartBackupNow; public com.sssw.rt.form.AgcData agcEODMonitor; public javax.swing.ButtonGroup DefaultJButtonGroup = new javax.swing.ButtonGroup(); public com.sssw.rt.jform.AgcJButton pbStopEOD; public com.sssw.rt.jform.AgcJButton pbStartEOD; public com.sssw.rt.jform.AgcJTextArea jtextLog; public javax.swing.JScrollPane jtextLogScrollPane; public com.sssw.rt.form.AgcTimer tmrEODLog; public com.sssw.rt.jform.AgcJLabel lblEndOfDayStartedValue; public com.sssw.rt.jform.AgcJLabel lblEndOfDayStarted; public com.sssw.rt.jform.AgcJLabel lblProgramStartTimeValue; public com.sssw.rt.jform.AgcJLabel lblProgramStartTime; public com.sssw.rt.jform.AgcJLabel lblProgramEndTimeValue; public com.sssw.rt.jform.AgcJLabel lblProgramEndTime; public com.sssw.rt.form.AgcRectangle rectLog; public com.sssw.rt.jform.AgcJLabel lblCurrentlyRunningProgram; public com.sssw.rt.jform.AgcJLabel lblLastCompletedProgram; public com.sssw.rt.jform.AgcJLabel lblEndOfDayAccountingDayValue; public com.sssw.rt.jform.AgcJLabel lblEndOfDayStartedByValue; public com.sssw.rt.jform.AgcJLabel lblEndOfDayRunningAtValue; public com.sssw.rt.jform.AgcJButton pbRestart; public com.sssw.rt.jform.AgcJLabel lblEndOfDayStartedBy; public com.sssw.rt.jform.AgcJLabel lblEndOfDayRunningAt; public com.sssw.rt.jform.AgcJLabel lblEndOfDayAccountingDay; public com.sssw.rt.jform.AgcJLabel lblTitle; public com.sssw.rt.form.AgcRectangle rectGeneralInformation; public com.sssw.rt.form.AgcRectangle rectLastCompletedProgram; public com.sssw.rt.form.AgcRectangle rectCurrentlyRunningProgram; private static final Logger logger = Logger.getLogger(FrmEOD_EODMonitor_restart.class); private static boolean TEST_MODE_ON = false; private TamsFormMaster FM; private EODController controller; protected FwoNavigationMgr m_NavMgr; private static SBSystem sbSystem; private EndOfDayMonitorVO m_monitorVO; public FrmEOD_EODMonitor_restart() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === } public void init() throws Exception { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === // Initialize form and data this.setTransparent(false); this.setBackground(Color.white); this.setBackgroundImageMode(2); agData.setDataMode(AgoData.DATA_MODE_FIRST_RECORD); agDataMgr.setAutomaticValidationUI(true); this.setName("FrmEOD_EODMonitor_restart"); this.setBounds(10,10,1016,663); // Initialize agcEODMonitor agcEODMonitor = new com.sssw.rt.form.AgcData(); agcEODMonitor.setName("agcEODMonitor"); agcEODMonitor.setBounds(46,365,78,58); agcEODMonitor.setExpressionCount(2); agcEODMonitor.setExpression(0, 0, "LOC", 0); agcEODMonitor.setExpression(1, 1, "STARTED_BY_IP_ADDRESS", 1); //Initialize pbStartEODNow pbStartBackupNow = new com.sssw.rt.jform.AgcJButton(); pbStartBackupNow.setName("pbStartBackupNow"); pbStartBackupNow.setBounds(655,620,260,25); pbStartBackupNow.setContentAreaFilled(true); pbStartBackupNow.setBorderPainted(true); pbStartBackupNow.setMargin(new Insets(1, 1, 1, 1)); pbStartBackupNow.setHorizontalAlignment(SwingConstants.CENTER); pbStartBackupNow.setVerticalAlignment(SwingConstants.CENTER); pbStartBackupNow.setHorizontalTextPosition(SwingConstants.RIGHT); pbStartBackupNow.setVerticalTextPosition(SwingConstants.CENTER); pbStartBackupNow.setText("Start Backup Now"); pbStartBackupNow.setFont(new Font("SansSerif", 1, 12)); pbStartBackupNow.setForeground(Color.black); pbStartBackupNow.setBackground(Color.lightGray); // Initialize pbStopEOD pbStopEOD = new com.sssw.rt.jform.AgcJButton(); pbStopEOD.setName("pbStopEOD"); pbStopEOD.setBounds(401,620,120,25); pbStopEOD.setContentAreaFilled(true); pbStopEOD.setBorderPainted(true); pbStopEOD.setMargin(new Insets(1, 1, 1, 1)); pbStopEOD.setHorizontalAlignment(SwingConstants.CENTER); pbStopEOD.setVerticalAlignment(SwingConstants.CENTER); pbStopEOD.setHorizontalTextPosition(SwingConstants.RIGHT); pbStopEOD.setVerticalTextPosition(SwingConstants.CENTER); pbStopEOD.setText("Stop EOD Test"); pbStopEOD.setFont(new Font("SansSerif", 1, 12)); pbStopEOD.setForeground(Color.black); pbStopEOD.setBackground(Color.lightGray); // Initialize pbStartEOD pbStartEOD = new com.sssw.rt.jform.AgcJButton(); pbStartEOD.setName("pbStartEOD"); pbStartEOD.setBounds(281,620,105,25); pbStartEOD.setContentAreaFilled(true); pbStartEOD.setBorderPainted(true); pbStartEOD.setMargin(new Insets(1, 1, 1, 1)); pbStartEOD.setHorizontalAlignment(SwingConstants.CENTER); pbStartEOD.setVerticalAlignment(SwingConstants.CENTER); pbStartEOD.setHorizontalTextPosition(SwingConstants.RIGHT); pbStartEOD.setVerticalTextPosition(SwingConstants.CENTER); pbStartEOD.setText("Start EOD Test"); pbStartEOD.setFont(new Font("SansSerif", 1, 12)); pbStartEOD.setForeground(Color.black); pbStartEOD.setBackground(Color.lightGray); // Initialize jtextLog jtextLog = new com.sssw.rt.jform.AgcJTextArea(); jtextLog.setName("jtextLog"); jtextLogScrollPane = new JScrollPane(jtextLog); jtextLogScrollPane.setBounds(126,282,770,290); jtextLog.setFont(new Font("Monospaced", 0, 11)); jtextLog.setLineWrap(true); jtextLog.setWrapStyleWord(true); jtextLog.setMargin(new Insets(1, 1, 1, 1)); jtextLog.setEditable(false); jtextLog.setForeground(Color.black); jtextLog.setBackground(Color.white); // Initialize tmrEODLog tmrEODLog = new com.sssw.rt.form.AgcTimer(); tmrEODLog.setInterval(1.0); tmrEODLog.setName("tmrEODLog"); tmrEODLog.setBounds(46,310,38,38); // Initialize lblEndOfDayStartedValue lblEndOfDayStartedValue = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayStartedValue.setName("lblEndOfDayStartedValue"); lblEndOfDayStartedValue.setBounds(801,88,155,20); lblEndOfDayStartedValue.setText("04/12/2002 01:00 AM"); lblEndOfDayStartedValue.setOpaque(false); lblEndOfDayStartedValue.setTextStyle(0); lblEndOfDayStartedValue.setForeground(Color.black); lblEndOfDayStartedValue.setTextShadowColor(Color.darkGray); lblEndOfDayStartedValue.setTextHighlightColor(Color.gray); lblEndOfDayStartedValue.setBackground(Color.lightGray); lblEndOfDayStartedValue.setHorizontalAlignment(SwingConstants.LEFT); lblEndOfDayStartedValue.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayStartedValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayStartedValue.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayStartedValue.setWordWrap(false); lblEndOfDayStartedValue.setFont(new Font("SansSerif", 0, 12)); // Initialize lblEndOfDayStarted lblEndOfDayStarted = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayStarted.setName("lblEndOfDayStarted"); lblEndOfDayStarted.setBounds(560,88,226,20); lblEndOfDayStarted.setText("End of Day Started"); lblEndOfDayStarted.setOpaque(false); lblEndOfDayStarted.setTextStyle(0); lblEndOfDayStarted.setForeground(Color.black); lblEndOfDayStarted.setTextShadowColor(Color.darkGray); lblEndOfDayStarted.setTextHighlightColor(Color.gray); lblEndOfDayStarted.setBackground(Color.lightGray); lblEndOfDayStarted.setHorizontalAlignment(SwingConstants.RIGHT); lblEndOfDayStarted.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayStarted.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayStarted.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayStarted.setWordWrap(false); lblEndOfDayStarted.setFont(new Font("SansSerif", 1, 12)); // Initialize lblProgramStartTimeValue lblProgramStartTimeValue = new com.sssw.rt.jform.AgcJLabel(); lblProgramStartTimeValue.setName("lblProgramStartTimeValue"); lblProgramStartTimeValue.setBounds(771,192,170,20); lblProgramStartTimeValue.setText("1:16 AM "); lblProgramStartTimeValue.setOpaque(false); lblProgramStartTimeValue.setTextStyle(0); lblProgramStartTimeValue.setForeground(Color.black); lblProgramStartTimeValue.setTextShadowColor(Color.darkGray); lblProgramStartTimeValue.setTextHighlightColor(Color.gray); lblProgramStartTimeValue.setBackground(Color.lightGray); lblProgramStartTimeValue.setHorizontalAlignment(SwingConstants.LEFT); lblProgramStartTimeValue.setVerticalAlignment(SwingConstants.CENTER); lblProgramStartTimeValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblProgramStartTimeValue.setVerticalTextPosition(SwingConstants.CENTER); lblProgramStartTimeValue.setWordWrap(false); lblProgramStartTimeValue.setFont(new Font("SansSerif", 0, 12)); // Initialize lblProgramStartTime lblProgramStartTime = new com.sssw.rt.jform.AgcJLabel(); lblProgramStartTime.setName("lblProgramStartTime"); lblProgramStartTime.setBounds(576,192,180,20); lblProgramStartTime.setText("Program Start Time"); lblProgramStartTime.setOpaque(false); lblProgramStartTime.setTextStyle(0); lblProgramStartTime.setForeground(Color.black); lblProgramStartTime.setTextShadowColor(Color.darkGray); lblProgramStartTime.setTextHighlightColor(Color.gray); lblProgramStartTime.setBackground(Color.lightGray); lblProgramStartTime.setHorizontalAlignment(SwingConstants.RIGHT); lblProgramStartTime.setVerticalAlignment(SwingConstants.CENTER); lblProgramStartTime.setHorizontalTextPosition(SwingConstants.RIGHT); lblProgramStartTime.setVerticalTextPosition(SwingConstants.CENTER); lblProgramStartTime.setWordWrap(false); lblProgramStartTime.setFont(new Font("SansSerif", 1, 12)); // Initialize lblProgramEndTimeValue lblProgramEndTimeValue = new com.sssw.rt.jform.AgcJLabel(); lblProgramEndTimeValue.setName("lblProgramEndTimeValue"); lblProgramEndTimeValue.setBounds(259,192,170,20); lblProgramEndTimeValue.setText("1:15 AM "); lblProgramEndTimeValue.setOpaque(false); lblProgramEndTimeValue.setTextStyle(0); lblProgramEndTimeValue.setForeground(Color.black); lblProgramEndTimeValue.setTextShadowColor(Color.darkGray); lblProgramEndTimeValue.setTextHighlightColor(Color.gray); lblProgramEndTimeValue.setBackground(Color.lightGray); lblProgramEndTimeValue.setHorizontalAlignment(SwingConstants.LEFT); lblProgramEndTimeValue.setVerticalAlignment(SwingConstants.CENTER); lblProgramEndTimeValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblProgramEndTimeValue.setVerticalTextPosition(SwingConstants.CENTER); lblProgramEndTimeValue.setWordWrap(false); lblProgramEndTimeValue.setFont(new Font("SansSerif", 0, 12)); // Initialize lblProgramEndTime lblProgramEndTime = new com.sssw.rt.jform.AgcJLabel(); lblProgramEndTime.setName("lblProgramEndTime"); lblProgramEndTime.setBounds(64,192,180,20); lblProgramEndTime.setText("Program End Time"); lblProgramEndTime.setOpaque(false); lblProgramEndTime.setTextStyle(0); lblProgramEndTime.setForeground(Color.black); lblProgramEndTime.setTextShadowColor(Color.darkGray); lblProgramEndTime.setTextHighlightColor(Color.gray); lblProgramEndTime.setBackground(Color.lightGray); lblProgramEndTime.setHorizontalAlignment(SwingConstants.RIGHT); lblProgramEndTime.setVerticalAlignment(SwingConstants.CENTER); lblProgramEndTime.setHorizontalTextPosition(SwingConstants.RIGHT); lblProgramEndTime.setVerticalTextPosition(SwingConstants.CENTER); lblProgramEndTime.setWordWrap(false); lblProgramEndTime.setFont(new Font("SansSerif", 1, 12)); // Initialize rectLog rectLog = new com.sssw.rt.form.AgcRectangle(); rectLog.setName("rectLog"); rectLog.setBounds(10,252,997,350); rectLog.setColor(Color.lightGray); rectLog.setBorderStyle(4); rectLog.setText("Log"); rectLog.setFont(new Font("SansSerif", 1, 12)); rectLog.setForeground(Color.black); rectLog.setTransparent(true); // Initialize lblCurrentlyRunningProgram lblCurrentlyRunningProgram = new com.sssw.rt.jform.AgcJLabel(); lblCurrentlyRunningProgram.setName("lblCurrentlyRunningProgram"); lblCurrentlyRunningProgram.setBounds(531,167,466,20); lblCurrentlyRunningProgram.setText("COMM Receipts Processed"); lblCurrentlyRunningProgram.setOpaque(false); lblCurrentlyRunningProgram.setTextStyle(0); lblCurrentlyRunningProgram.setForeground(Color.black); lblCurrentlyRunningProgram.setTextShadowColor(Color.darkGray); lblCurrentlyRunningProgram.setTextHighlightColor(Color.gray); lblCurrentlyRunningProgram.setBackground(Color.lightGray); lblCurrentlyRunningProgram.setHorizontalAlignment(SwingConstants.CENTER); lblCurrentlyRunningProgram.setVerticalAlignment(SwingConstants.CENTER); lblCurrentlyRunningProgram.setHorizontalTextPosition(SwingConstants.RIGHT); lblCurrentlyRunningProgram.setVerticalTextPosition(SwingConstants.CENTER); lblCurrentlyRunningProgram.setWordWrap(false); lblCurrentlyRunningProgram.setFont(new Font("SansSerif", 1, 12)); // Initialize lblLastCompletedProgram lblLastCompletedProgram = new com.sssw.rt.jform.AgcJLabel(); lblLastCompletedProgram.setName("lblLastCompletedProgram"); lblLastCompletedProgram.setBounds(19,167,467,20); lblLastCompletedProgram.setText("COMM Transmission Received"); lblLastCompletedProgram.setOpaque(false); lblLastCompletedProgram.setTextStyle(0); lblLastCompletedProgram.setForeground(Color.black); lblLastCompletedProgram.setTextShadowColor(Color.darkGray); lblLastCompletedProgram.setTextHighlightColor(Color.gray); lblLastCompletedProgram.setBackground(Color.lightGray); lblLastCompletedProgram.setHorizontalAlignment(SwingConstants.CENTER); lblLastCompletedProgram.setVerticalAlignment(SwingConstants.CENTER); lblLastCompletedProgram.setHorizontalTextPosition(SwingConstants.RIGHT); lblLastCompletedProgram.setVerticalTextPosition(SwingConstants.CENTER); lblLastCompletedProgram.setWordWrap(false); lblLastCompletedProgram.setFont(new Font("SansSerif", 1, 12)); // Initialize lblEndOfDayAccountingDayValue lblEndOfDayAccountingDayValue = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayAccountingDayValue.setName("lblEndOfDayAccountingDayValue"); lblEndOfDayAccountingDayValue.setBounds(801,58,100,20); lblEndOfDayAccountingDayValue.setText("2002 / 04"); lblEndOfDayAccountingDayValue.setOpaque(false); lblEndOfDayAccountingDayValue.setTextStyle(0); lblEndOfDayAccountingDayValue.setForeground(Color.black); lblEndOfDayAccountingDayValue.setTextShadowColor(Color.darkGray); lblEndOfDayAccountingDayValue.setTextHighlightColor(Color.gray); lblEndOfDayAccountingDayValue.setBackground(Color.lightGray); lblEndOfDayAccountingDayValue.setHorizontalAlignment(SwingConstants.LEFT); lblEndOfDayAccountingDayValue.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayAccountingDayValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayAccountingDayValue.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayAccountingDayValue.setWordWrap(false); lblEndOfDayAccountingDayValue.setFont(new Font("SansSerif", 0, 12)); // Initialize lblEndOfDayStartedByValue lblEndOfDayStartedByValue = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayStartedByValue.setName("lblEndOfDayStartedByValue"); lblEndOfDayStartedByValue.setBounds(255,88,264,20); lblEndOfDayStartedByValue.setText("Louis Boudreau"); lblEndOfDayStartedByValue.setOpaque(false); lblEndOfDayStartedByValue.setTextStyle(0); lblEndOfDayStartedByValue.setForeground(Color.black); lblEndOfDayStartedByValue.setTextShadowColor(Color.darkGray); lblEndOfDayStartedByValue.setTextHighlightColor(Color.gray); lblEndOfDayStartedByValue.setBackground(Color.lightGray); lblEndOfDayStartedByValue.setHorizontalAlignment(SwingConstants.LEFT); lblEndOfDayStartedByValue.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayStartedByValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayStartedByValue.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayStartedByValue.setWordWrap(false); lblEndOfDayStartedByValue.setFont(new Font("SansSerif", 0, 12)); // Initialize lblEndOfDayRunningAtValue lblEndOfDayRunningAtValue = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayRunningAtValue.setName("lblEndOfDayRunningAtValue"); lblEndOfDayRunningAtValue.setBounds(255,58,100,20); lblEndOfDayRunningAtValue.setText("10.10.10.77"); lblEndOfDayRunningAtValue.setOpaque(false); lblEndOfDayRunningAtValue.setTextStyle(0); lblEndOfDayRunningAtValue.setForeground(Color.black); lblEndOfDayRunningAtValue.setTextShadowColor(Color.darkGray); lblEndOfDayRunningAtValue.setTextHighlightColor(Color.gray); lblEndOfDayRunningAtValue.setBackground(Color.lightGray); lblEndOfDayRunningAtValue.setHorizontalAlignment(SwingConstants.LEFT); lblEndOfDayRunningAtValue.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayRunningAtValue.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayRunningAtValue.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayRunningAtValue.setWordWrap(false); lblEndOfDayRunningAtValue.setFont(new Font("SansSerif", 0, 12)); // Initialize pbRestart pbRestart = new com.sssw.rt.jform.AgcJButton(); pbRestart.setName("pbRestart"); pbRestart.setBounds(925,621,80,25); pbRestart.setContentAreaFilled(true); pbRestart.setBorderPainted(true); pbRestart.setMargin(new Insets(1, 1, 1, 1)); pbRestart.setHorizontalAlignment(SwingConstants.CENTER); pbRestart.setVerticalAlignment(SwingConstants.CENTER); pbRestart.setHorizontalTextPosition(SwingConstants.RIGHT); pbRestart.setVerticalTextPosition(SwingConstants.CENTER); pbRestart.setText("Restart"); pbRestart.setFont(new Font("SansSerif", 1, 12)); pbRestart.setForeground(Color.black); pbRestart.setBackground(Color.lightGray); // Initialize lblEndOfDayStartedBy lblEndOfDayStartedBy = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayStartedBy.setName("lblEndOfDayStartedBy"); lblEndOfDayStartedBy.setBounds(20,88,220,20); lblEndOfDayStartedBy.setText("End of Day Started By"); lblEndOfDayStartedBy.setOpaque(false); lblEndOfDayStartedBy.setTextStyle(0); lblEndOfDayStartedBy.setForeground(Color.black); lblEndOfDayStartedBy.setTextShadowColor(Color.darkGray); lblEndOfDayStartedBy.setTextHighlightColor(Color.gray); lblEndOfDayStartedBy.setBackground(Color.lightGray); lblEndOfDayStartedBy.setHorizontalAlignment(SwingConstants.RIGHT); lblEndOfDayStartedBy.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayStartedBy.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayStartedBy.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayStartedBy.setWordWrap(false); lblEndOfDayStartedBy.setFont(new Font("SansSerif", 1, 12)); // Initialize lblEndOfDayRunningAt lblEndOfDayRunningAt = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayRunningAt.setName("lblEndOfDayRunningAt"); lblEndOfDayRunningAt.setBounds(20,58,220,20); lblEndOfDayRunningAt.setText("End of Day Running at"); lblEndOfDayRunningAt.setOpaque(false); lblEndOfDayRunningAt.setTextStyle(0); lblEndOfDayRunningAt.setForeground(Color.black); lblEndOfDayRunningAt.setTextShadowColor(Color.darkGray); lblEndOfDayRunningAt.setTextHighlightColor(Color.gray); lblEndOfDayRunningAt.setBackground(Color.lightGray); lblEndOfDayRunningAt.setHorizontalAlignment(SwingConstants.RIGHT); lblEndOfDayRunningAt.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayRunningAt.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayRunningAt.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayRunningAt.setWordWrap(false); lblEndOfDayRunningAt.setFont(new Font("SansSerif", 1, 12)); // Initialize lblEndOfDayAccountingDay lblEndOfDayAccountingDay = new com.sssw.rt.jform.AgcJLabel(); lblEndOfDayAccountingDay.setName("lblEndOfDayAccountingDay"); lblEndOfDayAccountingDay.setBounds(558,58,228,20); lblEndOfDayAccountingDay.setText("End of Day Accounting Day"); lblEndOfDayAccountingDay.setOpaque(false); lblEndOfDayAccountingDay.setTextStyle(0); lblEndOfDayAccountingDay.setForeground(Color.black); lblEndOfDayAccountingDay.setTextShadowColor(Color.darkGray); lblEndOfDayAccountingDay.setTextHighlightColor(Color.gray); lblEndOfDayAccountingDay.setBackground(Color.lightGray); lblEndOfDayAccountingDay.setHorizontalAlignment(SwingConstants.RIGHT); lblEndOfDayAccountingDay.setVerticalAlignment(SwingConstants.CENTER); lblEndOfDayAccountingDay.setHorizontalTextPosition(SwingConstants.RIGHT); lblEndOfDayAccountingDay.setVerticalTextPosition(SwingConstants.CENTER); lblEndOfDayAccountingDay.setWordWrap(false); lblEndOfDayAccountingDay.setFont(new Font("SansSerif", 1, 12)); // Initialize lblTitle lblTitle = new com.sssw.rt.jform.AgcJLabel(); lblTitle.setName("lblTitle"); lblTitle.setBounds(20,5,966,35); lblTitle.setText("End of Day - Monitor"); lblTitle.setOpaque(false); lblTitle.setTextStyle(0); lblTitle.setForeground(AgoColorManager.getColor(24, 24, 231)); lblTitle.setTextShadowColor(Color.darkGray); lblTitle.setTextHighlightColor(Color.gray); lblTitle.setBackground(Color.lightGray); lblTitle.setHorizontalAlignment(SwingConstants.RIGHT); lblTitle.setVerticalAlignment(SwingConstants.CENTER); lblTitle.setHorizontalTextPosition(SwingConstants.RIGHT); lblTitle.setVerticalTextPosition(SwingConstants.CENTER); lblTitle.setWordWrap(false); lblTitle.setFont(new Font("SansSerif", 3, 24)); // Initialize rectGeneralInformation rectGeneralInformation = new com.sssw.rt.form.AgcRectangle(); rectGeneralInformation.setName("rectGeneralInformation"); rectGeneralInformation.setBounds(10,37,997,80); rectGeneralInformation.setColor(Color.lightGray); rectGeneralInformation.setBorderStyle(4); rectGeneralInformation.setText("General Information"); rectGeneralInformation.setFont(new Font("SansSerif", 1, 12)); rectGeneralInformation.setForeground(Color.black); rectGeneralInformation.setTransparent(true); // Initialize rectLastCompletedProgram rectLastCompletedProgram = new com.sssw.rt.form.AgcRectangle(); rectLastCompletedProgram.setName("rectLastCompletedProgram"); rectLastCompletedProgram.setBounds(10,134,485,100); rectLastCompletedProgram.setColor(Color.lightGray); rectLastCompletedProgram.setBorderStyle(4); rectLastCompletedProgram.setText("Last Completed Program"); rectLastCompletedProgram.setFont(new Font("SansSerif", 1, 12)); rectLastCompletedProgram.setForeground(Color.black); rectLastCompletedProgram.setTransparent(true); // Initialize rectCurrentlyRunningProgram rectCurrentlyRunningProgram = new com.sssw.rt.form.AgcRectangle(); rectCurrentlyRunningProgram.setName("rectCurrentlyRunningProgram"); rectCurrentlyRunningProgram.setBounds(522,134,485,100); rectCurrentlyRunningProgram.setColor(Color.lightGray); rectCurrentlyRunningProgram.setBorderStyle(4); rectCurrentlyRunningProgram.setText("Currently Running Program "); rectCurrentlyRunningProgram.setFont(new Font("SansSerif", 1, 12)); rectCurrentlyRunningProgram.setForeground(Color.black); rectCurrentlyRunningProgram.setTransparent(true); addControls(); addBindings(); // Setup tab order Component[] tabOrder = { pbRestart, jtextLog, pbStartEOD, pbStopEOD, pbStartBackupNow, }; setUserDefinedTabOrder(tabOrder); return; } protected void addAllFormControls() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === this.add(pbStartBackupNow); pbStartBackupNow.addActionListener(this); this.add(agcEODMonitor); this.add(pbStopEOD); pbStopEOD.addActionListener(this); this.add(pbStartEOD); pbStartEOD.addActionListener(this); this.add(jtextLogScrollPane); this.add(tmrEODLog); tmrEODLog.addAgiTimerListener(this); this.add(lblEndOfDayStartedValue); this.add(lblEndOfDayStarted); this.add(lblProgramStartTimeValue); this.add(lblProgramStartTime); this.add(lblProgramEndTimeValue); this.add(lblProgramEndTime); this.add(rectLog); this.add(lblCurrentlyRunningProgram); this.add(lblLastCompletedProgram); this.add(lblEndOfDayAccountingDayValue); this.add(lblEndOfDayStartedByValue); this.add(lblEndOfDayRunningAtValue); this.add(pbRestart); pbRestart.addActionListener(this); this.add(lblEndOfDayStartedBy); this.add(lblEndOfDayRunningAt); this.add(lblEndOfDayAccountingDay); this.add(lblTitle); this.add(rectGeneralInformation); this.add(rectLastCompletedProgram); this.add(rectCurrentlyRunningProgram); } protected void addBindings() { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === addExpDependencies(); } private void handle_pbRestart_actionPerformed(ActionEvent evt) { // Restarting is true logger.warn("End Of Day Restart Button is clicked !!!"); startEndOfDay(true); tmrEODLog.startTimer(); pbRestart.setEnabled(false); } public void fCheckAccess() { } public void fCheckLogin() { } public String fCreateTitle() { return (String)null; } public String fGetFormName() { return TsoConstant.FRM_EOD_MONITOR_RESTART; } public void fLocalize() { ClientApplicationContext.getClientApplicationContext().getLocalizationMgr().localize(this); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); controller = EODController.getController(FM.m_loc); EndOfDayMonitorVO eodVO = controller.getMonitorVO(); try { FwoPattern timePattern = FwoPattern.getTimePatternInstance(locale); FwoDatePattern m_datePattern = (FwoDatePattern) FwoPattern.getDatePatternInstance(locale, new Integer(ClientApplicationContext.getClientApplicationContext().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation() ).getStoreProfile().getRefDateFormatId().intValue())); if(eodVO.getLastTaskCompletedDate() != null) { lblProgramEndTimeValue.setText(timePattern.format(eodVO.getLastTaskCompletedDate(), locale)); } if(eodVO.getCurrentTaskStartDate() != null) { lblProgramStartTimeValue.setText(timePattern.format(eodVO.getCurrentTaskStartDate(), locale)); } if(eodVO.getAcctDay() != null && eodVO.getSalesYearMonth() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(eodVO.getSalesYearMonth()); String yearAcctday = (cal.get(Calendar.MONTH) + 1) + "/" + eodVO.getAcctDay().toString() + "/" + cal.get(Calendar.YEAR); lblEndOfDayAccountingDayValue.setText(m_datePattern.format(new Date(yearAcctday), locale)); } if(eodVO.getEODStartedDate() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(eodVO.getEODStartedDate()); String startDate = (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.YEAR); String startTime = timePattern.format(eodVO.getEODStartedDate(), locale); lblEndOfDayStartedValue.setText(m_datePattern.format(new Date(startDate), locale) + " " + startTime); } }catch(PatternFormatException pe) { logger.error(pe.toString(), pe); } } public void fRetrieve(java.util.Hashtable hashtable1) { } public void fStylize() { } public boolean fStopLogout() { return false; } public void fSetToolBar(java.awt.Component component1) { } public com.gpc.client.backoffice.FwoFormMaster fGetFormMaster() { return (com.gpc.client.backoffice.FwoFormMaster)FM; } private void clearLabels() { lblLastCompletedProgram.setText(""); lblProgramEndTimeValue.setText(""); lblCurrentlyRunningProgram.setText(""); lblProgramStartTimeValue.setText(""); lblEndOfDayRunningAtValue.setText(""); lblEndOfDayAccountingDayValue.setText(""); lblEndOfDayStartedValue.setText(""); lblEndOfDayStartedByValue.setText(""); } /** * Get custom permission hashtable for this form. */ private Hashtable getCustomPermission() { Hashtable permissions = new Hashtable(); permissions.put(FwoToolBarDirector.DELETE_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.SAVE_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.NEW_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.EDIT_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.NAV_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.FIND_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.PRINT_OK, new Boolean(false)); permissions.put(FwoToolBarDirector.SORT_OK, new Boolean(false)); return permissions; } /** * Get custom tool bar director for this form. */ private FwoToolBarDirector getCustomToolBarDirector() { return getCustomToolBarDirector(getCustomPermission()); } private FwoToolBarDirector getCustomToolBarDirector(Hashtable permissions) { return new FwoToolBarDirector(permissions); } protected void formLoaded() { FM = new TamsFormMaster(this, (FwiFormProcess) this.getParentForm(), null, getCustomToolBarDirector()); m_NavMgr = FwoSessionMgr.getInstance().getNavigationMgr(); FM.addEnabledViewModeComp(pbStartEOD); FM.addEnabledViewModeComp(pbStopEOD); // Optionally display testing controls pbStartEOD.setVisible(TEST_MODE_ON); pbStopEOD.setVisible(TEST_MODE_ON); if(isAPIEODTriggerSource()){ pbRestart.setVisible(false); pbStartBackupNow.setVisible(false); } } protected void formActivate() { clearLabels(); FM.setMode(FwoFormMaster.VIEW_MODE); /* are there any EOD process running? check if we are running it ourselves, if not, check all * System level jobs. * if anything is running, re-start button is not enabled. */ controller = EODController.getController(FM.m_loc); Integer empID = ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId(); String currentIPAddress = ((TsoProfile)FwoSessionMgr.getInstance().getProfile()).getIPAddress(); ResourceUsageDAO resourceUsageDAO = (ResourceUsageDAO)(ClientApplicationContext.getClientApplicationContext()).getResourceUsageDAO(); boolean resourceInUse = resourceUsageDAO.isResourceInUse(ResourceMonitorConstants.EOD_CLIENT).booleanValue(); if(controller.isEODInProgressOnServer() || resourceInUse) { // found running jobs, no restart button. logger.debug("pbRestart.setEnabled(false)"); pbRestart.setEnabled(false); pbStartBackupNow.setEnabled(false); tmrEODLog.startTimer(); } else if(!TEST_MODE_ON) { //set resource in use ClientApplicationContext clientApplicationContext = ClientApplicationContext.getClientApplicationContext(); ResourceUsageVO resourceUsageVO = new ResourceUsageVO(); resourceUsageVO.setResource(ResourceMonitorConstants.EOD_CLIENT); resourceUsageVO.setLocation(new Integer(ClientApplicationContext.getClientApplicationContext().getLocation())); resourceUsageVO.setSession(ClientApplicationContext.getClientApplicationContext().getSessionId()); resourceUsageVO.setTerminal(ClientApplicationContext.getClientApplicationContext().getSystemDAO().getTerminalFromIPAddress(clientApplicationContext.getClientIPAddress(), FM.m_loc)); EmployeeVO evo = null; try { evo = ClientApplicationContext.getClientApplicationContext().getEmployeeDAO().getEmployeeInfo(ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId()); } catch (ApplicationException e) { logger.error(e,e); ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage(e.getUserMessageID()); } resourceUsageVO.setEmployee(evo); // logger.info("End of day not running. Find out why."); // not currently running. /* first, find out why it isn't started. Was there an error? if so, offer restart. If not, and it * just hasn't run yet today, then show the "not started" message, and fail back to the main form. **/ // logger.debug("Did the service die in an error?"); boolean wasError = controller.isEODFailed(); if(wasError) { try{ resourceUsageDAO.setResourceInUse(resourceUsageVO); String res = (String) FwoSessionMgr.getInstance().getNavigationMgr().showFormDialog(this,TsoConstant.FRM_EOD_ERROR); if(res != null && !res.equals("") && res.equals("OK")) { pbRestart.setEnabled(true); logger.debug("pbRestart.setEnabled(true)"); }else if(res != null && !res.equals("") && res == ("RESTART")) { // Restarting is true. startEndOfDay(true); tmrEODLog.startTimer(); pbRestart.setEnabled(false); logger.debug("pbRestart.setEnabled(false)"); } refreshMonitor( controller.getEODLog(), controller.getMonitorVO()); } catch(AgoUnrecoverableSystemException e) { logger.error(e.toString(), e); resourceUsageDAO.setResourceNotInUse(resourceUsageVO); } catch(IOException ie) { logger.error(ie.toString(), ie); resourceUsageDAO.setResourceNotInUse(resourceUsageVO); } catch (AgoSecurityException e) { logger.error(e.toString(), e); resourceUsageDAO.setResourceNotInUse(resourceUsageVO); } } else { // there was no error, the process just has not yet been started, so // display the "not started" message and dump back to main form. closeMe(); } } } private void closeMe() { SwingUtilities.invokeLater(new Runnable() { public void run() { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage("1031"); FM.getToolBar().requestFocus(); com.gpc.client.backoffice.app.TsiMainProcess mainProcess = FwoSessionMgr.getInstance().getNavigationMgr().getMainForm(); mainProcess.fRemoveCurrentForm(); } }); } private void handle_tmrEODLog_timeIntervalExpired(EventObject event) { refreshMonitor(); Integer empID =ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId(); String currentIPAddress = ClientApplicationContext.getClientApplicationContext().getClientIPAddress(); if(!controller.isEODInProgressOnServer()) { tmrEODLog.stopTimer(); } boolean wasError = controller.isEODFailed(); if(wasError) { pbRestart.setEnabled(true); logger.debug("pbRestart.setEnabled(true)"); } if((getEndOfDayMonitorVO().getEODStartedDate()!= null && getEndOfDayMonitorVO().getNewDayStartedDate()!= null) ||(getEndOfDayMonitorVO().getEODStartedDate()== null && getEndOfDayMonitorVO().getNewDayStartedDate()== null)){ pbStartBackupNow.setEnabled(false); } } private void refreshMonitor() { refreshMonitor(controller.getEODLog(), controller.getMonitorVO()); } private void refreshMonitor(String logInfo, EndOfDayMonitorVO eodVO) { // logger.debug("refreshMonitor()"); try { if(logInfo == null || eodVO == null) { logger.debug("logInfo or eodVO == null"); return; } jtextLog.setText(logInfo); clearLabels(); // update form with monitor info if(eodVO != null) { TamsCacheMgr cacheMgr = (TamsCacheMgr)FwoSessionMgr.getInstance().getCacheMgr(); Locale locale = ClientApplicationContext.getClientApplicationContext().getCurrentLocale(); if(eodVO.getLastCompletedRefEODTaskID() != null && cacheMgr != null) { lblLastCompletedProgram.setText(cacheMgr.getListDataItem(TsoConstant.LIST_REF_EOD_TASK, eodVO.getLastCompletedRefEODTaskID())); } FwoPattern timePattern = FwoPattern.getTimePatternInstance(locale); if(eodVO.getLastTaskCompletedDate() != null) { lblProgramEndTimeValue.setText(timePattern.format(eodVO.getLastTaskCompletedDate(), locale)); } if(eodVO.getCurrentRefEODTaskID() != null && cacheMgr != null) { String currentIPAddress = ((TsoProfile)FwoSessionMgr.getInstance().getProfile()).getIPAddress(); if(eodVO.getCurrentRefEODTaskID().intValue() == 49 && currentIPAddress.equals(eodVO.getStartedByIPAddress())){ EndOfDayMonitorVO eodMVO = getEndOfDayMonitorVO(); if(eodMVO.getStartBackupNow() == null || eodMVO.getStartBackupNow().equalsIgnoreCase("N")){ pbStartBackupNow.setEnabled(true); } } lblCurrentlyRunningProgram.setText(cacheMgr.getListDataItem(TsoConstant.LIST_REF_EOD_TASK, eodVO.getCurrentRefEODTaskID())); } if(eodVO.getCurrentTaskStartDate() != null) { lblProgramStartTimeValue.setText(timePattern.format(eodVO.getCurrentTaskStartDate(), locale)); } if(eodVO.getStartedByIPAddress() != null) { lblEndOfDayRunningAtValue.setText(eodVO.getStartedByIPAddress()); } FwoDatePattern m_datePattern = (FwoDatePattern) FwoPattern.getDatePatternInstance(locale, new Integer(ClientApplicationContext.getClientApplicationContext().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation() ).getStoreProfile().getRefDateFormatId().intValue())); if(eodVO.getAcctDay() != null && eodVO.getSalesYearMonth() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(eodVO.getSalesYearMonth()); //Bug #30638 START : If the month is a one digit number, then convert it to a two digit number. String strCalenderMonth = (new Integer(cal.get(Calendar.MONTH) + 1)).toString(); if(strCalenderMonth.length() == 1) { strCalenderMonth = "0" + strCalenderMonth; } //If the accounting day is a one digit number, then convert it to a two digit number. String strAcctDay = eodVO.getAcctDay().toString(); if(strAcctDay.length()==1) { strAcctDay = "0" + strAcctDay; } //String yearAcctday = (cal.get(Calendar.MONTH) + 1) + "/" + eodVO.getAcctDay().toString() + "/" + cal.get(Calendar.YEAR); String yearAcctday = strCalenderMonth + "/" + strAcctDay + "/" + cal.get(Calendar.YEAR); //lblEndOfDayAccountingDayValue.setText(m_datePattern.format(new Date(yearAcctday), locale)); lblEndOfDayAccountingDayValue.setText(yearAcctday); // Bug #30638 END } if(eodVO.getEODStartedDate() != null) { Calendar cal = Calendar.getInstance(); cal.setTime(eodVO.getEODStartedDate()); String startDate = (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.YEAR); String startTime = timePattern.format(eodVO.getEODStartedDate(), locale); lblEndOfDayStartedValue.setText(m_datePattern.format(new Date(startDate), locale) + " " + startTime); } if(eodVO.getStartedByEmployeeName() != null) { lblEndOfDayStartedByValue.setText(eodVO.getStartedByEmployeeName()); } } else { logger.debug("eodVO == null"); } } catch (Exception e) { logger.error(e.toString(), e); } } public void timeIntervalExpired(EventObject event) { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === Object src = event.getSource(); if (src == tmrEODLog) { handle_tmrEODLog_timeIntervalExpired(event); return; } } private void handle_pbStartEOD_actionPerformed(ActionEvent evt) { try { Object[] testTaskList = (Object[])m_NavMgr.showForm(this, TsoConstant.FRM_EOD_TEST_TASK_LIST); agDialog.showMessage("To stop the test process, click the 'Stop EOD Test' button. This will allow you to test the 'Restart' functionality."); controller.setTestTaskList(testTaskList); // Restarting is false startEndOfDay(false); tmrEODLog.startTimer(); pbRestart.setEnabled(false); logger.debug("pbRestart.setEnabled(false)"); } catch (Exception e) { logger.error(e.toString(), e); } } private void handle_pbStopEOD_actionPerformed(ActionEvent evt) { controller.stopEODProgress(); } private void handle_pbStartBackupNow_actionPerformed(ActionEvent evt){ if(getEndOfDayMonitorVO().getStartBackupNow()!= null && getEndOfDayMonitorVO().getStartBackupNow().equalsIgnoreCase("N")){ if(!ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessageOKCancel(this,"3506")){ return; } } if(getEndOfDayMonitorVO().getCurrentRefEODTaskID() != null && getEndOfDayMonitorVO().getCurrentRefEODTaskID().intValue()== 49){ setStartBackupNow(); } pbStartBackupNow.setEnabled(false); } private EndOfDayMonitorVO getEndOfDayMonitorVO() { EndOfDayMonitorVO endOfDayMonitorVO = null; try { SBSystem sbSystem = getSBSystem(); if(sbSystem != null) { endOfDayMonitorVO = sbSystem.getEndOfDayMonitor(FM.m_loc); } } catch(RemoteException re) { EJBRemoteExceptionHelper.HandleMarshalException(re); } return endOfDayMonitorVO; } private static SBSystem getSBSystem() { if(sbSystem == null) { try { JNDILocator jndiLocator = JNDILocator.getInstance(); SBSystemHome sbSystemHome = (SBSystemHome)jndiLocator.getEJBHome( SBSystemHome.class, JNDILocatorConstants.SBSYSTEM_RMISTR); sbSystem = sbSystemHome.create(); } catch(Exception e) { logger.error(e.getMessage(), e); } } return sbSystem; } private void setStartBackupNow(){ ExecuteSQLVO executeSqlVo = new ExecuteSQLVO(); ResultsVO resultsVo = null; StringBuffer sbUpdate = new StringBuffer(); sbUpdate.append("UPDATE "); sbUpdate.append("END_OF_DAY_MONITOR"); sbUpdate.append(" SET "); sbUpdate.append("START_BACKUP_NOW = "); sbUpdate.append("\'Y\'"); executeSqlVo.setSqlQuery(sbUpdate.toString()); resultsVo = InvokerBridge.invoke(executeSqlVo); if (resultsVo.getError() != null) { logger.error("Error "+resultsVo.getError()); } } public Object ag_getValue(DataCursor cursor, int valueID, Object param1, Object param2) { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === try { switch (valueID) { case 0: /* LOC () END_OF_DAY_MONITOR.LOC*/ return ((Integer) cursor.getProperty(0)); case 1: /* STARTED_BY_IP_ADDRESS () END_OF_DAY_MONITOR.STARTED_BY_IP_ADDRESS*/ return ((String) cursor.getProperty(1)); default: return null; } } catch (Throwable e) { return null; } } public void actionPerformed(ActionEvent evt) { //==== Warning: SilverStream-generated method: do not edit. All changes will be lost === Object src = evt.getSource(); if (src == pbStartEOD) { handle_pbStartEOD_actionPerformed(evt); return; } if (src == pbRestart) { handle_pbRestart_actionPerformed(evt); return; } if (src == pbStartBackupNow) { handle_pbStartBackupNow_actionPerformed(evt); return; } if (src == pbStopEOD) { handle_pbStopEOD_actionPerformed(evt); return; } super.actionPerformed(evt); } public boolean fValidateComponent(javax.swing.JComponent jComponent1) { return true; } public boolean fDelete() { return false; } public boolean fEdit() { return false; } public boolean fFindExec() { return false; } public boolean fFindMode() { return false; } public boolean fFirst() { return false; } public boolean fLast() { return false; } public boolean fNew() { return false; } public boolean fNext() { return false; } public boolean fPrevious() { return false; } public boolean fSave() { return false; } public void fSort() { } public boolean fValidate() { return true; } public void fCancel() { } public boolean fValidateJTableCell(com.gpc.client.common.table.FwoJTableMgr fwoJTableMgr1, int int2, int int3) { return true; } public boolean fValidateJTableRow(com.gpc.client.common.table.FwoJTableMgr fwoJTableMgr1, int int2) { return true; } public boolean fNeedsUpdate() { return false; } public void fPostNew() { } public void fPostSave() { } public void fPostEdit() { } public void fPostCancel() { } public void fPostDelete() { } public java.util.Locale fGetCurrentRecordLocale(javax.swing.JComponent jComponent1) { return (java.util.Locale)null; } public Integer fGetFunctionId() { return TsoConstant.SA_EOD_MONITOR_RESTART; } public void finalize() throws Throwable { logger.debug("Memory being released: " + this); super.finalize(); } public boolean fClose() { logger.debug("fClose()"); if(tmrEODLog != null) { tmrEODLog.stopTimer(); } removeGlobalReferences(); return true; } /** * Set All Globals null except: * No primitives (int, boolean) * No constant renames (private TsoConstant TC); * No agcdatas * No final variables */ private void removeGlobalReferences() { FM = null; agcEODMonitor = null; tmrEODLog = null; controller = null; m_NavMgr = null; removeAllGUIComponentReferences(); } private void removeAllGUIComponentReferences() { pbStopEOD = null; pbStartEOD = null; jtextLog = null; jtextLogScrollPane = null; tmrEODLog = null; lblEndOfDayStartedValue = null; lblEndOfDayStarted = null; lblProgramStartTimeValue = null; lblProgramStartTime = null; lblProgramEndTimeValue = null; lblProgramEndTime = null; rectLog = null; lblCurrentlyRunningProgram = null; lblLastCompletedProgram = null; lblEndOfDayAccountingDayValue = null; lblEndOfDayStartedByValue = null; lblEndOfDayRunningAtValue = null; pbRestart = null; lblEndOfDayStartedBy = null; lblEndOfDayRunningAt = null; lblEndOfDayAccountingDay = null; lblTitle = null; rectGeneralInformation = null; rectLastCompletedProgram = null; rectCurrentlyRunningProgram = null; } /** * This method is used to check the EOD_TRIGGERED_SOURCE from END_OF_DAY_PROFILE table and value is equal to MANUALLY or not. */ public boolean isManualEODTriggerSource(){ ClientApplicationContext cac = ClientApplicationContext.getClientApplicationContext(); EndOfDayProfileVO endOfDayProfileVO = cac.getProfile(Profile.BACKOFFICE_CLIENT, cac.getLocation()).getEndOfDayProfile(); String eodTriggeredSource = endOfDayProfileVO.getEodTriggeredSource(); boolean isManualEODTriggerSource = false; if(eodTriggeredSource != null && eodTriggeredSource.equalsIgnoreCase(RefEODTriggeredSource.MANUALLY)){ isManualEODTriggerSource = true; } return isManualEODTriggerSource; } /** * Starts/restarts end of day. This method displays printer dialog for TAMSII reports and * printer dialog for TAMSII bin labels. If printer selections are made successfully then EOD is * started. Any changes to this method also require changes to startEOD method of * com.sssw.gen.forms.FrmEOD_StartEODManual form. * * @param isRestarting the is restarting */ private void startEndOfDay(final boolean isRestarting) { if(!isManualEODTriggerSource()){ ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage( this, "1031a"); return; } if (!controller.isDiskSpaceAvailable(1024 * 1024 * 1024)) { ClientApplicationContext.getClientApplicationContext().getMessageMgr().showMessage( this, "3507"); return; } // Printer setting to show TAMSII Reports printer dialog final FwoPrinterSelectionSettings reportPrinterSettings = ClientUtil.selectPrinterSettings( this, TsoConstant.TAMS_SELECT_PRINTER_FOR_REPORTS, true); // No report printer is selected/available. // Cannot start EOD. log message and return to caller. if(reportPrinterSettings == null || reportPrinterSettings.getPrintSettings() == null) { logger.info("No printer selection made for 'Select Printer for TAMSII Reports'." + " EOD is not started."); return; } final Integer employeeId = ClientApplicationContext.getClientApplicationContext().getCurrentUser().getEmployeeId(); // Check printing of bin labels is required at EOD in Inventory Management if (ClientApplicationContext.getClientApplicationContext().getProfile( Profile.BACKOFFICE_CLIENT, ClientApplicationContext.getClientApplicationContext().getLocation()) .getInventoryProfile().getPrintBinLabelsAtEod().booleanValue()) { // Printer setting to show TAMSII Bin Labels printer dialog final FwoPrinterSelectionSettings binLabelPrinterSettings = ClientUtil.selectPrinterSettings( this, TsoConstant.TAMS_SELECT_PRINTER_FOR_LABELS, true); // No bin label printer is selected/available. User clicked on cancel. // Cannot start EOD. log message and return to caller. if(binLabelPrinterSettings == null || binLabelPrinterSettings.getPrintSettings() == null) { logger.info("No printer selection made for 'Select Printer for TAMSII bin labels." + " EOD is not started."); return; } logger.warn("Inside StartEndOfDay method in FrmEOD_EODMonitor Class : "+isRestarting); // start EOD with the gathered information. controller.startEndOfDay(isRestarting, true, employeeId, reportPrinterSettings.getPrintSettings(), binLabelPrinterSettings.getPrintSettings(), agGeneral); } else { // start EOD with the gathered information. // Pass dummy printer settings because printing of bin labels is // not required here. logger.warn("Inside StartEndOfDay method in FrmEOD_EODMonitor Class : "+isRestarting); controller.startEndOfDay(isRestarting, true, employeeId, reportPrinterSettings.getPrintSettings(), new FwoPrintSettings(), agGeneral); } } /** * This method is used to check the EOD_TRIGGERED_SOURCE from END_OF_DAY_PROFILE table and value is equal to API or not. */ public boolean isAPIEODTriggerSource(){ ClientApplicationContext cac = ClientApplicationContext.getClientApplicationContext(); EndOfDayProfileVO endOfDayProfileVO = cac.getProfile(Profile.BACKOFFICE_CLIENT, cac.getLocation()).getEndOfDayProfile(); String eodTriggeredSource = endOfDayProfileVO.getEodTriggeredSource(); boolean isManualEODTriggerSource = false; if(eodTriggeredSource != null && eodTriggeredSource.equalsIgnoreCase(RefEODTriggeredSource.API)){ isManualEODTriggerSource = true; } return isManualEODTriggerSource; } }