Iím working on a java program to view event records in the cache of a
DirXML-Driver object on a server using ViewCacheEntriesRequest and
ViewCacheEntriesResponse.

On the server, using dxcmd, the driver cache statistics is as follows

<cache>
<size>176226</size>
<unprocessed-size>176226</unprocessed-size>
<transactions>
<oldest>20080815120925.381Z</oldest>
<newest>20080828174426.003Z</newest>
<counts>
<add>13</add>
<modify>486</modify>
<remove>13</remove>
</counts>
</transactions>
</cache>


Iím looking for the right method to use in viewCacheEntriesRequest /
viewCacheEntriesResponse to extract the transactions displayed in the
above statistics.

The following is the code Iíve written so far

public void registerExtendedResponse() {
/*
* Register the extendedresponse class which is returned by the
server
* in response to a LdapBackupRequest
*/

com.novell.ldap.LDAPExtendedResponse.register(\"2. 16.840.1.113719.1.14.100.42\",
com.novell.nds.dirxml.ldap.ViewCacheEntriesRespons e.class);
}

protected void exportCacheEntries() throws LDAPException {
registerExtendedResponse();
// DirXMLExtensions.initialize();
LDAPConnection lc = getLDAPConnection();
com.novell.nds.dirxml.ldap.ViewCacheEntriesRequest
viewCacheEntriesRequest = new
com.novell.nds.dirxml.ldap.ViewCacheEntriesRequest (driverDN,
viewCacheTimeout, viewCachePosition, viewCacheCount);
ViewCacheEntriesResponse viewCacheEntriesResponse =
(ViewCacheEntriesResponse)
lc.extendedOperation(viewCacheEntriesRequest);

FileOutputStream f = null;
try {
f = new FileOutputStream(\"viewCacheResponse.txt\");
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
ObjectOutput s = null;
try {
if (f != null)
s = new ObjectOutputStream(f);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

try {
if (s != null)
viewCacheEntriesResponse.writeExternal(s);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}




The following is the output saved in viewCacheResponse.txt

Ū__z___¬_

************************************************** ***********************
** The encrypted data above and below is the Class definition and
******
** other data specific to Java Serialization Protocol. The data
********
** which is of most application specific interest is as follows...
******
************************************************** ***********************
****************** Start of application data
****************************
************************************************** ***********************

<batchResponse xmlns=\"urnasis:names:tcSML:2:0:core\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">
<extendedResponse requestID=\"2\">
<resultCode code=\"0\" descr=\"Success\" />
<responseName>2.16.840.1.113719.1.14.100.42</responseName>
<response
xsi:type=\"xsd:base64Binary\">MIQAAAAQAgQAmM5+AgMG 3m8CAwKvEg==</response>
</extendedResponse>
</batchResponse>

Iíve dabbled with writeExternal(), getEncodedValue() and getValue() of
viewCacheEntriesResponse but none seem to actually contain the cache
transactions.

Any help is appreciated.
Harold


--
haroldsaldanha
------------------------------------------------------------------------
haroldsaldanha's Profile: http://forums.novell.com/member.php?userid=28926
View this thread: http://forums.novell.com/showthread.php?t=341604