directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r925499 - in /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception: AbstractLdapReferralException.java LdapPartialResultException.java LdapReferralException.java
Date Sat, 20 Mar 2010 00:22:40 GMT
Author: elecharny
Date: Sat Mar 20 00:22:40 2010
New Revision: 925499

URL: http://svn.apache.org/viewvc?rev=925499&view=rev
Log:
o Added the missing PartialResult exception
o Changed the inheritance scheme for the Referral related exceptions

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapPartialResultException.java
Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java?rev=925499&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/AbstractLdapReferralException.java
Sat Mar 20 00:22:40 2010
@@ -0,0 +1,125 @@
+/*
+ *  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.exception;
+
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.ReferralException;
+
+import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.DN;
+
+
+/**
+ * A {@link LdapOperationException} which associates a resultCode namely the
+ * {@link ResultCodeEnum#REFERRAL} resultCode with the exception.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 923448 $
+ */
+public class AbstractLdapReferralException extends LdapOperationException
+{
+    /** The serial version UUID */
+    static final long serialVersionUID = 1L;
+
+    /** The remaining DN */
+    private DN remainingDn;
+    
+    /** TODO */
+    private Object resolvedObject;
+
+
+    /**
+     * @see ReferralException#ReferralException(java.lang.String)
+     */
+    public AbstractLdapReferralException( String explanation )
+    {
+        super( explanation );
+    }
+
+
+    /**
+     * Always returns {@link ResultCodeEnum#REFERRAL}
+     * 
+     * @see LdapException#getResultCode()
+     */
+    public ResultCodeEnum getResultCode()
+    {
+        return ResultCodeEnum.REFERRAL;
+    }
+
+
+    public Context getReferralContext() throws NamingException
+    {
+        throw new NotImplementedException();
+    }
+
+
+    public Context getReferralContext( Hashtable<?, ?> arg ) throws NamingException
+    {
+        throw new NotImplementedException();
+    }
+
+
+    public void retryReferral()
+    {
+        throw new NotImplementedException();
+    }
+    
+    
+    /**
+     * @return the remainingDn
+     */
+    public DN getRemainingDn()
+    {
+        return remainingDn;
+    }
+
+
+    /**
+     * @param remainingDn the remainingName to set
+     */
+    public void setRemainingDn( DN remainingDn )
+    {
+        this.remainingDn = remainingDn;
+    }
+
+
+    /**
+     * @return the resolvedObject
+     */
+    public Object getResolvedObject()
+    {
+        return resolvedObject;
+    }
+
+
+    /**
+     * @param resolvedObject the resolvedObject to set
+     */
+    public void setResolvedObject( Object resolvedObject )
+    {
+        this.resolvedObject = resolvedObject;
+    }
+}

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapPartialResultException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapPartialResultException.java?rev=925499&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapPartialResultException.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapPartialResultException.java
Sat Mar 20 00:22:40 2010
@@ -0,0 +1,45 @@
+/*
+ *  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.exception;
+
+import javax.naming.ReferralException;
+
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+
+/**
+ * A {@link LdapOperationException} which associates a resultCode namely the
+ * {@link ResultCodeEnum#REFERRAL} resultCode with the exception.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 923448 $
+ */
+public class LdapPartialResultException extends AbstractLdapReferralException
+{
+    /** The serial version UUID */
+    static final long serialVersionUID = 1L;
+
+    /**
+     * @see ReferralException#ReferralException(java.lang.String)
+     */
+    public LdapPartialResultException( String explanation )
+    {
+        super( explanation );
+    }
+}

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java?rev=925499&r1=925498&r2=925499&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapReferralException.java
Sat Mar 20 00:22:40 2010
@@ -31,6 +31,7 @@ import javax.naming.ReferralException;
 
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -40,14 +41,22 @@ import org.apache.directory.shared.ldap.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class LdapReferralException extends LdapOperationException
+public class LdapReferralException extends AbstractLdapReferralException
 {
     /** The serial version UUID */
     static final long serialVersionUID = 1L;
 
+    /** The list of referrals */
     private final List<String> refs;
 
+    /** The current index in the list of referrals */
     private int index = 0;
+    
+    /** The remaining DN */
+    private DN remainingDn;
+    
+    /** TODO */
+    private Object resolvedObject;
 
 
     /**
@@ -110,4 +119,40 @@ public class LdapReferralException exten
     {
         throw new NotImplementedException();
     }
+    
+    
+    /**
+     * @return the remainingDn
+     */
+    public DN getRemainingDn()
+    {
+        return remainingDn;
+    }
+
+
+    /**
+     * @param remainingDn the remainingName to set
+     */
+    public void setRemainingDn( DN remainingDn )
+    {
+        this.remainingDn = remainingDn;
+    }
+
+
+    /**
+     * @return the resolvedObject
+     */
+    public Object getResolvedObject()
+    {
+        return resolvedObject;
+    }
+
+
+    /**
+     * @param resolvedObject the resolvedObject to set
+     */
+    public void setResolvedObject( Object resolvedObject )
+    {
+        this.resolvedObject = resolvedObject;
+    }
 }



Mime
View raw message