本文整理了Java中com.novell.ldap.LDAPConnection.read()
方法的一些代码示例,展示了LDAPConnection.read()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LDAPConnection.read()
方法的具体详情如下:
包路径:com.novell.ldap.LDAPConnection
类名称:LDAPConnection
方法名:read
[英]Synchronously reads the entry specified by the LDAP URL.
When this read method is called, a new connection is created automatically, using the host and port specified in the URL. After finding the entry, the method closes the connection (in other words, it disconnects from the LDAP server).
If the URL specifies a filter and scope, they are not used. Of the information specified in the URL, this method only uses the LDAP host name and port number, the base distinguished name (DN), and the list of attributes to return.
[中]同步读取LDAP URL指定的条目。
调用此读取方法时,将使用URL中指定的主机和端口自动创建新连接。找到条目后,该方法将关闭连接(换句话说,它将断开与LDAP服务器的连接)。
如果URL指定了筛选器和作用域,则不使用它们。在URL中指定的信息中,此方法仅使用LDAP主机名和端口号、基本可分辨名称(DN)和要返回的属性列表。
代码示例来源:origin: neo4j-contrib/neo4j-apoc-procedures
private LDAPEntry read(String dn) throws LDAPException, UnsupportedEncodingException {
if (dn == null) return null;
LDAPEntry r = null;
op("read start for dn: " + dn);
LDAPConnection lc = getConnection();
r = lc.read(dn);
closeIt(lc);
// op( r.toString());
op("read end");
return r;
}
代码示例来源:origin: com.novell.ldap/jldap
/**
* Synchronously reads the entry for the specified distiguished name (DN)
* and retrieves all attributes for the entry.
*
* @param dn The distinguished name of the entry to retrieve.
*
* @return the LDAPEntry read from the server.
*
* @exception LDAPException if the object was not found
*/
public LDAPEntry read(String dn)
throws LDAPException
{
return read(dn, defSearchCons);
}
代码示例来源:origin: com.novell.ldap/jldap
/**
*
* Synchronously reads the entry for the specified distiguished name (DN),
* using the specified constraints, and retrieves all attributes for the
* entry.
*
* @param dn The distinguished name of the entry to retrieve.
*<br><br>
* @param cons The constraints specific to the operation.
*
* @return the LDAPEntry read from the server
*
* @exception LDAPException if the object was not found
*/
public LDAPEntry read(String dn,
LDAPSearchConstraints cons)
throws LDAPException
{
return read(dn, null, cons);
}
代码示例来源:origin: com.novell.ldap/jldap
/**
*
* Synchronously reads the entry for the specified distinguished name (DN)
* and retrieves only the specified attributes from the entry.
*
* @param dn The distinguished name of the entry to retrieve.
*<br><br>
* @param attrs The names of the attributes to retrieve.
*
* @return the LDAPEntry read from the server
*
* @exception LDAPException if the object was not found
*/
public LDAPEntry read(String dn,
String[] attrs)
throws LDAPException
{
return read(dn, attrs, defSearchCons);
}
代码示例来源:origin: com.novell.ldap/jldap
/**
* Retrieves the schema associated with a particular schema DN in the
* directory server.
* <p>The schema DN for a particular entry is obtained by calling the
* getSchemaDN method of LDAPConnection</p>
*
* @param schemaDN The schema DN used to fetch the schema.
*
* @return An LDAPSchema entry containing schema attributes. If the
* entry contains no schema attributes then the returned LDAPSchema object
* will be empty.
*
* @exception LDAPException This exception occurs if the schema entry
* cannot be retrieved with this connection.
* @see #getSchemaDN()
* @see #getSchemaDN(String)
*/
public LDAPSchema fetchSchema ( String schemaDN ) throws LDAPException {
/* Read the schema definitions. If no entry is found an
* Exception is thrown */
LDAPEntry ent = read(schemaDN, LDAPSchema.schemaTypeNames);
return new LDAPSchema(ent);
}
代码示例来源:origin: com.novell.ldap/jldap
/**
* Synchronously reads the entry for the specified distiguished name (DN)
* and retrieves all attributes for the entry.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(java.lang.String)">
com.novell.ldap.LDAPConnection.read(String)</a>
*/
public LDAPEntry read(String dn)
throws LDAPException
{
try {
return new LDAPEntry( conn.read( dn));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: com.novell.ldap/jldap
/**
*
* Synchronously reads the entry for the specified distinguished name (DN)
* and retrieves only the specified attributes from the entry.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(java.lang.String, java.lang.String[])">
com.novell.ldap.LDAPConnection.read(String, String[])</a>
*/
public LDAPEntry read(String dn,
String[] attrs)
throws LDAPException
{
try {
return new LDAPEntry( conn.read( dn, attrs));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: apache/guacamole-client
LDAPEntry userEntry = ldapConnection.read(userDN, attrArray);
if (userEntry == null)
return Collections.<String, String>emptyMap();
代码示例来源:origin: com.novell.ldap/jldap
/**
* Synchronously reads the entry specified by the LDAP URL.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(com.novell.ldap.LDAPUrl)">
com.novell.ldap.LDAPConnection.read(LDAPUrl)</a>
*/
public static LDAPEntry read(LDAPUrl toGet)
throws LDAPException
{
try {
return new LDAPEntry( com.novell.ldap.LDAPConnection.read(
toGet.getWrappedObject()));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: com.novell.ldap/jldap
/**
* Synchronously reads the entry for the specified distiguished name (DN),
* using the specified constraints, and retrieves all attributes for the
* entry.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(java.lang.String, com.novell.ldap.LDAPSearchConstraints)">
com.novell.ldap.LDAPConnection.read(String,
LDAPSearchConstraints)</a>
*/
public LDAPEntry read(String dn,
LDAPSearchConstraints cons)
throws LDAPException
{
try {
return new LDAPEntry( conn.read(dn, cons.getWrappedSearchObject()));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: com.novell.ldap/jldap
/**
*
* Synchronously reads the entry for the specified distinguished name (DN),
* using the specified constraints, and retrieves only the specified
* attributes from the entry.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(java.lang.String, java.lang.String[],
com.novell.ldap.LDAPSearchConstraints)">
com.novell.ldap.LDAPConnection.read(String, String[],
LDAPSearchConstraints)</a>
*/
public LDAPEntry read(String dn,
String[] attrs,
LDAPSearchConstraints cons)
throws LDAPException
{
try {
return new LDAPEntry( conn.read( dn,attrs,
cons.getWrappedSearchObject()));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: com.novell.ldap/jldap
LDAPEntry ent = this.read( dn, attrSubSchema );
代码示例来源:origin: com.novell.ldap/jldap
/**
* Synchronously reads the entry specified by the LDAP URL, using the
* specified constraints.
*
* @see <a href="../../../../api/com/novell/ldap/LDAPConnection.html#read(com.novell.ldap.LDAPUrl,
com.novell.ldap.LDAPSearchConstraints)">
com.novell.ldap.LDAPConnection.read(LDAPUrl,
LDAPSearchConstraints)</a>
*/
public static LDAPEntry read(LDAPUrl toGet,
LDAPSearchConstraints cons)
throws LDAPException
{
try {
return new LDAPEntry(
com.novell.ldap.LDAPConnection.read(
toGet.getWrappedObject(),
cons.getWrappedSearchObject()));
} catch( com.novell.ldap.LDAPException ex) {
if( ex instanceof com.novell.ldap.LDAPReferralException) {
throw new LDAPReferralException(
(com.novell.ldap.LDAPReferralException)ex);
} else {
throw new LDAPException( ex);
}
}
}
代码示例来源:origin: com.novell.ldap/jldap
LDAPEntry toReturn = lconn.read(toGet.getDN(),toGet.getAttributeArray());
if( Debug.LDAP_DEBUG) {
Debug.trace( Debug.apiRequests, "read: disconnect()");
代码示例来源:origin: com.novell.ldap/jldap
LDAPEntry toReturn = lconn.read(toGet.getDN(),
toGet.getAttributeArray(), cons);
if( Debug.LDAP_DEBUG) {
内容来源于网络,如有侵权,请联系作者删除!