public class CockpitLite extends javax.swing.JApplet implements S3ServiceEventListener, java.awt.event.ActionListener, javax.swing.event.ListSelectionListener, HyperlinkActivatedListener, org.apache.http.client.CredentialsProvider
This is the CockpitLite application class; it may be run as a stand-alone application or as an Applet.
javax.swing.JApplet.AccessibleJAppletjava.applet.Applet.AccessibleApplet| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPLICATION_DESCRIPTION |
static java.lang.String |
APPLICATION_TITLE |
static int |
HTTP_CONNECTION_TIMEOUT |
static int |
MAX_CONNECTION_RETRIES |
static int |
SOCKET_CONNECTION_TIMEOUT |
accessibleContext, rootPane, rootPaneCheckingEnabled| Constructor and Description |
|---|
CockpitLite()
Constructor to run this application as an Applet.
|
CockpitLite(javax.swing.JFrame ownerFrame,
java.util.Properties standAloneArgumentProperties)
Constructor to run this application in a stand-alone window.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Event handler for this application, handles all menu items.
|
void |
clear()
Clear credentials.
|
void |
followHyperlink(java.net.URL url,
java.lang.String target)
Follows hyperlinks clicked on by a user.
|
static java.lang.String |
getAclDescription(AccessControlList acl) |
org.apache.http.auth.Credentials |
getCredentials(org.apache.http.auth.AuthScope scope)
Implementation method for the CredentialsProvider interface.
|
void |
init()
Prepares application to run as a GUI by finding/creating a root owner JFrame, creating an
un-authenticated
RestS3Service and loading properties files. |
static void |
main(java.lang.String[] args)
Runs Cockpit as a stand-alone application.
|
void |
s3ServiceEventPerformed(CopyObjectsEvent event) |
void |
s3ServiceEventPerformed(CreateBucketsEvent event) |
void |
s3ServiceEventPerformed(CreateObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateObjectsEvent. |
void |
s3ServiceEventPerformed(DeleteObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DeleteObjectsEvent. |
void |
s3ServiceEventPerformed(DeleteVersionedObjectsEvent event) |
void |
s3ServiceEventPerformed(DownloadObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DownloadObjectsEvent. |
void |
s3ServiceEventPerformed(GetObjectHeadsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectHeadsEvent. |
void |
s3ServiceEventPerformed(GetObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectsEvent. |
void |
s3ServiceEventPerformed(ListObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a ListObjectsEvent. |
void |
s3ServiceEventPerformed(LookupACLEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a LookupACLEvent. |
void |
s3ServiceEventPerformed(UpdateACLEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a UpdateACLEvent. |
void |
setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.Credentials credentials) |
protected void |
startProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int maxCount,
CancelEventTrigger cancelEventTrigger) |
protected void |
stopProgressPanel(java.lang.Object operationId) |
protected void |
updateProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int currentCount) |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Handles list selection events for this application.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updatedestroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stopadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final java.lang.String APPLICATION_DESCRIPTION
public static final java.lang.String APPLICATION_TITLE
public static final int HTTP_CONNECTION_TIMEOUT
public static final int SOCKET_CONNECTION_TIMEOUT
public static final int MAX_CONNECTION_RETRIES
public CockpitLite()
public CockpitLite(javax.swing.JFrame ownerFrame,
java.util.Properties standAloneArgumentProperties)
throws S3ServiceException
ownerFrame - the frame the application will be displayed inS3ServiceExceptionpublic void init()
RestS3Service and loading properties files.init in class java.applet.Appletprotected void startProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int maxCount,
CancelEventTrigger cancelEventTrigger)
protected void updateProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int currentCount)
protected void stopProgressPanel(java.lang.Object operationId)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenerpublic void s3ServiceEventPerformed(GetObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectsEvent.
This never happens in this application as downloads are performed by
S3ServiceMulti.downloadObjects(S3Bucket, DownloadPackage[]) instead.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(ListObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a ListObjectsEvent.
This never happens in this application as it does not perform multi-threaded object listings.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(DeleteVersionedObjectsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerpublic void s3ServiceEventPerformed(LookupACLEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a LookupACLEvent.s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(UpdateACLEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a UpdateACLEvent.
This method merely updates the progress dialog as ACLs are updated.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(DownloadObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DownloadObjectsEvent.
This method merely updates the progress dialog as objects are downloaded.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(CreateObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateObjectsEvent.
This method merely updates the progress dialog as files are uploaded.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(DeleteObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DeleteObjectsEvent.
This method merely updates the progress dialog as objects are deleted.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(GetObjectHeadsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectHeadsEvent.
This method merely updates the progress dialog as object details (heads) are retrieved.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void followHyperlink(java.net.URL url,
java.lang.String target)
followHyperlink in interface HyperlinkActivatedListenerurl - the url to opentarget - the target pane to open the url in, eg "_blank". This may be null.public void setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.Credentials credentials)
setCredentials in interface org.apache.http.client.CredentialsProviderpublic void clear()
clear in interface org.apache.http.client.CredentialsProviderpublic org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope scope)
Based on sample code: InteractiveAuthenticationExample
getCredentials in interface org.apache.http.client.CredentialsProviderpublic void s3ServiceEventPerformed(CreateBucketsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerpublic void s3ServiceEventPerformed(CopyObjectsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerpublic static java.lang.String getAclDescription(AccessControlList acl)
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - java.lang.Exception