/** * Retrieves the schema from the provided connection. If the retrieved schema * matches schema that's already in use by other connections, the common * schema will be used instead of the newly-retrieved version. * * @param c The connection for which to retrieve the schema. * * @return The schema retrieved from the given connection, or a cached * schema if it matched a schema that was already in use. * * @throws LDAPException If a problem is encountered while retrieving or * parsing the schema. */ private static Schema getCachedSchema(final LDAPConnection c) throws LDAPException { final Schema s = c.getSchema(); synchronized (SCHEMA_SET) { return SCHEMA_SET.addAndGet(s); } }
/** * Retrieves the schema from the provided connection. If the retrieved schema * matches schema that's already in use by other connections, the common * schema will be used instead of the newly-retrieved version. * * @param c The connection for which to retrieve the schema. * * @return The schema retrieved from the given connection, or a cached * schema if it matched a schema that was already in use. * * @throws LDAPException If a problem is encountered while retrieving or * parsing the schema. */ private static Schema getCachedSchema(final LDAPConnection c) throws LDAPException { final Schema s = c.getSchema(); synchronized (SCHEMA_SET) { return SCHEMA_SET.addAndGet(s); } }
/** * Returns the schema definition for the specified object class, in the * format described in RFC 4512 section 4.1.1. * * @param ldapCon The LDAP connection. Must not be {@code null}. * @param objectClass The object class. Must not be {@code null}. * * @return The object class definition, or an error message if an * exception is encountered. */ public static String dumpObjectClassDefinition(final LDAPConnection ldapCon, final String objectClass) { Schema schema; try { schema = ldapCon.getSchema(); } catch (LDAPException e) { return e.getMessage(); } if (schema == null) { return "LDAP schema not available (check permissions)"; } ObjectClassDefinition objClassDef = schema.getObjectClass(objectClass); if (objClassDef == null) { return "No such objectClass: " + objectClass; } return objClassDef.toString(); }
final Schema schema = connection.getSchema(); if (schema != null)
final Schema schema = connection.getSchema(); if (schema != null)
final Schema schema = connection.getSchema(); if (schema != null)
schema = connection.getSchema(); connection.close();
try schema = conn.getSchema(); if (schema == null)
final Schema schema = c.getSchema(); if (schema != null)
final Schema schema = c.getSchema(); if (schema != null)
final Schema schema = c.getSchema(); if (schema != null)