Class CockpitLite
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Panel
-
- java.applet.Applet
-
- javax.swing.JApplet
-
- org.jets3t.apps.cockpitlite.CockpitLite
-
- All Implemented Interfaces:
ActionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,ListSelectionListener,RootPaneContainer,org.apache.http.client.CredentialsProvider,org.jets3t.gui.HyperlinkActivatedListener,org.jets3t.service.multithread.S3ServiceEventListener
public class CockpitLite extends JApplet implements org.jets3t.service.multithread.S3ServiceEventListener, ActionListener, ListSelectionListener, org.jets3t.gui.HyperlinkActivatedListener, org.apache.http.client.CredentialsProvider
CockpitLite is a graphical Java application for viewing and managing the contents of an Amazon S3 account, where the S3 account is not owned by the application's user directly but is made available by a service provider. The service provider uses the Gatekeeper application to mediate the user's access to the S3 account, authorizing each of the user's interactions before it can be executed.This is the CockpitLite application class; it may be run as a stand-alone application or as an Applet.
- Author:
- jmurty
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JApplet
JApplet.AccessibleJApplet
-
Nested classes/interfaces inherited from class java.applet.Applet
Applet.AccessibleApplet
-
Nested classes/interfaces inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
-
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
Fields Modifier and Type Field Description static StringAPPLICATION_DESCRIPTIONstatic StringAPPLICATION_TITLEstatic intHTTP_CONNECTION_TIMEOUTstatic intMAX_CONNECTION_RETRIESstatic intSOCKET_CONNECTION_TIMEOUT-
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
-
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
Constructors Constructor Description CockpitLite()Constructor to run this application as an Applet.CockpitLite(JFrame ownerFrame, Properties standAloneArgumentProperties)Constructor to run this application in a stand-alone window.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent event)Event handler for this application, handles all menu items.voidclear()Clear credentials.voidfollowHyperlink(URL url, String target)Follows hyperlinks clicked on by a user.static StringgetAclDescription(org.jets3t.service.acl.AccessControlList acl)org.apache.http.auth.CredentialsgetCredentials(org.apache.http.auth.AuthScope scope)Implementation method for the CredentialsProvider interface.voidinit()Prepares application to run as a GUI by finding/creating a root owner JFrame, creating an un-authenticatedRestS3Serviceand loading properties files.static voidmain(String[] args)Runs Cockpit as a stand-alone application.voids3ServiceEventPerformed(org.jets3t.service.multithread.CopyObjectsEvent event)voids3ServiceEventPerformed(org.jets3t.service.multithread.CreateBucketsEvent event)voids3ServiceEventPerformed(org.jets3t.service.multithread.CreateObjectsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aCreateObjectsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.DeleteObjectsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aDeleteObjectsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.DeleteVersionedObjectsEvent event)voids3ServiceEventPerformed(org.jets3t.service.multithread.DownloadObjectsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aDownloadObjectsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.GetObjectHeadsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aGetObjectHeadsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.GetObjectsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aGetObjectsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.ListObjectsEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aListObjectsEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.LookupACLEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aLookupACLEvent.voids3ServiceEventPerformed(org.jets3t.service.multithread.UpdateACLEvent event)This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aUpdateACLEvent.voidsetCredentials(org.apache.http.auth.AuthScope authscope, org.apache.http.auth.Credentials credentials)protected voidstartProgressPanel(Object operationId, String statusMessage, int maxCount, org.jets3t.service.multithread.CancelEventTrigger cancelEventTrigger)protected voidstopProgressPanel(Object operationId)protected voidupdateProgressPanel(Object operationId, String statusMessage, int currentCount)voidvalueChanged(ListSelectionEvent e)Handles list selection events for this application.-
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
-
Methods inherited from class java.awt.Container
add, 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, 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, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, 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, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
APPLICATION_DESCRIPTION
public static final String APPLICATION_DESCRIPTION
- See Also:
- Constant Field Values
-
APPLICATION_TITLE
public static final String APPLICATION_TITLE
- See Also:
- Constant Field Values
-
HTTP_CONNECTION_TIMEOUT
public static final int HTTP_CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
-
SOCKET_CONNECTION_TIMEOUT
public static final int SOCKET_CONNECTION_TIMEOUT
- See Also:
- Constant Field Values
-
MAX_CONNECTION_RETRIES
public static final int MAX_CONNECTION_RETRIES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CockpitLite
public CockpitLite()
Constructor to run this application as an Applet.
-
CockpitLite
public CockpitLite(JFrame ownerFrame, Properties standAloneArgumentProperties) throws org.jets3t.service.S3ServiceException
Constructor to run this application in a stand-alone window.- Parameters:
ownerFrame- the frame the application will be displayed in- Throws:
org.jets3t.service.S3ServiceException
-
-
Method Detail
-
init
public void init()
Prepares application to run as a GUI by finding/creating a root owner JFrame, creating an un-authenticatedRestS3Serviceand loading properties files.
-
startProgressPanel
protected void startProgressPanel(Object operationId, String statusMessage, int maxCount, org.jets3t.service.multithread.CancelEventTrigger cancelEventTrigger)
-
updateProgressPanel
protected void updateProgressPanel(Object operationId, String statusMessage, int currentCount)
-
stopProgressPanel
protected void stopProgressPanel(Object operationId)
-
actionPerformed
public void actionPerformed(ActionEvent event)
Event handler for this application, handles all menu items.- Specified by:
actionPerformedin interfaceActionListener
-
valueChanged
public void valueChanged(ListSelectionEvent e)
Handles list selection events for this application.- Specified by:
valueChangedin interfaceListSelectionListener
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.GetObjectsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aGetObjectsEvent.This never happens in this application as downloads are performed by
S3ServiceMulti.downloadObjects(S3Bucket, DownloadPackage[])instead.- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.ListObjectsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aListObjectsEvent.This never happens in this application as it does not perform multi-threaded object listings.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.DeleteVersionedObjectsEvent event)
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.LookupACLEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aLookupACLEvent.- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.UpdateACLEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aUpdateACLEvent.This method merely updates the progress dialog as ACLs are updated.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.DownloadObjectsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aDownloadObjectsEvent.This method merely updates the progress dialog as objects are downloaded.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.CreateObjectsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aCreateObjectsEvent.This method merely updates the progress dialog as files are uploaded.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.DeleteObjectsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aDeleteObjectsEvent.This method merely updates the progress dialog as objects are deleted.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.GetObjectHeadsEvent event)
This method is anS3ServiceEventListeneraction method that is invoked when this application'sS3ServiceMultitriggers aGetObjectHeadsEvent.This method merely updates the progress dialog as object details (heads) are retrieved.
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener- Parameters:
event-
-
followHyperlink
public void followHyperlink(URL url, String target)
Follows hyperlinks clicked on by a user. This is achieved differently depending on whether Cockpit is running as an applet or as a stand-alone application:- Application: Detects the default browser application for the user's system (using BareBonesBrowserLaunch) and opens the link as a new window in that browser
- Applet: Opens the link in the current browser using the applet's context
- Specified by:
followHyperlinkin interfaceorg.jets3t.gui.HyperlinkActivatedListener- Parameters:
url- the url to opentarget- the target pane to open the url in, eg "_blank". This may be null.
-
setCredentials
public void setCredentials(org.apache.http.auth.AuthScope authscope, org.apache.http.auth.Credentials credentials)- Specified by:
setCredentialsin interfaceorg.apache.http.client.CredentialsProvider
-
clear
public void clear()
Clear credentials.- Specified by:
clearin interfaceorg.apache.http.client.CredentialsProvider
-
getCredentials
public org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope scope)
Implementation method for the CredentialsProvider interface.Based on sample code: InteractiveAuthenticationExample
- Specified by:
getCredentialsin interfaceorg.apache.http.client.CredentialsProvider
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.CreateBucketsEvent event)
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener
-
s3ServiceEventPerformed
public void s3ServiceEventPerformed(org.jets3t.service.multithread.CopyObjectsEvent event)
- Specified by:
s3ServiceEventPerformedin interfaceorg.jets3t.service.multithread.S3ServiceEventListener
-
getAclDescription
public static String getAclDescription(org.jets3t.service.acl.AccessControlList acl)
-
-