You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2006/09/03 21:03:15 UTC

svn commit: r439831 - /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java

Author: elecharny
Date: Sun Sep  3 12:03:14 2006
New Revision: 439831

URL: http://svn.apache.org/viewvc?view=rev&rev=439831
Log:
Added the abstract class for ResultResponse 

Added:
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java

Added: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java?view=auto&rev=439831
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java (added)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/messages/AbstractResultResponse.java Sun Sep  3 12:03:14 2006
@@ -0,0 +1,74 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.directory.shared.ldap.messages;
+
+/**
+ * Abstract base for a ResultResponse message.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class AbstractResultResponse extends AbstractResponse implements ResultResponse
+{
+    /** Response result components */
+    private LdapResult result = new LdapResult();
+
+    /**
+     * Allows subclasses based on the abstract type to create a response to a
+     * request.
+     * 
+     * @param messageId the response eliciting this Request
+     * @param type
+     *            the message type of the response
+     */
+    protected AbstractResultResponse( int messageId )
+    {
+        super( messageId );
+    }
+
+    /**
+     * Gets the LdapResult components of this Response.
+     * 
+     * @return the LdapResult for this Response.
+     */
+    public LdapResult getLdapResult()
+    {
+        return result;
+    }
+
+    /**
+     * Sets the result code components of this Response.
+     * 
+     * @param the result code for this Response.
+     */
+    public void setResultCode( ResultCode resultCode )
+    {
+        result.setResultCode( resultCode );
+    }
+
+    /**
+     * Get a String representation of an Response
+     * 
+     * @return An Response String
+     */
+    public String toString()
+    {
+        return (result == null ? "No result" : result.toString() );
+    }
+}