directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r981870 - in /directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model: LdapServerAdapter.java UnknownLdapServerAdapterExtension.java
Date Tue, 03 Aug 2010 13:40:40 GMT
Author: pamarcelot
Date: Tue Aug  3 13:40:40 2010
New Revision: 981870

URL: http://svn.apache.org/viewvc?rev=981870&view=rev
Log:
Added a basic implementation of a server adapter for the 'UnknownLdapServerAdapterExtension'.
Organized imports.

Modified:
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/UnknownLdapServerAdapterExtension.java

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java?rev=981870&r1=981869&r2=981870&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
(original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
Tue Aug  3 13:40:40 2010
@@ -22,7 +22,6 @@ package org.apache.directory.studio.ldap
 
 
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
-import org.eclipse.core.runtime.IProgressMonitor;
 
 
 /**

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/UnknownLdapServerAdapterExtension.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/UnknownLdapServerAdapterExtension.java?rev=981870&r1=981869&r2=981870&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/UnknownLdapServerAdapterExtension.java
(original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/UnknownLdapServerAdapterExtension.java
Tue Aug  3 13:40:40 2010
@@ -21,6 +21,10 @@
 package org.apache.directory.studio.ldapservers.model;
 
 
+import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.eclipse.osgi.util.NLS;
+
+
 /**
  * The {@link UnknownLdapServerAdapterExtension} class represents an extension to the 
  * LDAP Server Adapters extension point that can not be found while parsing the server instances
file.
@@ -29,4 +33,48 @@ package org.apache.directory.studio.ldap
  */
 public class UnknownLdapServerAdapterExtension extends LdapServerAdapterExtension
 {
+    public UnknownLdapServerAdapterExtension()
+    {
+        // Setting behavior for this particular LDAP Server Adapter Extension
+        setInstance( new LdapServerAdapter()
+        {
+            /**
+            * {@inheritDoc}
+            */
+            public void stop( LdapServer server, StudioProgressMonitor monitor ) throws Exception
+            {
+                // Will never occur
+            }
+
+
+            /**
+             * {@inheritDoc}
+             */
+            public void start( LdapServer server, StudioProgressMonitor monitor ) throws
Exception
+            {
+                throw new Exception(
+                    NLS.bind(
+                        "This server was created with a server adapter which is no longer
available. You need install it (again) using the update site of the vendor. \nServer adapter
information: ID=''{0}'', Name=''{1}'', Vendor=''{2}'', Version=''{3}''",
+                        new String[]
+                            { getId(), getName(), getVendor(), getVersion() } ) );
+            }
+
+
+            /**
+             * {@inheritDoc}
+             */
+            public void delete( LdapServer server ) throws Exception
+            {
+            }
+
+
+            /**
+             * {@inheritDoc}
+             */
+            public void add( LdapServer server, StudioProgressMonitor monitor ) throws Exception
+            {
+                // Will never occur
+            }
+        } );
+    }
 }



Mime
View raw message