com.netscape.jndi.ldap
Class ProviderUtils

java.lang.Object
  extended by com.netscape.jndi.ldap.ProviderUtils

 class ProviderUtils
extends java.lang.Object

Common utility methods


Field Summary
static java.lang.String DEFAULT_FILTER
           
(package private) static java.lang.String hexDigits
          Escape a byte array according to the RFC 2254
 
Constructor Summary
ProviderUtils()
           
 
Method Summary
(package private) static java.lang.String attributesToFilter(javax.naming.directory.Attributes attrs)
          Convert Attribute List to a LDAP filter
(package private) static java.lang.String escapeBytes(byte[] bytes)
           
(package private) static java.lang.String escapeString(java.lang.String str)
          Escape a string according to the RFC 2254
(package private) static java.lang.String expandFilterExpr(java.lang.String filterExpr, java.lang.Object[] filterArgs)
          Expand filterExpr.
(package private) static int jndiSearchScopeToLdap(int jndiScope)
           
static void main(java.lang.String[] args)
          Test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILTER

public static final java.lang.String DEFAULT_FILTER
See Also:
Constant Field Values

hexDigits

static final java.lang.String hexDigits
Escape a byte array according to the RFC 2254

See Also:
Constant Field Values
Constructor Detail

ProviderUtils

ProviderUtils()
Method Detail

jndiSearchScopeToLdap

static int jndiSearchScopeToLdap(int jndiScope)
                          throws javax.naming.NamingException
Throws:
javax.naming.NamingException

attributesToFilter

static java.lang.String attributesToFilter(javax.naming.directory.Attributes attrs)
                                    throws javax.naming.NamingException
Convert Attribute List to a LDAP filter

Parameters:
attrs - An Attribute List
Returns:
LDAP Filter
Throws:
javax.naming.NamingException

expandFilterExpr

static java.lang.String expandFilterExpr(java.lang.String filterExpr,
                                         java.lang.Object[] filterArgs)
                                  throws javax.naming.directory.InvalidSearchFilterException
Expand filterExpr. Each occurrence of a variable "{n}", where n is a non-negative integer, is replaced with a variable from the filterArgs array indexed by the 'n'. FilterArgs can be Strings or byte[] and they are escaped according to the RFC2254

Throws:
javax.naming.directory.InvalidSearchFilterException

escapeString

static java.lang.String escapeString(java.lang.String str)
Escape a string according to the RFC 2254


escapeBytes

static java.lang.String escapeBytes(byte[] bytes)

main

public static void main(java.lang.String[] args)
Test