*
* @return
*/
public GlobalRequestResponse processGlobalRequest(String requestName,
byte[] requestData) {
GlobalRequestResponse response = new GlobalRequestResponse(false);
String addressToBind = null;
int portToBind = -1;
log.debug("Processing " + requestName + " global request");
try {
ByteArrayReader bar = new ByteArrayReader(requestData);
addressToBind = bar.readString();
portToBind = (int) bar.readInt();
if (requestName.equals(ForwardingClient.REMOTE_FORWARD_REQUEST)) {
addRemoteForwardingConfiguration(addressToBind, portToBind);
response = new GlobalRequestResponse(true);
}
if (requestName.equals(
ForwardingClient.REMOTE_FORWARD_CANCEL_REQUEST)) {
removeRemoteForwarding(addressToBind, portToBind);
response = new GlobalRequestResponse(true);
}
} catch (IOException ioe) {
log.warn("The client failed to request " + requestName + " for " +
addressToBind + ":" + String.valueOf(portToBind), ioe);
}