/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
*/
private int portnumber;
private int threadId;
private boolean output;
private boolean ldifFormat;
private boolean logFile;
/**
* constructor
* @param id
* @param hostname
* @param portnumber
* @param bindDN
* @param bindPW
* @param suffix
*/
public PSearchOperations(int id, String hostname, int portnumber, String bindDN, String bindPW, String suffix) {
this.portnumber = portnumber;
this.output = false;
this.logFile = false;
this.ldifFormat = false;
//by default all operation
}
/**
* to use systeme.out
* @param output boolean
*/
}
/**
* to use the log file
* @param logFile boolean
*/
}
/**
* to define the log file and URI
* @param file String
*/
//if there one thread the thread id are not add in the file name
//in multy thread for each thread the thread id are add in the file name
if (threadId!=0) {
}
//delete old log file if logFile is present and enable
}
}
/**
* to define the PSearch operation
* @param operation String
*/
}
this.ldifFormat = ldifFormat;
}
/**
*Connect to server.
*/
private void connect() {
try {
connection = new LDAPConnection();
if(!ldifFormat)
} catch (LDAPException ex) {
}
}
/**
* to instanciate new LDAPPersistSearchControl
* @return LDAPPersistSearchControl
*/
int op = 0;
}
boolean changesOnly = true;
boolean returnControls = true;
boolean isCritical = true;
op,
return persistCtrl;
}
/**
* LDAP Search
* @return LDAPSearchResults
*/
try {
// Start the persistent search.
} catch (LDAPException ex) {
}
return res;
}
/**
* return the date and time
* @return String
*/
// Initialize the today's date string
}
/**
*
* @param b byte off control operation
* @return
*/
switch (b) {
case LDAPPersistSearchControl.ADD:
control = "ADD";
break;
control = "DELETE";
break;
control = "MODDN";
break;
control = "MODIFY";
break;
default:
break;
}
return control;
}
/**
* to write on the log file or to use syteme out
* @param msg String
*/
if (output) {
}
if (logFile) {
try {
} catch (IOException ex) {
} finally {
try {
} catch (IOException ex) {
}
}
}
}
/**
* run thread methode
*/
public void run() {
connect();
if(!ldifFormat)
try {
if(!ldifFormat)
} catch (LDAPException ex) {
}
}
if(!ldifFormat)
else
write("\n");
while (attrs.hasMoreElements()) {
while (values.hasMoreElements()) {
}
}
}
if (!connection.isConnected()) {
}
}
}