jwo.vfc.hubclient
Class ClientBean

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--jwo.vfc.hubclient.ClientBean
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class ClientBean
extends Panel
implements Serializable

Creates a Hub client bean.

Version:
1.2.3, 1st November, 1999.
Author:
Jo Wood
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
ClientBean()
          Creates a hub client that can connect to a VFC hub server.
ClientBean(String configFile)
          Creates a hub client that can connect to a VFC hub server with the parameters defined in the given config file.
 
Method Summary
 boolean createConfigFile(String configFile)
          Creates a configuration file containing the currently chosen hub client options.
 String getAccess()
          Reports the type of access for submitted objects.
 boolean getBorder()
          Reports the border drawing status of the bean.
 String getHost()
          Reports the host running the hub server.
 String getLogin()
          Reports the username for restricted database access.
 Dimension getMinimumSize()
          Determines the minimum size of the bean.
 String getOutput()
          Reports the output directory for files downloaded from the hub.
 String getOutputFile()
          Reports the full relative output path for a file downloaded from the hub.
 String getPassword()
          Reports the password for restricted database access.
 int getPort()
          Reports the port to connect to the hub server.
 Dimension getPreferredSize()
          Determines the preferred size of the bean.
 String getTitle()
          Reports the title of this bean.
 void paint(Graphics g)
          Draws a visual representation of the bean.
 String sendMessage(String message)
          Sends a message to the hub server and returns its response.
 void setAccess(String access)
          Sets the default access rights for submitted objects.
 void setBorder(boolean border)
          Sets the border drawing status of the bean.
 void setHost(String host)
          Sets the host running the hub server.
 void setLogin(String login)
          Sets the username for restricted database access.
 void setOutput(String output)
          Sets the output directory for files downloaded from the hub.
 void setPassword(String password)
          Sets the password for restricted database access.
 void setPort(int port)
          Sets the port to connect to the hub server.
 void setTitle(String title)
          Sets the title displayed by the bean.
 boolean updateFromConfigFile(String configFile)
          Updates the client parameters from the given configuration file.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientBean

public ClientBean()
Creates a hub client that can connect to a VFC hub server.


ClientBean

public ClientBean(String configFile)
Creates a hub client that can connect to a VFC hub server with the parameters defined in the given config file.

Parameters:
configFile - Configuration file containing default client options.
Method Detail

sendMessage

public String sendMessage(String message)
Sends a message to the hub server and returns its response.

Parameters:
message - Message to send to server.
Returns:
Response of server. This could be an error message or metadata information.

updateFromConfigFile

public boolean updateFromConfigFile(String configFile)
Updates the client parameters from the given configuration file.

Parameters:
configFile - Name of file containing configuration information.
Returns:
True if updated successfully.

createConfigFile

public boolean createConfigFile(String configFile)
Creates a configuration file containing the currently chosen hub client options.

Parameters:
configFile - Name of configuration file to contain options.
Returns:
True if created sucessfully.

setHost

public void setHost(String host)
Sets the host running the hub server.

Parameters:
host - Host running the hub server.

getHost

public String getHost()
Reports the host running the hub server.

Returns:
Hub server host.

setPort

public void setPort(int port)
Sets the port to connect to the hub server.

Parameters:
port - Port to connect to the hub server.

getPort

public int getPort()
Reports the port to connect to the hub server.

Returns:
Hub server port.

setLogin

public void setLogin(String login)
Sets the username for restricted database access.

Parameters:
login - Username for database account.

getLogin

public String getLogin()
Reports the username for restricted database access.

Returns:
Database username.

setPassword

public void setPassword(String password)
Sets the password for restricted database access.

Parameters:
password - Password for database account.

getPassword

public String getPassword()
Reports the password for restricted database access.

Returns:
Database password.

setOutput

public void setOutput(String output)
Sets the output directory for files downloaded from the hub.

Parameters:
output - Output directory for downloaded files.

getOutput

public String getOutput()
Reports the output directory for files downloaded from the hub.

Returns:
Output directory for downloaded files.

getOutputFile

public String getOutputFile()
Reports the full relative output path for a file downloaded from the hub. This differs from getOutput as it includes the hub's machine name in the directory structure as well as the name of the transfered file.

Returns:
Output file's path.

setTitle

public void setTitle(String title)
Sets the title displayed by the bean.

Parameters:
title - New title for the bean.

getTitle

public String getTitle()
Reports the title of this bean.

Returns:
Title of the bean.

setBorder

public void setBorder(boolean border)
Sets the border drawing status of the bean.

Parameters:
border - 'Etched' border is drawn around bean if true.

getBorder

public boolean getBorder()
Reports the border drawing status of the bean.

Returns:
True if border present, false if absent.

setAccess

public void setAccess(String access)
Sets the default access rights for submitted objects. Can be "o" (owner only has read/write access, "r" global read access, or "w" global read/write access.

Parameters:
access - Type of access.

getAccess

public String getAccess()
Reports the type of access for submitted objects. Can be "o" (owner only has read/write access, "r" global read access, or "w" global read/write access.

Returns:
Type of access.

getPreferredSize

public Dimension getPreferredSize()
Determines the preferred size of the bean. This is also the initial and minimum size.

Overrides:
getPreferredSize in class Container
Returns:
Preferred size of the bean.

getMinimumSize

public Dimension getMinimumSize()
Determines the minimum size of the bean.

Overrides:
getMinimumSize in class Container
Returns:
Minimum size of the bean.

paint

public void paint(Graphics g)
Draws a visual representation of the bean.

Overrides:
paint in class Container
Parameters:
g - Graphics context.