Package org.apache.directory.studio.apacheds.model

Examples of org.apache.directory.studio.apacheds.model.Server


        {
            // What we get from the TableViewer is a StructuredSelection
            StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();

            // Here's the real object
            Server server = ( Server ) selection.getFirstElement();

            // Asking for confirmation
            DeleteServerDialog dsd = new DeleteServerDialog( view.getSite().getShell(), server );
            if ( dsd.open() == DeleteServerDialog.OK )
            {
                // Checking if the server is running
                // If yes, we need to shut it down before removing its data
                if ( server.getState() == ServerStateEnum.STARTED )
                {
                    // Setting the server of the server to 'stopping'
                    server.setState( ServerStateEnum.STOPPING );

                    // Getting the launch job
                    LaunchServerJob launchJob = server.getLaunchJob();
                    if ( launchJob != null )
                    {
                        // Getting the launch
                        ILaunch launch = launchJob.getLaunch();
                        if ( ( launch != null ) && ( !launch.isTerminated() ) )
                        {
                            // Terminating the launch
                            try
                            {
                                launch.terminate();
                            }
                            catch ( DebugException e )
                            {
                                ApacheDsPluginUtils.reportError( "An error occurred when stopping the server.\n\n"
                                    + e.getMessage() );
                            }
                        }
                    }
                }

                // Removing the server
                ServersHandler.getDefault().removeServer( server );

                // Deleting the associated directory on disk
                deleteDirectory( new File( ApacheDsPluginUtils.getApacheDsServersFolder().append( server.getId() )
                    .toOSString() ) );
            }
        }
    }
View Full Code Here


        {
            return consolesMap.get( serverId );
        }
        else
        {
            Server server = ServersHandler.getDefault().getServerById( serverId );

            LogMessageConsole logMessageConsole = new LogMessageConsole( "Apache DS - " + server.getName() );

            consolesMap.put( serverId, logMessageConsole );

            ConsolePlugin.getDefault().getConsoleManager().addConsoles( new IConsole[]
                { logMessageConsole } );
View Full Code Here

        if ( view != null )
        {
            StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
            if ( !selection.isEmpty() )
            {
                Server server = ( Server ) selection.getFirstElement();
                PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( view.getViewSite().getShell(),
                    server, ApacheDsPluginConstants.PROP_SERVER_PROPERTY_PAGE, null, null );
                dialog.getShell().setText( "Properties for '" + shorten( server.getName(), 30 ) + "'" );
                dialog.open();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.apacheds.model.Server

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.