1 17 package org.apache.ldap.server.jndi; 18 19 20 import org.apache.ldap.common.NotImplementedException; 21 import org.apache.ldap.server.PartitionNexus; 22 import org.apache.ldap.server.authn.LdapPrincipal; 23 24 import javax.naming.Name ; 25 import javax.naming.NamingException ; 26 import javax.naming.ldap.Control ; 27 import javax.naming.ldap.ExtendedRequest ; 28 import javax.naming.ldap.ExtendedResponse ; 29 import javax.naming.ldap.LdapContext ; 30 import java.util.Hashtable ; 31 32 33 39 public class ServerLdapContext extends ServerDirContext implements LdapContext 40 { 41 private static final Control [] EMPTY_CONTROLS = new Control [0]; 42 private Control [] requestControls = EMPTY_CONTROLS; 43 private Control [] responseControls = EMPTY_CONTROLS; 44 private Control [] connectControls = EMPTY_CONTROLS; 45 46 47 54 public ServerLdapContext( PartitionNexus nexusProxy, Hashtable env ) throws NamingException 55 { 56 super( nexusProxy, env ); 57 } 58 59 60 69 ServerLdapContext( LdapPrincipal principal, PartitionNexus nexusProxy, Hashtable env, Name dn ) 70 { 71 super( principal, nexusProxy, env, dn ); 72 } 73 74 75 79 public ExtendedResponse extendedOperation( ExtendedRequest request ) 80 { 81 throw new NotImplementedException(); 82 } 83 84 85 89 public LdapContext newInstance( Control [] requestControls ) 90 throws NamingException 91 { 92 ServerLdapContext ctx = new ServerLdapContext( getPrincipal(), getNexusProxy(), 93 getEnvironment(), getDn() ); 94 ctx.setRequestControls( requestControls ); 95 return ctx; 96 } 97 98 99 102 public void reconnect( Control [] connCtls ) throws NamingException 103 { 104 this.connectControls = connCtls; 105 } 106 107 108 111 public Control [] getConnectControls() throws NamingException 112 { 113 return this.connectControls; 114 } 115 116 117 121 public void setRequestControls( Control [] requestControls ) 122 throws NamingException 123 { 124 this.requestControls = requestControls; 125 } 126 127 128 131 public Control [] getRequestControls() throws NamingException 132 { 133 return requestControls; 134 } 135 136 137 140 public Control [] getResponseControls() throws NamingException 141 { 142 return responseControls; 143 } 144 } 145 | Popular Tags |