1 17 package org.apache.ldap.server.interceptor; 18 19 20 import org.apache.ldap.common.exception.LdapException; 21 import org.apache.ldap.common.exception.LdapNamingException; 22 import org.apache.ldap.common.message.ResultCodeEnum; 23 import org.apache.ldap.server.invocation.Invocation; 24 25 26 32 public class InterceptorException extends LdapNamingException 33 { 34 private static final long serialVersionUID = 3258690996517746233L; 35 36 39 private final Invocation invocation; 40 41 44 private final Interceptor interceptor; 45 46 47 53 public InterceptorException( Interceptor interceptor, Invocation invocation ) 54 { 55 super( ResultCodeEnum.OTHER ); 56 57 this.invocation = invocation; 58 59 this.interceptor = interceptor; 60 } 61 62 63 70 public InterceptorException( Interceptor interceptor, Invocation invocation, String explanation ) 71 { 72 super( explanation, ResultCodeEnum.OTHER ); 73 74 this.invocation = invocation; 75 76 this.interceptor = interceptor; 77 } 78 79 80 87 public InterceptorException( Interceptor interceptor, Invocation invocation, Throwable rootCause ) 88 { 89 this( interceptor, invocation ); 90 91 super.setRootCause( rootCause ); 92 } 93 94 95 103 public InterceptorException( Interceptor interceptor, Invocation invocation, String explanation, 104 Throwable rootCause ) 105 { 106 this( interceptor, invocation, explanation ); 107 108 super.setRootCause( rootCause ); 109 } 110 111 112 117 public Invocation getInvocation() 118 { 119 return invocation; 120 } 121 122 123 128 public Interceptor getInterceptor() 129 { 130 return interceptor; 131 } 132 133 134 139 public ResultCodeEnum getResultCode() 140 { 141 if ( getRootCause() != null && ( getRootCause() instanceof LdapException ) ) 142 { 143 return ( ( LdapException ) getRootCause() ).getResultCode(); 144 } 145 146 return super.getResultCode(); 147 } 148 } 149 | Popular Tags |