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 2005/04/03 20:10:24 UTC

svn commit: r159948 - directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java

Author: elecharny
Date: Sun Apr  3 11:10:23 2005
New Revision: 159948

URL: http://svn.apache.org/viewcvs?view=rev&rev=159948
Log:
Added the LdapResult element.

Added:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java

Added: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java?view=auto&rev=159948
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java (added)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResultPOJO.java Sun Apr  3 11:10:23 2005
@@ -0,0 +1,215 @@
+/*
+ *   Copyright 2005 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.asn1.ldap.pojo;
+
+import org.apache.asn1.util.MutableString;
+
+
+/**
+ * A POJO to store the LdapResult
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class LdapResultPOJO extends LdapMessagePOJO
+{
+    //~ Instance fields ----------------------------------------------------------------------------
+
+    /** The result code. The different values are :
+     *  success                      (0),
+     *  operationsError              (1),
+     *  protocolError                (2),
+     *  timeLimitExceeded            (3),
+     *  sizeLimitExceeded            (4),
+     *  compareFalse                 (5),
+     *  compareTrue                  (6),
+     *  authMethodNotSupported       (7),
+     *  strongAuthRequired           (8),
+     *  -- 9 reserved --
+     *  referral                     (10),  -- new
+     *  adminLimitExceeded           (11),  -- new
+     *  unavailableCriticalExtension (12),  -- new
+     *  confidentialityRequired      (13),  -- new
+     *  saslBindInProgress           (14),  -- new
+     *  noSuchAttribute              (16),
+     *  undefinedAttributeType       (17),
+     *  inappropriateMatching        (18),
+     *  constraintViolation          (19),
+     *  attributeOrValueExists       (20),
+     *  invalidAttributeSyntax       (21),
+     *  -- 22-31 unused --
+     *  noSuchObject                 (32),
+     *  aliasProblem                 (33),
+     *  invalidDNSyntax              (34),
+     *  -- 35 reserved for undefined isLeaf --
+     *  aliasDereferencingProblem    (36),
+     *  -- 37-47 unused --
+     *  inappropriateAuthentication  (48),
+     *  invalidCredentials           (49),
+     *  insufficientAccessRights     (50),
+     *  busy                         (51),
+     *  unavailable                  (52),
+     *  unwillingToPerform           (53),
+     *  loopDetect                   (54),
+     *  -- 55-63 unused --
+     *  namingViolation              (64),
+     *  objectClassViolation         (65),
+     *  notAllowedOnNonLeaf          (66),
+     *  notAllowedOnRDN              (67),
+     *  entryAlreadyExists           (68),
+     *  objectClassModsProhibited    (69),
+     *  -- 70 reserved for CLDAP --
+     *  affectsMultipleDSAs          (71), -- new
+     *  -- 72-79 unused --
+     *  other                        (80) },
+     *  -- 81-90 reserved for APIs --
+     */
+    private int resultCode;
+
+    /** The DN that is mathed by the Bind */
+    private MutableString matchedDN;
+
+    /** The Bind error message, if any */
+    private MutableString errorMessage;
+
+    /** The referrals, if any. This is an optional element */
+    private MutableString[] referral;
+
+    //~ Constructors -------------------------------------------------------------------------------
+
+    /**
+     * Creates a new BindResponsePOJO object.
+     */
+    public LdapResultPOJO()
+    {
+        super( );
+    }
+
+    //~ Methods ------------------------------------------------------------------------------------
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return Returns the errorMessage.
+     */
+    public String getErrorMessage()
+    {
+        return ( ( errorMessage == null ) ? null : errorMessage.toString() );
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param errorMessage The errorMessage to set.
+     */
+    public void setErrorMessage( MutableString errorMessage )
+    {
+        this.errorMessage = errorMessage;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return Returns the matchedDN.
+     */
+    public String getMatchedDN()
+    {
+        return ( ( matchedDN == null ) ? null : matchedDN.toString() );
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param matchedDN The matchedDN to set.
+     */
+    public void setMatchedDN( MutableString matchedDN )
+    {
+        this.matchedDN = matchedDN;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return Returns the referral.
+     */
+    public MutableString[] getReferral()
+    {
+        return referral;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param referral The referral to set.
+     */
+    public void setReferral( MutableString[] referral )
+    {
+        this.referral = referral;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @return Returns the resultCode.
+     */
+    public int getResultCode()
+    {
+        return resultCode;
+    }
+
+    /**
+     * DOCUMENT ME!
+     *
+     * @param resultCode The resultCode to set.
+     */
+    public void setResultCode( int resultCode )
+    {
+        this.resultCode = resultCode;
+    }
+
+    /**
+     * Free the LdapResult POJO.
+     */
+    public void free()
+    {
+        resultCode = 0;
+
+        if ( matchedDN != null )
+        {
+            matchedDN.free();
+        }
+
+        if ( errorMessage != null )
+        {
+            errorMessage.free();
+        }
+
+        if ( referral != null )
+        {
+
+            for ( int i = 0; i < referral.length; i++ )
+            {
+
+                if ( referral[i] != null )
+                {
+                    referral[i].free();
+                }
+            }
+
+            referral = null;
+        }
+    }
+}