/**
* Encrypt and send a synchronous get request, decrypt the returned data
*/
private void get(MsgQueueEntry entry) throws XmlBlasterException {
MsgQueueGetEntry getEntry = (MsgQueueGetEntry)entry;
String key = getEntry.getGetKey().toXml();
String qos = getEntry.getGetQos().toXml();
if (this.securityInterceptor != null) { // We export/encrypt the message (call the interceptor)
CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, new MsgUnitRaw(key, (byte[])null, qos));
MsgUnitRaw msgUnitRaw = securityInterceptor.exportMessage(dataHolder);
key = msgUnitRaw.getKey();
qos = msgUnitRaw.getQos();
if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted get request.");
}
else {
log.warning("No session security context, get request is not encrypted");
}
MsgUnitRaw[] rawReturnValArr = this.driver.get(key, qos); // Invoke remote server
connectionsHandler.getDispatchStatistic().incrNumGet(1);
MsgUnit[] msgUnitArr = new MsgUnit[rawReturnValArr.length];
if (getEntry.wantReturnObj()) {
for (int ii=0; ii<rawReturnValArr.length; ii++) {
if (this.securityInterceptor != null) { // decrypt return value ...
CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, rawReturnValArr[ii]);
dataHolder.setReturnValue(true);
rawReturnValArr[ii] = securityInterceptor.importMessage(dataHolder);
}
// NOTE: We use PUBLISH here instead of GET_RETURN to have the whole MsgUnit stored
msgUnitArr[ii] = new MsgUnit(glob, rawReturnValArr[ii], MethodName.PUBLISH);
}
getEntry.setReturnObj(msgUnitArr);
}
}