org.bibalex.daf.managers.archive
Class ArchiverManagerGUI

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.bibalex.daf.managers.BaseManagerGUI
                      extended by org.bibalex.daf.managers.archive.ArchiverManagerGUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ArchiverManagerGUI
extends BaseManagerGUI

This class manages the archiving operation over the finished jobs. the operation can be described as forming medias (CDs,Tapes,.. ). ArchiverManager gives the user the ability to select first fit jobs in the selected media type, it gives also first level of confirming jobs on media or not, after finishing the process of forming media the archiver list to the user the archived job and ask for confirming this media or discard it

Author:
mohammed.abuouda
See Also:
Serialized Form

Nested Class Summary
private  class ArchiverManagerGUI.Archiver
          This thread carries out downloading jobs folders and forming medias
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JLabel allJobCountLabel
           
private  FileHandlerFTPImpl backupFileHandler
          backupFileHandler is ftp file handler to download folders from backup server to the local machine
private  java.lang.String backupServerIP
          backupServerIP represents the backup server IP that holds the backed up folders
private  java.lang.String backupServerPassword
          backupServerPassword represents the backup server Password
private  java.lang.String backupServerPath
          backupServerPath represents the path that contains the backed up folders
private  java.lang.String backupServerUser
          backupServerUser represents the backup server User Name
(package private)  CheckBoxList.ICheckBoxListActionListener checkBoxActionListener
          checkBoxActionListener is the listener assigned to readyToArchiveCheckList which fires on selecting or deselecting items
private  javax.swing.JButton clearButton
          clearButton is the button that clear all
private  javax.swing.JTextField extraSizeTextField
          extraSizeTextField represents the extra size progress bar
private  javax.swing.JCheckBox firstFitCheckBox
          firstFitCheckBox helps in collecting jobs according to the concept of first fit job size
private  javax.swing.JLabel firstFitLabel
           
private  FileHandlerFTPImpl ftpFileHandler
          ftpFileHandler is ftp file handler to upload folders to online storage directly
private  javax.swing.JLabel jobSizeLabel
           
private  javax.swing.JPanel jPanel
          jPanel is Main panel which containes master and details panels
private  FileHandlerLocalImpl localFileHandler
          localFileHandler is a local file handler to create and delete media folder
private  javax.swing.JPanel masterPanel
          masterPanel is the panel that carry the basic components which are readyToArchiveCheckList, Buttons and progress bars
private  javax.swing.JLabel mediaSizeLabel
           
private  javax.swing.JComboBox MediaTypeComboBox
          MediaTypeComboBox shows system media types
private  javax.swing.JLabel mediaTypeLabel
           
private  javax.swing.JLabel mediaTypeSizeLabel
           
(package private)  boolean processLife
          processLife indicates whether the thread alive or not
(package private)  javax.swing.JProgressBar progressBar
           
private  javax.swing.JPanel progressPanel
          progressPanel is the panel that holds the progress text fields
private  CheckBoxList readyToArchiveCheckList
          readyToArchiveCheckList is the list that shows up the jobs that are ready to archive
private  javax.swing.JLabel readyToArchiveLabel
           
private  javax.swing.JScrollPane readyToArchiveScrollPane
          readyToArchiveScrollPane is the container Pane for ready to archive jobs table
private  javax.swing.JLabel selectedJobCountLabel
           
private  float selectedJobsSize
          selectedJobsSize holds the total size of selected jobs
private  javax.swing.JLabel sizeLabel
           
private  javax.swing.JButton submitButton
          submitButton is the archive button
private  float totalSize
          totalSize represents the total size of media type
(package private)  int totalWidth
          totalWidth represents the total width (interface wise)
(package private)  int varHight
          varHight represents the hight of size progress bar
private  javax.swing.JTextField variableSizeTextField
          variableSizeTextField represents the size progress bar
 
Fields inherited from class org.bibalex.daf.managers.BaseManagerGUI
currentInstance, resourceManager
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ArchiverManagerGUI()
          ArchiverManagerGUI is the class constructor, it initializes the GUI and variables
 
Method Summary
private  void adjustJobsCheckList()
          This method adjusts the ready to archive check list
private  void clearAll()
          This method clears and resets GUI components
private  void getBackupServerInformation()
          getBackupServerInformation reads backup server credentials
private  javax.swing.JButton getClearButton()
          This method initializes clearButton Which clear the GUI
private  javax.swing.JTextField getExtraSizeTextField()
          This method initializes Extra Size TextField
private  javax.swing.JCheckBox getFirstFitCheckBox()
           
private  CheckBoxList.ICheckBoxListActionListener getICheckBoxListActionListener()
          This method initialize the lister for readyToArchiveCheckList, if user select job, the lister calculates the size and repaints the progrss bars.
private  javax.swing.JPanel getJPanel()
          This method initializes jPanel
private  javax.swing.JPanel getMasterPanel()
          This method initializes masterPanel
private  javax.swing.JComboBox getMediaTypesComboBox()
          This methos loads available media types
private  java.util.ArrayList<java.lang.String> getOnlineMediaCredentials()
          This method gets host IP,UserName andpassword for online media storage
private  javax.swing.JProgressBar getProgressBar()
          This method initializes progressBar
private  javax.swing.JPanel getProgressPanel()
          This method initializes progressPanel
 CheckBoxList getReadyToArchiveCheckList()
          This method loads jobs that are ready to archive
 javax.swing.JScrollPane getReadyToArchiveScrollPane()
          This method initializes readyToArchiveScrollPane
private  javax.swing.JButton getSubmitButton()
          This methos initializes submitButton Which carry out the archiving function
private  javax.swing.JTextField getVariableSizeTextField()
          This method initializes variable Size TextField
private  void initialize()
          This method initializes this layout
 void reloadManager()
          Resets controls
private  void showAnyErrorMsg(java.lang.String msg)
           
private  void showAnyMsg(java.lang.String msg)
           
private  void showErrorMsg(java.lang.String msg)
          Show message box
 
Methods inherited from class org.bibalex.daf.managers.BaseManagerGUI
setFocus, updateTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jPanel

private javax.swing.JPanel jPanel
jPanel is Main panel which containes master and details panels


masterPanel

private javax.swing.JPanel masterPanel
masterPanel is the panel that carry the basic components which are readyToArchiveCheckList, Buttons and progress bars


progressPanel

private javax.swing.JPanel progressPanel
progressPanel is the panel that holds the progress text fields


readyToArchiveScrollPane

private javax.swing.JScrollPane readyToArchiveScrollPane
readyToArchiveScrollPane is the container Pane for ready to archive jobs table


submitButton

private javax.swing.JButton submitButton
submitButton is the archive button


clearButton

private javax.swing.JButton clearButton
clearButton is the button that clear all


variableSizeTextField

private javax.swing.JTextField variableSizeTextField
variableSizeTextField represents the size progress bar


extraSizeTextField

private javax.swing.JTextField extraSizeTextField
extraSizeTextField represents the extra size progress bar


MediaTypeComboBox

private javax.swing.JComboBox MediaTypeComboBox
MediaTypeComboBox shows system media types


readyToArchiveCheckList

private CheckBoxList readyToArchiveCheckList
readyToArchiveCheckList is the list that shows up the jobs that are ready to archive


checkBoxActionListener

CheckBoxList.ICheckBoxListActionListener checkBoxActionListener
checkBoxActionListener is the listener assigned to readyToArchiveCheckList which fires on selecting or deselecting items


firstFitCheckBox

private javax.swing.JCheckBox firstFitCheckBox
firstFitCheckBox helps in collecting jobs according to the concept of first fit job size


selectedJobsSize

private float selectedJobsSize
selectedJobsSize holds the total size of selected jobs


readyToArchiveLabel

private javax.swing.JLabel readyToArchiveLabel

mediaTypeLabel

private javax.swing.JLabel mediaTypeLabel

sizeLabel

private javax.swing.JLabel sizeLabel

jobSizeLabel

private javax.swing.JLabel jobSizeLabel

mediaSizeLabel

private javax.swing.JLabel mediaSizeLabel

mediaTypeSizeLabel

private javax.swing.JLabel mediaTypeSizeLabel

firstFitLabel

private javax.swing.JLabel firstFitLabel

allJobCountLabel

private javax.swing.JLabel allJobCountLabel

selectedJobCountLabel

private javax.swing.JLabel selectedJobCountLabel

totalSize

private float totalSize
totalSize represents the total size of media type


totalWidth

int totalWidth
totalWidth represents the total width (interface wise)


varHight

int varHight
varHight represents the hight of size progress bar


processLife

boolean processLife
processLife indicates whether the thread alive or not


backupServerIP

private java.lang.String backupServerIP
backupServerIP represents the backup server IP that holds the backed up folders


backupServerUser

private java.lang.String backupServerUser
backupServerUser represents the backup server User Name


backupServerPassword

private java.lang.String backupServerPassword
backupServerPassword represents the backup server Password


backupServerPath

private java.lang.String backupServerPath
backupServerPath represents the path that contains the backed up folders


localFileHandler

private FileHandlerLocalImpl localFileHandler
localFileHandler is a local file handler to create and delete media folder


ftpFileHandler

private FileHandlerFTPImpl ftpFileHandler
ftpFileHandler is ftp file handler to upload folders to online storage directly


backupFileHandler

private FileHandlerFTPImpl backupFileHandler
backupFileHandler is ftp file handler to download folders from backup server to the local machine


progressBar

javax.swing.JProgressBar progressBar
Constructor Detail

ArchiverManagerGUI

public ArchiverManagerGUI()
ArchiverManagerGUI is the class constructor, it initializes the GUI and variables

Method Detail

initialize

private void initialize()
This method initializes this layout


getJPanel

private javax.swing.JPanel getJPanel()
This method initializes jPanel

Returns:
javax.swing.JPanel

getMasterPanel

private javax.swing.JPanel getMasterPanel()
This method initializes masterPanel

Returns:
javax.swing.JPanel

getProgressPanel

private javax.swing.JPanel getProgressPanel()
This method initializes progressPanel

Returns:
javax.swing.JPanel

getReadyToArchiveScrollPane

public javax.swing.JScrollPane getReadyToArchiveScrollPane()
This method initializes readyToArchiveScrollPane

Returns:
javax.swing.JScrollPane

adjustJobsCheckList

private void adjustJobsCheckList()
This method adjusts the ready to archive check list


getSubmitButton

private javax.swing.JButton getSubmitButton()
This methos initializes submitButton Which carry out the archiving function

Returns:
JButton

getClearButton

private javax.swing.JButton getClearButton()
This method initializes clearButton Which clear the GUI

Returns:
javax.swing.JButton

getVariableSizeTextField

private javax.swing.JTextField getVariableSizeTextField()
This method initializes variable Size TextField

Returns:
javax.swing.JTextField

getExtraSizeTextField

private javax.swing.JTextField getExtraSizeTextField()
This method initializes Extra Size TextField

Returns:
javax.swing.JTextField

getMediaTypesComboBox

private javax.swing.JComboBox getMediaTypesComboBox()
This methos loads available media types

Returns:
JComboBox

getReadyToArchiveCheckList

public CheckBoxList getReadyToArchiveCheckList()
This method loads jobs that are ready to archive

Returns:
org.bibalex.daf.commongui.controls.CheckBoxList

getICheckBoxListActionListener

private CheckBoxList.ICheckBoxListActionListener getICheckBoxListActionListener()
This method initialize the lister for readyToArchiveCheckList, if user select job, the lister calculates the size and repaints the progrss bars. If the accumulated size is less than the total size then the red progrss bar will not be shown, otherwise it will appear

Returns:
ICheckBoxListActionListener

getProgressBar

private javax.swing.JProgressBar getProgressBar()
This method initializes progressBar

Returns:
JProgressBar

showErrorMsg

private void showErrorMsg(java.lang.String msg)
Show message box

Parameters:
msg - string in Resource File

showAnyErrorMsg

private void showAnyErrorMsg(java.lang.String msg)

showAnyMsg

private void showAnyMsg(java.lang.String msg)

clearAll

private void clearAll()
This method clears and resets GUI components


getFirstFitCheckBox

private javax.swing.JCheckBox getFirstFitCheckBox()

getBackupServerInformation

private void getBackupServerInformation()
                                 throws java.lang.Exception
getBackupServerInformation reads backup server credentials

Throws:
java.lang.Exception

getOnlineMediaCredentials

private java.util.ArrayList<java.lang.String> getOnlineMediaCredentials()
                                                                 throws java.lang.Exception
This method gets host IP,UserName andpassword for online media storage

Returns:
ArrayList
Throws:
java.lang.Exception

reloadManager

public void reloadManager()
Resets controls

Specified by:
reloadManager in class BaseManagerGUI