/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2010 Sun Microsystems, Inc.
*/
this.queue = q;
}
public void run() {
// master number in the array list
int masterN = 0;
// ECL "draft" mode index
int changeNumber = 0;
// ECL "opends" mode index
try {
int idleTime = 0;
while (true) {
try {
// Connect to the Directory master
EclReadAndPlay.println("INFO", "Connecting to master " + master.host + ":" + master.port + " ......");
// Set changenumber
// Try to retrieve the ECL index (changenumber|changelogcookie) of the last update read
// ---> use the CSN stored in the file under "db" directory
false );
changeNumber = c;
}
} else {
}
} else {
new String[]{"firstChangeNumber"} , false );
changeNumber = c;
}
} else {
}
}
} else {
}
} else {
}
}
} /* for (CSN csn: ...) */
synchronized (EclReadAndPlay.lock) {
}
"targetEntryUUID", "changeType", "changes",
"deleteOldRDN", "newRDN", "newSuperior",
"changeNumber", "changeHasReplFixupOp",
"changeLogCookie"};
+ limit + ") )";
attributes , false );
// --control "1.3.6.1.4.1.26027.1.5.4:false:;"
attributes , false, controls );
}
if ( ! results.hasMoreElements() ) {
// No new change found in retrocl => sleep 100 ms.
sleep(100);
idleTime += 100;
} else {
idleTime = 0;
// Forward all the results found to the application
while ( results.hasMoreElements() ) {
try {
} catch (LDAPException ldapEx) {
continue;
else
throw ldapEx;
}
//EclReadAndPlay.println("DEBUG", "Changelog entry: " + entry.toString());
try {
// Write the change in the queue
} catch (Exception e) {
}
changeNumber++;
}
}
} /* while (result.hasMoreElements()) */
}
if ( EclReadAndPlay.displayMissingChanges == true ) {
new String[]{"lastChangeNumber"} , false );
}
new String[]{"lastExternalChangelogCookie"} , false );
}
}
}
} /* while (idleTime <= EclReadAndPlay.MAX_IDLE_TIME) */
EclReadAndPlay.println("WARNING", "No new changes read in the ECL for " + Integer.toString(idleTime) +
" milliseconds. ======> EXIT");
} catch( LDAPException e ) {
int errorCode = e.getLDAPResultCode();
// if server is down => switch
// clear the queue of changes
} else {
e.printStackTrace();
}
}
} /* while (true) */
} catch (Exception e) {
e.printStackTrace();
}
}
}