Class Cockpit

    • Constructor Detail

      • Cockpit

        public Cockpit()
        Constructor to run this application as an Applet.
      • Cockpit

        public Cockpit​(JFrame ownerFrame)
                throws S3ServiceException
        Constructor to run this application in a stand-alone window.
        Parameters:
        ownerFrame - the frame the application will be displayed in
        Throws:
        S3ServiceException
    • Method Detail

      • init

        public 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.
        Overrides:
        init in class Applet
      • s3ServiceEventPerformed

        public void s3ServiceEventPerformed​(ListObjectsEvent event)
        This method is an 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.

        Specified by:
        s3ServiceEventPerformed in interface S3ServiceEventListener
        Parameters:
        event -
      • s3ServiceEventPerformed

        public void s3ServiceEventPerformed​(LookupACLEvent event)
        This method is an S3ServiceEventListener action method that is invoked when this application's S3ServiceMulti triggers a LookupACLEvent.

        The ACL details are retrieved for the currently selected objects in the gui, then the AccessControlDialog is displayed to allow the user to update the ACL settings for these objects.

        Specified by:
        s3ServiceEventPerformed in interface 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:
        followHyperlink in interface HyperlinkActivatedListener
        Parameters:
        url - the url to open
        target - the target pane to open the url in, eg "_blank". This may be null.
      • getCredentials

        public org.apache.commons.httpclient.Credentials getCredentials​(org.apache.commons.httpclient.auth.AuthScheme authscheme,
                                                                        String host,
                                                                        int port,
                                                                        boolean proxy)
                                                                 throws org.apache.commons.httpclient.auth.CredentialsNotAvailableException
        Implementation method for the CredentialsProvider interface.

        Based on sample code: InteractiveAuthenticationExample

        Specified by:
        getCredentials in interface org.apache.commons.httpclient.auth.CredentialsProvider
        Throws:
        org.apache.commons.httpclient.auth.CredentialsNotAvailableException
      • main

        public static void main​(String[] args)
                         throws Exception
        Runs Cockpit as a stand-alone application.
        Parameters:
        args -
        Throws:
        Exception