/** * Attaches listener to the specific request. * * @param reqID the request identifier. * @param listener listener to be attached. */ public void attach(RequestIdentifier reqID, JainMgcpListener listener) { this.requestListeners.put(reqID.toString().trim(), listener); }
/** * Attaches listener to the specific request. * * @param reqID the request identifier. * @param listener listener to be attached. */ public void attach(RequestIdentifier reqID, JainMgcpListener listener) { this.requestListeners.put(reqID.toString().trim(), listener); }
/** * Deattaches listeners related to specific request. * * @param reqID the request identifier. */ public void deattach(RequestIdentifier reqID) { this.requestListeners.remove(reqID.toString().trim()); }
/** * Deattaches listeners related to specific request. * * @param reqID the request identifier. */ public void deattach(RequestIdentifier reqID) { this.requestListeners.remove(reqID.toString().trim()); }
public void processMgcpCommandEvent(JainMgcpCommandEvent evt) { //we are expecting two types of commands: //-delete connection notification (in case of failure connection on server side) //-notify switch (evt.getObjectIdentifier()) { case Constants.CMD_DELETE_CONNECTION : //TODO: handle delete connection request from server; break; case Constants.CMD_NOTIFY : Notify event = (Notify) evt; //if there is attached handler deligate call to it if (this.requestListeners.containsKey(event.getRequestIdentifier().toString().trim())) { requestListeners.get(event.getRequestIdentifier().toString().trim()).processMgcpCommandEvent(evt); } //send response to this transaction; NotifyResponse response = new NotifyResponse(this, ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(evt.getTransactionHandle()); this.send(response); break; default : } }
public void processMgcpCommandEvent(JainMgcpCommandEvent evt) { //we are expecting two types of commands: //-delete connection notification (in case of failure connection on server side) //-notify switch (evt.getObjectIdentifier()) { case Constants.CMD_DELETE_CONNECTION : //TODO: handle delete connection request from server; break; case Constants.CMD_NOTIFY : Notify event = (Notify) evt; //if there is attached handler deligate call to it if (this.requestListeners.containsKey(event.getRequestIdentifier().toString().trim())) { requestListeners.get(event.getRequestIdentifier().toString().trim()).processMgcpCommandEvent(evt); } //send response to this transaction; NotifyResponse response = new NotifyResponse(this, ReturnCode.Transaction_Executed_Normally); response.setTransactionHandle(evt.getTransactionHandle()); this.send(response); break; default : } }
@Override public void processMgcpCommandEvent(final JainMgcpCommandEvent event) { final int value = event.getObjectIdentifier(); switch (value) { case Constants.CMD_NOTIFY: { final Notify notify = (Notify) event; final String id = notify.getRequestIdentifier().toString(); final ActorRef listener; if (isPartialNotify(notify)) { listener = notificationListeners.get(id); } else { listener = notificationListeners.remove(id); } if (listener != null) { listener.tell(notify, self()); } } } }
byte[] requestBytes=evt.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;
byte[] requestBytes=evt.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;
int totalLength=2; byte[] requestIDBytes=notificationRequestParam.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestIDBytes, 0, destination, offset+totalLength, requestIDBytes.length); totalLength+=requestIDBytes.length;
int totalLength=2; byte[] requestIDBytes=notificationRequestParam.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestIDBytes, 0, destination, offset+totalLength, requestIDBytes.length); totalLength+=requestIDBytes.length;
byte[] requestBytes=evt.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;
byte[] requestBytes=evt.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;
byte[] requestBytes=response.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;
byte[] requestBytes=response.getRequestIdentifier().toString().getBytes(); System.arraycopy(requestBytes, 0, array,totalLength, requestBytes.length); totalLength+=requestBytes.length;