1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 * 19 */ 20 package org.apache.directory.api.ldap.model.exception; 21 22 23 import java.util.Map; 24 25 import javax.naming.Context; 26 import javax.naming.NamingException; 27 28 import org.apache.directory.api.ldap.model.message.ResultCodeEnum; 29 import org.apache.directory.api.ldap.model.name.Dn; 30 import org.apache.directory.api.util.exception.NotImplementedException; 31 32 33 /** 34 * A {@link LdapOperationException} which associates a resultCode namely the 35 * {@link org.apache.directory.api.ldap.model.message.ResultCodeEnum#REFERRAL} resultCode with the exception. 36 * 37 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 38 */ 39 public class AbstractLdapReferralException extends LdapOperationException 40 { 41 /** The serial version UUID */ 42 static final long serialVersionUID = 1L; 43 44 /** The remaining Dn */ 45 private Dn remainingDn; 46 47 /** The entry the referal refers to */ 48 private Object resolvedObject; 49 50 51 /** 52 * 53 * Creates a new instance of AbstractLdapReferralException. 54 * 55 * @param explanation The associated message 56 */ 57 public AbstractLdapReferralException( String explanation ) 58 { 59 super( explanation ); 60 } 61 62 63 /** 64 * Always returns {@link ResultCodeEnum#REFERRAL} 65 * 66 * @return The interned ResultCode 67 */ 68 @Override 69 public ResultCodeEnum getResultCode() 70 { 71 return ResultCodeEnum.REFERRAL; 72 } 73 74 75 /** 76 * Not yet implemented 77 * 78 * @return The Referral Context 79 * @throws NamingException If the operation failed 80 */ 81 public Context getReferralContext() throws NamingException 82 { 83 throw new NotImplementedException(); 84 } 85 86 87 /** 88 * Not yet implemented 89 * 90 * @param arg The arguments 91 * @return The referral context 92 * @throws NamingException If the operation failed 93 */ 94 public Context getReferralContext( Map<?, ?> arg ) throws NamingException 95 { 96 throw new NotImplementedException(); 97 } 98 99 100 /** 101 * Retry. Not yet implemented 102 */ 103 public void retryReferral() 104 { 105 throw new NotImplementedException(); 106 } 107 108 109 /** 110 * @return the remainingDn 111 */ 112 public Dn getRemainingDn() 113 { 114 return remainingDn; 115 } 116 117 118 /** 119 * @param remainingDn the remainingName to set 120 */ 121 public void setRemainingDn( Dn remainingDn ) 122 { 123 this.remainingDn = remainingDn; 124 } 125 126 127 /** 128 * @return the resolvedObject 129 */ 130 public Object getResolvedObject() 131 { 132 return resolvedObject; 133 } 134 135 136 /** 137 * @param resolvedObject the resolvedObject to set 138 */ 139 public void setResolvedObject( Object resolvedObject ) 140 { 141 this.resolvedObject = resolvedObject; 142 } 143 }