directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r370071 - in /directory/trunks: apacheds/core/src/main/java/org/apache/ldap/server/partition/ apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/ apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/ext...
Date Wed, 18 Jan 2006 06:50:52 GMT
Author: akarasulu
Date: Tue Jan 17 22:50:32 2006
New Revision: 370071

URL: http://svn.apache.org/viewcvs?rev=370071&view=rev
Log:
enabled diagnostic UI again however it only works with the system partition

Added:
    directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java
  (with props)
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiRequest.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiResponse.java
Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexus.java
    directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
    directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
    directory/trunks/apacheds/protocols/ldap/src/test/java/org/apache/ldap/server/protocol/LdapProtocolProviderTest.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
    directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/NoticeOfDisconnect.java
    directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
    directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DefaultDirectoryPartitionNexus.java
Tue Jan 17 22:50:32 2006
@@ -775,4 +775,10 @@
         }
         throw new NameNotFoundException( dn.toString() );
     }
+
+
+    public DirectoryPartition getPartition( Name dn ) throws NamingException
+    {
+        return getBackend( dn );
+    }
 }

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexus.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexus.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexus.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexus.java
Tue Jan 17 22:50:32 2006
@@ -51,7 +51,7 @@
     public final static String GROUPS_BASE_NAME = "ou=groups,ou=system";
 
     /**
-     * System backend suffix constant.  Should be kept down to a single Dn name 
+     * System partition suffix constant.  Should be kept down to a single Dn name 
      * component or the default constructor will have to parse it instead of 
      * building the name.  Note that what ever the SUFFIX equals it should be 
      * both the normalized and the user provided form.
@@ -152,6 +152,18 @@
     public abstract void removeContextPartition( Name suffix ) throws NamingException;
 
     public abstract DirectoryPartition getSystemPartition();
+    
+    /**
+     * Get's the partition corresponding to a distinguished name.  This 
+     * name need not be the name of the partition suffix.  When used in 
+     * conjunction with get suffix this can properly find the partition 
+     * associated with the DN.  Make sure to use the normalized DN.
+     * 
+     * @param dn the normalized distinguished name to get a partition for
+     * @return the partition containing the entry represented by the dn
+     * @throws NamingException if there is no partition for the dn
+     */
+    public abstract DirectoryPartition getPartition( Name dn ) throws NamingException;
 
     /**
      * Gets the most significant Dn that exists within the server for any Dn.
@@ -183,7 +195,7 @@
     public abstract Name getSuffix( Name name, boolean normalized ) throws NamingException;
 
     /**
-     * Gets an iteration over the Name suffixes of the Backends managed by this
+     * Gets an iteration over the Name suffixes of the partitions managed by this
      * {@link DirectoryPartitionNexus}.
      *
      * @param normalized if true the returned Iterator contains normalized Dn

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
Tue Jan 17 22:50:32 2006
@@ -144,6 +144,12 @@
     }
 
     
+    public DirectoryPartition getPartition( Name dn ) throws NamingException
+    {
+        return this.configuration.getPartitionNexus().getPartition( dn );
+    }
+
+    
     public Name getSuffix( boolean normalized ) throws NamingException
     {
         return this.configuration.getPartitionNexus().getSuffix( normalized );

Added: directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java?rev=370071&view=auto
==============================================================================
--- directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java
(added)
+++ directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java
Tue Jan 17 22:50:32 2006
@@ -0,0 +1,60 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.server.dumptool;
+
+
+import java.util.Hashtable;
+import javax.naming.NamingException;
+import javax.naming.ldap.InitialLdapContext;
+import javax.naming.ldap.LdapContext;
+
+import org.apache.ldap.common.message.extended.LaunchDiagnosticUiRequest;
+
+
+/**
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LaunchDiagnosticUi
+{
+    private int port = 10389;
+    private String host = "localhost";
+    private String password = "secret";
+
+    
+    public void execute() throws NamingException
+    {
+        Hashtable env = new Hashtable();
+        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+        env.put( "java.naming.provider.url", "ldap://" + host + ":" + port );
+        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+        env.put( "java.naming.security.credentials", password );
+        env.put( "java.naming.security.authentication", "simple" );
+
+        LdapContext ctx = new InitialLdapContext( env, null );
+        ctx.extendedOperation( new LaunchDiagnosticUiRequest( 3 ) );
+        ctx.close();
+    }
+
+
+    public static void main( String[] args ) throws Exception
+    {
+        LaunchDiagnosticUi command = new LaunchDiagnosticUi();
+        command.execute();
+    }
+}

Propchange: directory/trunks/apacheds/dumptool/src/main/java/org/apache/ldap/server/dumptool/LaunchDiagnosticUi.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
(original)
+++ directory/trunks/apacheds/protocols/ldap/src/main/java/org/apache/ldap/server/protocol/support/extended/LaunchDiagnosticUiHandler.java
Tue Jan 17 22:50:32 2006
@@ -27,6 +27,8 @@
 import org.apache.ldap.server.DirectoryService;
 import org.apache.ldap.server.jndi.ServerLdapContext;
 import org.apache.ldap.server.partition.DirectoryPartitionNexus;
+import org.apache.ldap.server.partition.impl.btree.BTreeDirectoryPartition;
+import org.apache.ldap.server.partition.impl.btree.gui.MainFrame;
 import org.apache.ldap.server.protocol.ExtendedOperationHandler;
 import org.apache.ldap.server.protocol.SessionRegistry;
 import org.apache.mina.common.IoSession;
@@ -43,6 +45,8 @@
     public void handleExtendedOperation( IoSession session, SessionRegistry registry, ExtendedRequest
req ) throws NamingException 
     {
         LdapContext ctx = registry.getLdapContext( session, null, false );
+        ctx = ( LdapContext ) ctx.lookup( "" );
+        
         if ( ctx instanceof ServerLdapContext )
         {
             ServerLdapContext slc = ( ServerLdapContext ) ctx;
@@ -57,6 +61,10 @@
             session.write( new LaunchDiagnosticUiResponse( req.getMessageId() ) );
             
             // Launch UI here using the provider, session registry and directory service
+            BTreeDirectoryPartition partition = ( BTreeDirectoryPartition ) service.getConfiguration().getPartitionNexus().getSystemPartition();
+            MainFrame frame = new MainFrame( partition, partition.getSearchEngine() );
+            frame.setVisible( true );
+            return;
         }
 
         session.write( new LaunchDiagnosticUiResponse( req.getMessageId(), ResultCodeEnum.OPERATIONSERROR
) );

Modified: directory/trunks/apacheds/protocols/ldap/src/test/java/org/apache/ldap/server/protocol/LdapProtocolProviderTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/protocols/ldap/src/test/java/org/apache/ldap/server/protocol/LdapProtocolProviderTest.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/apacheds/protocols/ldap/src/test/java/org/apache/ldap/server/protocol/LdapProtocolProviderTest.java
(original)
+++ directory/trunks/apacheds/protocols/ldap/src/test/java/org/apache/ldap/server/protocol/LdapProtocolProviderTest.java
Tue Jan 17 22:50:32 2006
@@ -43,6 +43,7 @@
 import org.apache.ldap.common.message.SearchRequestImpl;
 import org.apache.ldap.common.message.UnbindRequest;
 import org.apache.ldap.common.message.UnbindRequestImpl;
+import org.apache.ldap.server.protocol.support.ExtendedHandler;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
 
@@ -96,8 +97,8 @@
         props.setProperty( DeleteRequest.class.getName(), BogusDeleteHandler.class.getName()
);
         props.setProperty( DeleteRequestImpl.class.getName(), BogusDeleteHandler.class.getName()
);
 
-        props.setProperty( ExtendedRequest.class.getName(), BogusExtendedHandler.class.getName()
);
-        props.setProperty( ExtendedRequestImpl.class.getName(), BogusExtendedHandler.class.getName()
);
+        props.setProperty( ExtendedRequest.class.getName(), ExtendedHandler.class.getName()
);
+        props.setProperty( ExtendedRequestImpl.class.getName(), ExtendedHandler.class.getName()
);
 
         props.setProperty( ModifyRequest.class.getName(), BogusModifyHandler.class.getName()
);
         props.setProperty( ModifyRequestImpl.class.getName(), BogusModifyHandler.class.getName()
);
@@ -158,15 +159,6 @@
     }
 
     public static class BogusDeleteHandler implements MessageHandler
-    {
-        public void messageReceived( IoSession session, Object request )
-        {
-            throw new NotImplementedException( "handler not implemented!" );
-        }
-    }
-
-
-    public static class BogusExtendedHandler implements MessageHandler
     {
         public void messageReceived( IoSession session, Object request )
         {

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/codec/TwixTransformer.java
Tue Jan 17 22:50:32 2006
@@ -275,7 +275,7 @@
      */
     private Message transformExtendedRequest(LdapMessage twixMessage, int messageId)
     {
-    	ExtendedRequestImpl snickersMessage = new ExtendedRequestImpl( messageId ) ;
+    	ExtendedRequestImpl snickersMessage = new ExtendedRequestImpl( messageId );
     	ExtendedRequest extendedRequest = twixMessage.getExtendedRequest();
 
     	// Twix : OID requestName -> Snickers : String oid

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
Tue Jan 17 22:50:32 2006
@@ -47,7 +47,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface ExtendedRequest extends SingleReplyRequest
+public interface ExtendedRequest extends SingleReplyRequest, javax.naming.ldap.ExtendedRequest
 {
     /** Extended request message type enumeration value */
     MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDREQ;

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
Tue Jan 17 22:50:32 2006
@@ -17,6 +17,9 @@
 package org.apache.ldap.common.message;
 
 
+import javax.naming.NamingException;
+import javax.naming.ldap.ExtendedResponse;
+
 import org.apache.ldap.common.util.ArrayUtils;
 import org.apache.ldap.common.util.StringTools;
 
@@ -34,7 +37,7 @@
     private String oid;
     /** Extended request's payload or <b>requestValue</b> */
     private byte [] payload;
-    private ExtendedResponse response;
+    private ResultResponse response;
 
 
     // -----------------------------------------------------------------------
@@ -219,5 +222,23 @@
         }
 
         return sb.toString();
+    }
+
+
+    public String getID()
+    {
+        return getOid();
+    }
+
+
+    public byte[] getEncodedValue()
+    {
+        return getPayload();
+    }
+
+
+    public ExtendedResponse createExtendedResponse( String id, byte[] berValue, int offset,
int length ) throws NamingException
+    {
+        return null;
     }
 }

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
Tue Jan 17 22:50:32 2006
@@ -24,7 +24,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface ExtendedResponse extends ResultResponse
+public interface ExtendedResponse extends ResultResponse, javax.naming.ldap.ExtendedResponse
 {
     /** Extended response message type enumeration value */
     MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDRESP;

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/ExtendedResponseImpl.java
Tue Jan 17 22:50:32 2006
@@ -161,4 +161,16 @@
 
         return true;
     }
+
+
+    public String getID()
+    {
+        return getResponseName();
+    }
+
+
+    public byte[] getEncodedValue()
+    {
+        return getResponse();
+    }
 }

Added: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiRequest.java?rev=370071&view=auto
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiRequest.java
(added)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiRequest.java
Tue Jan 17 22:50:32 2006
@@ -0,0 +1,53 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.common.message.extended;
+
+
+import javax.naming.ldap.ExtendedResponse;
+
+import org.apache.ldap.common.message.ExtendedRequestImpl;
+
+
+/**
+ * An extended operation which launches an internal diagnostic UI.  Only the
+ * administrator is authorized to execute this request.  All other requestors
+ * will have a response with result code of insufficientAccessRights(50) sent.
+ * Any failures to launch the UI will return a operationsError(1) result code.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LaunchDiagnosticUiRequest extends ExtendedRequestImpl
+{
+    private static final long serialVersionUID = -7481749915684864433L;
+    public static final String OID = "1.2.6.1.4.1.18060.1.1.1.100.1";
+    private static final byte[] EMPTY_PAYLOAD = new byte[0];
+    
+    
+    public LaunchDiagnosticUiRequest( int messageId )
+    {
+        super( messageId );
+        setOid( OID );
+        setPayload( EMPTY_PAYLOAD );
+    }
+
+
+    public ExtendedResponse createExtendedResponse( String id, byte[] berValue, int offset,
int length )
+    {
+        return new LaunchDiagnosticUiResponse( getMessageId() );
+    }
+}

Added: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiResponse.java?rev=370071&view=auto
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiResponse.java
(added)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/LaunchDiagnosticUiResponse.java
Tue Jan 17 22:50:32 2006
@@ -0,0 +1,134 @@
+/*
+ *   Copyright 2006 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.common.message.extended;
+
+
+import org.apache.ldap.common.message.ExtendedResponseImpl;
+import org.apache.ldap.common.message.ResultCodeEnum;
+
+
+/**
+ * The response sent back from the server with a LaunchDiagnosticUiRequest 
+ * extended operation.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class LaunchDiagnosticUiResponse extends ExtendedResponseImpl
+{
+    private static final long serialVersionUID = -3824715470944544189L;
+    public static final String OID = "1.2.6.1.4.1.18060.1.1.1.100.2";
+    private static final byte[] EMPTY_RESPONSE = new byte[0];
+    
+    
+    public LaunchDiagnosticUiResponse( int messageId, ResultCodeEnum rcode )
+    {
+        super( messageId );
+        
+        switch ( rcode.getValue() )
+        {
+            case( ResultCodeEnum.SUCCESS_VAL ):
+                break;
+            case( ResultCodeEnum.OPERATIONSERROR_VAL ):
+                break;
+            case( ResultCodeEnum.INSUFFICIENTACCESSRIGHTS_VAL ):
+                break;
+            default:
+                throw new IllegalArgumentException( "The result code can only be one of:
" + 
+                    ResultCodeEnum.SUCCESS + ", " + 
+                    ResultCodeEnum.OPERATIONSERROR + ", " + 
+                    ResultCodeEnum.INSUFFICIENTACCESSRIGHTS );
+        }
+        super.getLdapResult().setMatchedDn( "" );
+        super.getLdapResult().setResultCode( rcode );
+    }
+    
+    
+    public LaunchDiagnosticUiResponse( int messageId )
+    {
+        super( messageId );
+        super.getLdapResult().setMatchedDn( "" );
+        super.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
+    }
+    
+    
+    // ------------------------------------------------------------------------
+    // ExtendedResponse Interface Method Implementations
+    // ------------------------------------------------------------------------
+
+
+    /**
+     * Gets the reponse OID specific encoded response values.
+     *
+     * @return the response specific encoded response values.
+     */
+    public byte [] getResponse()
+    {
+        return EMPTY_RESPONSE;
+    }
+
+
+    /**
+     * Sets the reponse OID specific encoded response values.
+     *
+     * @param value the response specific encoded response values.
+     */
+    public void setResponse( byte [] value )
+    {
+        throw new UnsupportedOperationException( "the response is hardcoded as zero length
array" );
+    }
+
+
+    /**
+     * Gets the OID uniquely identifying this extended response (a.k.a. its
+     * name).
+     *
+     * @return the OID of the extended response type.
+     */
+    public String getResponseName()
+    {
+        return OID;
+    }
+
+
+    /**
+     * Sets the OID uniquely identifying this extended response (a.k.a. its
+     * name).
+     *
+     * @param oid the OID of the extended response type.
+     */
+    public void setResponseName( String oid )
+    {
+        throw new UnsupportedOperationException( "the OID is fixed: " + OID );
+    }
+
+
+    public boolean equals( Object obj )
+    {
+        if ( obj == this )
+        {
+            return true;
+        }
+
+        if ( obj instanceof LaunchDiagnosticUiResponse )
+        {
+            return true;
+        }
+
+        return false;
+    }
+}

Modified: directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/NoticeOfDisconnect.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/NoticeOfDisconnect.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/NoticeOfDisconnect.java
(original)
+++ directory/trunks/common/ldap/src/main/java/org/apache/ldap/common/message/extended/NoticeOfDisconnect.java
Tue Jan 17 22:50:32 2006
@@ -98,6 +98,7 @@
  */
 public class NoticeOfDisconnect extends ExtendedResponseImpl
 {
+    private static final long serialVersionUID = -4682291068700593492L;
     public static final String OID = "1.3.6.1.4.1.1466.20036";
     private static final byte[] EMPTY_RESPONSE = new byte[0];
     

Modified: directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
(original)
+++ directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
Tue Jan 17 22:50:32 2006
@@ -22,6 +22,9 @@
 import java.util.Collections;
 import java.util.Map;
 
+import javax.naming.NamingException;
+import javax.naming.ldap.ExtendedResponse;
+
 
 /**
  * TestCase for the ExtendedRequestImpl class.
@@ -115,6 +118,8 @@
     {
         ExtendedRequest req0 = new ExtendedRequest()
         {
+            private static final long serialVersionUID = 1L;
+
             public String getOid()
             {
                 return null;
@@ -177,6 +182,21 @@
             }
 
             public ResultResponse getResultResponse()
+            {
+                return null;
+            }
+
+            public String getID()
+            {
+                return null;
+            }
+
+            public byte[] getEncodedValue()
+            {
+                return null;
+            }
+
+            public ExtendedResponse createExtendedResponse(String id, byte[] berValue, int
offset, int length) throws NamingException
             {
                 return null;
             }

Modified: directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java?rev=370071&r1=370070&r2=370071&view=diff
==============================================================================
--- directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
(original)
+++ directory/trunks/common/ldap/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
Tue Jan 17 22:50:32 2006
@@ -84,6 +84,8 @@
         ExtendedResponseImpl resp0 = createStub();
         ExtendedResponse resp1 = new ExtendedResponse()
         {
+            private static final long serialVersionUID = 5297000474419901408L;
+
             public String getResponseName()
             {
                 return "1.1.1.1";
@@ -147,6 +149,16 @@
             public Object put( Object a_key, Object a_value )
             {
                 return null;
+            }
+
+            public String getID()
+            {
+                return "1.1.1.1";
+            }
+
+            public byte[] getEncodedValue()
+            {
+                return getResponse();
             }
         };
 



Mime
View raw message