PIRL

PIRL.Conductor
Class Pipeline_Source_Manager

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by PIRL.Conductor.Pipeline_Source_Manager
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants

public class Pipeline_Source_Manager
extends JFrame
implements ActionListener

The Pipeline_Source_Manager manages unprocessed source records in a Conductor pipeline Sources table.

Pipeline_Source_Manager provides a GUI to view any unprocessed source records in any Conductor Sources table accessible within the catalog specified by the CATALOG parameter in a PVL-style configuration file specified at the time the application is launched. The operator can optionally delay the processing of selected sources by setting the Conductor_ID to the value specified in the static variable DELAY_PROCESSING_STRING, or release a delayed source record by resetting the Conductor_ID to NULL. Source records can also be deleted from Sources tables, but will not remove the source file specified in the Source_Pathname from the filesystem.

Note: The application assumes that all pipeline source tables end with the word "Sources."

The usage description specifies the application command line syntax and describes the GUI elements.

Version:
1.7
Author:
Rodney Heyd UA/PIRL
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String DEFAULT_CONFIGURATION_FILENAME
          The default configuration file.
static String DELAY_PROCESSING_STRING
          This string is used to update the Conductor_ID of a source to indicate that processing of the source record should be delayed.
static int EXIT_COMMAND_LINE_SYNTAX_ERROR
          Exit Status Values
static int EXIT_CONFIGURATION_ERROR
          Exit Status Values
static int EXIT_DATABASE_ERROR
          Exit Status Values
static int EXIT_SUCCESS
          Exit Status Values
static String ID
          Class ID
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Pipeline_Source_Manager(Configuration configuration)
          Construct a Pipeline_Source_Manager using a Configuration.
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 boolean Delay_Source(int source_number, String table)
          This method will set the Conductor ID field of a source record to the DELAY_PROCESSING_STRING to cause a conductor to skip the specified source.
 boolean Delete_Source(int source_number, String table)
          This method deletes a source number from a specified table.
static void main(String[] arguments)
          Manage sources in a Conductor Pipeline Source Table.
 boolean Process_Source(int source_number, String table)
          This method makes a source available for processing that was delayed using the Delay_Source(int, String) method.
static void Usage()
          Prints the command line usage syntax.
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

ID

public static final String ID
Class ID

See Also:
Constant Field Values

DEFAULT_CONFIGURATION_FILENAME

public static final String DEFAULT_CONFIGURATION_FILENAME
The default configuration file.

See Also:
Constant Field Values

DELAY_PROCESSING_STRING

public static final String DELAY_PROCESSING_STRING
This string is used to update the Conductor_ID of a source to indicate that processing of the source record should be delayed.

The "clear delayed source" functionality will only operate on sources with a Conductor_ID that matches this value.

See Also:
Constant Field Values

EXIT_SUCCESS

public static final int EXIT_SUCCESS
Exit Status Values

See Also:
Constant Field Values

EXIT_DATABASE_ERROR

public static final int EXIT_DATABASE_ERROR
Exit Status Values

See Also:
Constant Field Values

EXIT_CONFIGURATION_ERROR

public static final int EXIT_CONFIGURATION_ERROR
Exit Status Values

See Also:
Constant Field Values

EXIT_COMMAND_LINE_SYNTAX_ERROR

public static final int EXIT_COMMAND_LINE_SYNTAX_ERROR
Exit Status Values

See Also:
Constant Field Values
Constructor Detail

Pipeline_Source_Manager

public Pipeline_Source_Manager(Configuration configuration)
Construct a Pipeline_Source_Manager using a Configuration.

A database will be established and the GUI will be displayed.

Parameters:
configuration -
Method Detail

Delete_Source

public boolean Delete_Source(int source_number,
                             String table)
                      throws Database_Exception
This method deletes a source number from a specified table.

Parameters:
source_number - - the source_number of the source to be deleted.
table - - the table the source is to be deleted from
Returns:
true if the sources was successfully deleted, false otherwise. A false return value means that either the source id doesn't exist, or a conductor has started processing the source.
Throws:
Database_Exception - if a database error occurs while attempting to delete the source.

Process_Source

public boolean Process_Source(int source_number,
                              String table)
                       throws Database_Exception
This method makes a source available for processing that was delayed using the Delay_Source(int, String) method. It will only reset sources for which the Conductor ID field has been set to the value of "Source Delayed"

Parameters:
source_number - - the source_number to operate on
table - - the table containing the sources to be reset
Returns:
true if the database update was successfull.
Throws:
Database_Exception - if a database error occurred during the update.
See Also:
Delay_Source(int, String), DELAY_PROCESSING_STRING

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

Delay_Source

public boolean Delay_Source(int source_number,
                            String table)
                     throws Database_Exception
This method will set the Conductor ID field of a source record to the DELAY_PROCESSING_STRING to cause a conductor to skip the specified source. This gives the operator a very limited ability to prioritize sources by delaying the processing of some source fields while allowing others to be processed.

Parameters:
source_number - - the source number to be delayed
table - - the pipeline source table containing the source to be delayed
Returns:
true if the Conductor ID of the given source was successfully updated. A false return value indicates that either the source does not exist, or a conductor has already begun processing the source.
Throws:
Database_Exception - if a database error occurs while attempting to update the source record.
See Also:
Process_Source(int, String), DELAY_PROCESSING_STRING

main

public static void main(String[] arguments)
Manage sources in a Conductor Pipeline Source Table.

The command line syntax is described in the Usage() method.

Exit Status Values:

EXIT_SUCCESS
No errors occurred.
EXIT_DATABASE_ERROR
There was a problem accessing the database.
EXIT_CONFIGURATION_ERROR
There was a problem with the Configuration file.
EXIT_COMMAND_LINE_SYNTAX_ERROR
The command line contains invalid syntax.

Parameters:
arguments - The command line arguments.

Usage

public static void Usage()
Prints the command line usage syntax.

Usage: Pipeline_Source_Manager <Options>
  Options -
    [-Configuration <source>
      Default: Database.conf
    [-Help]

Configuration

Pipeline_Source_Manager requires a Configuration file which contains database and catalog connection information. The provider Conductor.conf file is a suitable template to use for this purpose.

The GUI consists of:

A Source Table selector
Used to select the effective Sources table.
A Source_Pathname filter
A full or partial pathname is used to filter the source records list to contain only the records with matching Source_Pathname field values.
Operations buttons
Used to perform the coresponding delay/undelay or delete operations on the source records selected in the Sources table.

Note: If a Conductor has started processing a source record after the time that a Sources table was read from the database, the Pipeline_Source_Manager will not operate on that source record. This prevents the Conductor_ID from being set to a delayed status if a Conductor has already acquired the source record.

Sources table
A table listing the unprocessed and delayed sources found in the currently selected Sources Table. One or more of the source records listed in the table may be selected and then an Operation button used to perform the corresponding operation on the selected source records.


PIRL

Copyright (C) \ 2003-2009 Bradford Castalia, University of Arizona