com.sun.jndi.ldap.ext
Class BulkImportStartRequest

java.lang.Object
  extended by com.sun.jndi.ldap.ext.BulkImportStartRequest
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.ExtendedRequest

public class BulkImportStartRequest
extends java.lang.Object
implements javax.naming.ldap.ExtendedRequest

This class implements the LDAPv3 Extended Request for BulkImportStart. The BulkImportStartRequest is used to mark the beginning of a bulk import operation.

The bulk import extended operations allow importing entries remotely with a series of LDAP add operations. When the bulk import operation starts it must be finished by sending the BulkImportFinishedRequest before the normal LDAP operations can resume. Only LDAP add operations are legal between BulkImportStart and BulkImportFinished operations.

Note that to add entries using JNDI, use the context methods Context.createSubcontext or Context.bind.

WARNING: Users have to be extremely careful when using bulk import operations. Once a bulk import has begun, the previous contents under the naming context tree are erased. When a bulk import is started, if the connection is aborted before the bulk import finished is sent, no entries are imported and the previous contents under the naming context tree are wiped out of the directory.

The object identifier for BulkImportStart is 2.16.840.1.113730.3.5.7 and the extended request value is the naming context to import to.

The following code sample shows how the extended operation may be used:

     // create an initial context using the supplied environment properties
     LdapContext ctx = new InitialLdapContext(env, null);

     // The naming context to import to
     String namingContext;

     // Bulk import starts
     ctx.extendedOperation(new BulkImportStartRequest(
                                         namingContext));
     System.out.println("Bulk import operation begins");

     // Add entries 
     ctx.createSubcontext(entryName, entryAttrs);
           :
             :
     // Bulk import done 
     ctx.extendedOperation(new BulkImportFinishedRequest());
     System.out.println("Bulk import operation finished");
 

Author:
Jayalaxmi Hangal
See Also:
BulkImportFinishedRequest, Serialized Form

Field Summary
static java.lang.String OID
          The BulkImportStart extended operation's assigned object identifier is 2.16.840.1.113730.3.5.7
private static long serialVersionUID
           
private  byte[] value
          ASN1 Ber encoded value of the extended request
 
Constructor Summary
BulkImportStartRequest(java.lang.String importName)
          Constructs a BulkImportStart extended request.
 
Method Summary
 javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String id, byte[] berValue, int offset, int length)
          Creates an extended response object that corresponds to the LDAP BulkImportStart extended request.
 byte[] getEncodedValue()
          Retrieves the BulkImportStart request's ASN.1 BER encoded value.
 java.lang.String getID()
          Retrieves the BulkImportStart request's object identifier string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OID

public static final java.lang.String OID
The BulkImportStart extended operation's assigned object identifier is 2.16.840.1.113730.3.5.7

See Also:
Constant Field Values

value

private byte[] value
ASN1 Ber encoded value of the extended request


serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

BulkImportStartRequest

public BulkImportStartRequest(java.lang.String importName)
                       throws java.io.IOException
Constructs a BulkImportStart extended request.

Parameters:
importName - The naming context to import to. The naming context is one of the values of the namingContexts attribute contained in the servers' rootDSE entry.
Throws:
java.io.IOException - If a BER encoding error occurs.
Method Detail

getID

public java.lang.String getID()
Retrieves the BulkImportStart request's object identifier string.

Specified by:
getID in interface javax.naming.ldap.ExtendedRequest
Returns:
The non-null object identifier string.

getEncodedValue

public byte[] getEncodedValue()
Retrieves the BulkImportStart request's ASN.1 BER encoded value.

Specified by:
getEncodedValue in interface javax.naming.ldap.ExtendedRequest
Returns:
The ASN.1 BER encoded value of the LDAP extended request.

createExtendedResponse

public javax.naming.ldap.ExtendedResponse createExtendedResponse(java.lang.String id,
                                                                 byte[] berValue,
                                                                 int offset,
                                                                 int length)
                                                          throws javax.naming.NamingException
Creates an extended response object that corresponds to the LDAP BulkImportStart extended request.

Specified by:
createExtendedResponse in interface javax.naming.ldap.ExtendedRequest
Throws:
javax.naming.NamingException