@Override public Object removeFromEnvironment(String propName) throws NamingException { return delegating.removeFromEnvironment(propName); }
private void returnDirContext(DirContext context) { try { if (binaryAttributesBackup == null) { context.removeFromEnvironment(ENV_BINARY_ATTRIBUTES); } else { context.addToEnvironment(ENV_BINARY_ATTRIBUTES, binaryAttributesBackup); } context.close(); } catch (NamingException e) { throw log.failedToReturnDirContext(e); } }
context.addToEnvironment(Context.SECURITY_PRINCIPAL, getLDAPPropertyValue(CONNECTION_USERNAME)); } else { context.removeFromEnvironment(Context.SECURITY_PRINCIPAL); context.removeFromEnvironment(Context.SECURITY_CREDENTIALS);
private NamingEnumeration<SearchResult> searchWithPagination() throws NamingException, IOException { Control[] controlsBackup = null; Object binaryAttributesBackup = null; // backup and set environment if (pageSize != 0 && context instanceof LdapContext) { controlsBackup = ((LdapContext)context).getRequestControls(); ((LdapContext)context).setRequestControls(new Control[]{ new PagedResultsControl(pageSize, cookie, Control.CRITICAL) }); } if (binaryAttributes != null && binaryAttributes.size() != 0) { // set attributes which should be returned in binary form binaryAttributesBackup = context.getEnvironment().get(ENV_BINARY_ATTRIBUTES); context.addToEnvironment(ENV_BINARY_ATTRIBUTES, String.join(" ", binaryAttributes)); } NamingEnumeration<SearchResult> results = context.search(new LdapName(searchDn), filter, filterArgs, createSearchControls()); // revert environment change if (binaryAttributes != null && binaryAttributes.size() != 0) { if (binaryAttributesBackup == null) { context.removeFromEnvironment(ENV_BINARY_ATTRIBUTES); } else { context.addToEnvironment(ENV_BINARY_ATTRIBUTES, binaryAttributesBackup); } } if (pageSize != 0 && context instanceof LdapContext) { ((LdapContext)context).setRequestControls(controlsBackup); } return results; }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ @Override public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ @Override public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
@Override public synchronized Object removeFromEnvironment(String propName) throws NamingException { return this.delegate.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ @Override public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
@Override public Object removeFromEnvironment(String propName) throws NamingException { return delegating.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ @Override public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
/** * Removes an environment property from the environment of this context. * * @param propName the name of the environment property to remove; * may not be null * @exception NamingException if a naming exception is encountered */ @Override public Object removeFromEnvironment(String propName) throws NamingException { return dirContext.removeFromEnvironment(propName); }
@Override public Object removeFromEnvironment(String propName) throws NamingException { return delegating.removeFromEnvironment(propName); }
private void restoreEnvironmentParameter(DirContext context, String parameterName, Hashtable<?, ?> preservedEnvironment) { try { context.removeFromEnvironment(parameterName); if (preservedEnvironment != null && preservedEnvironment.containsKey(parameterName)) { context.addToEnvironment(parameterName, preservedEnvironment.get(parameterName)); } } catch (NamingException e) { // Ignore } }
private void restoreEnvironmentParameter(DirContext context, String parameterName, Hashtable<?, ?> preservedEnvironment) { try { context.removeFromEnvironment(parameterName); if (preservedEnvironment != null && preservedEnvironment.containsKey(parameterName)) { context.addToEnvironment(parameterName, preservedEnvironment.get(parameterName)); } } catch (NamingException e) { // Ignore } }
private void restoreEnvironmentParameter(DirContext context, String parameterName, Hashtable<?, ?> preservedEnvironment) { try { context.removeFromEnvironment(parameterName); if (preservedEnvironment != null && preservedEnvironment.containsKey(parameterName)) { context.addToEnvironment(parameterName, preservedEnvironment.get(parameterName)); } } catch (NamingException e) { // Ignore } }
private void returnDirContext(DirContext context) { try { if (binaryAttributesBackup == null) { context.removeFromEnvironment(ENV_BINARY_ATTRIBUTES); } else { context.addToEnvironment(ENV_BINARY_ATTRIBUTES, binaryAttributesBackup); } context.close(); } catch (NamingException e) { throw log.failedToReturnDirContext(e); } }
private void returnDirContext(DirContext context) { try { if (binaryAttributesBackup == null) { context.removeFromEnvironment(ENV_BINARY_ATTRIBUTES); } else { context.addToEnvironment(ENV_BINARY_ATTRIBUTES, binaryAttributesBackup); } context.close(); } catch (NamingException e) { throw log.failedToReturnDirContext(e); } }
private void returnDirContext(DirContext context) { try { if (binaryAttributesBackup == null) { context.removeFromEnvironment(ENV_BINARY_ATTRIBUTES); } else { context.addToEnvironment(ENV_BINARY_ATTRIBUTES, binaryAttributesBackup); } context.close(); } catch (NamingException e) { throw log.failedToReturnDirContext(e); } }