Search in sources :

Example 6 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "ftp";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new FTPProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 21, "/", AuthenticationType.AUTHENTICATION_REQUIRED, new Credentials("anonymous", "anonymous_coward@mucommander.com"));
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "ftp";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new FTPPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 5000;
        }

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return FTPPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) Credentials(com.mucommander.commons.file.Credentials) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 7 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    LOGGER.debug("starting");
    this.context = context;
    // Register the application-specific 'bookmark' protocol.
    FileProtocolService bookmarksService = createBookmarkProtocolService();
    bookmarksRegistration = context.registerService(FileProtocolService.class, bookmarksService, null);
    // Listen to protocol panel services
    protocolPanelTracker = new ProtocolPanelProviderTracker(context);
    protocolPanelTracker.open();
    // Listen to translation service
    translationTracker = new TranslationTracker(context);
    translationTracker.open();
    // Listen to file viewer services
    viewersTracker = new FileViewerServiceTracker(context);
    viewersTracker.open();
    // Listen to file editor services
    editorsTracker = new FileEditorServiceTracker(context);
    editorsTracker.open();
    // Listen to operating system services
    osTracker = new OperatingSystemServiceTracker(context);
    osTracker.open();
    // Register core functionality service
    CoreService coreService = createCoreService();
    coreRegistration = context.registerService(CoreService.class, coreService, null);
    // Traps VM shutdown
    Runtime.getRuntime().addShutdownHook(shutdownHook = new ShutdownHook());
    Application.run(this);
}
Also used : ProtocolPanelProviderTracker(com.mucommander.ui.main.osgi.ProtocolPanelProviderTracker) FileEditorServiceTracker(com.mucommander.osgi.FileEditorServiceTracker) FileViewerServiceTracker(com.mucommander.osgi.FileViewerServiceTracker) TranslationTracker(com.mucommander.text.TranslationTracker) CoreService(com.mucommander.os.api.CoreService) OperatingSystemServiceTracker(com.mucommander.osgi.OperatingSystemServiceTracker) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService)

Example 8 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService serviceDocker = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "docker";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new RegistryProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 80, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    FileProtocolService serviceOCI = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "oci";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new RegistryProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 80, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    FileProtocolService serviceDir = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "dir";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new RegistryProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 80, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    FileProtocolService serviceRegistry = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "registry";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new RegistryProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 80, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            // TODO: better naming to reflect this refers to container images registry
            return "registry";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            boolean isSkopeoAvailable = SkopeoCommandExecutor.checkSkopeo();
            return new RegistryPanel(listener, mainFrame, isSkopeoAvailable);
        }

        @Override
        public int priority() {
            return 8000;
        }
    };
    serviceRegistrationDocker = context.registerService(FileProtocolService.class, serviceDocker, null);
    serviceRegistrationOCI = context.registerService(FileProtocolService.class, serviceOCI, null);
    serviceRegistrationDir = context.registerService(FileProtocolService.class, serviceDir, null);
    serviceRegistrationRegistry = context.registerService(FileProtocolService.class, serviceRegistry, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 9 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "s3";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new S3ProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(true), 443, "/", AuthenticationType.AUTHENTICATION_REQUIRED, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "s3";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new S3Panel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 3000;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Example 10 with FileProtocolService

use of com.mucommander.commons.file.osgi.FileProtocolService in project mucommander by mucommander.

the class Activator method start.

@Override
public void start(BundleContext context) throws Exception {
    FileProtocolService service = new FileProtocolService() {

        @Override
        public String getSchema() {
            return "nfs";
        }

        @Override
        public ProtocolProvider getProtocolProvider() {
            return new NFSProtocolProvider();
        }

        @Override
        public SchemeHandler getSchemeHandler() {
            return new DefaultSchemeHandler(new DefaultSchemeParser(), 2049, "/", AuthenticationType.NO_AUTHENTICATION, null);
        }
    };
    ProtocolPanelProvider panelProvider = new ProtocolPanelProvider() {

        @Override
        public String getSchema() {
            return "nfs";
        }

        @Override
        public ServerPanel get(ServerPanelListener listener, JFrame mainFrame) {
            return new NFSPanel(listener, mainFrame);
        }

        @Override
        public int priority() {
            return 2000;
        }

        @Override
        public Class<? extends ServerPanel> getPanelClass() {
            return NFSPanel.class;
        }
    };
    serviceRegistration = context.registerService(FileProtocolService.class, service, null);
    uiServiceRegistration = context.registerService(ProtocolPanelProvider.class, panelProvider, null);
}
Also used : ServerPanelListener(com.mucommander.protocol.ui.ServerPanelListener) DefaultSchemeParser(com.mucommander.commons.file.DefaultSchemeParser) JFrame(javax.swing.JFrame) ProtocolPanelProvider(com.mucommander.protocol.ui.ProtocolPanelProvider) FileProtocolService(com.mucommander.commons.file.osgi.FileProtocolService) DefaultSchemeHandler(com.mucommander.commons.file.DefaultSchemeHandler)

Aggregations

FileProtocolService (com.mucommander.commons.file.osgi.FileProtocolService)13 DefaultSchemeHandler (com.mucommander.commons.file.DefaultSchemeHandler)12 DefaultSchemeParser (com.mucommander.commons.file.DefaultSchemeParser)12 ProtocolPanelProvider (com.mucommander.protocol.ui.ProtocolPanelProvider)12 ServerPanelListener (com.mucommander.protocol.ui.ServerPanelListener)12 JFrame (javax.swing.JFrame)12 Credentials (com.mucommander.commons.file.Credentials)4 FileURL (com.mucommander.commons.file.FileURL)1 CoreService (com.mucommander.os.api.CoreService)1 FileEditorServiceTracker (com.mucommander.osgi.FileEditorServiceTracker)1 FileViewerServiceTracker (com.mucommander.osgi.FileViewerServiceTracker)1 OperatingSystemServiceTracker (com.mucommander.osgi.OperatingSystemServiceTracker)1 TranslationTracker (com.mucommander.text.TranslationTracker)1 ProtocolPanelProviderTracker (com.mucommander.ui.main.osgi.ProtocolPanelProviderTracker)1