public void setResponse(Binary initialResponse) { setPending(initialResponse.asByteBuffer()); }
public void setResponse(Binary initialResponse) { setPending(initialResponse.asByteBuffer()); }
public void setResponse(Binary initialResponse) { setPending(initialResponse.asByteBuffer()); }
public void setResponse(Binary initialResponse) { setPending(initialResponse.asByteBuffer()); }
/** * Starts a new service side transaction. The {@link TransactionContext} should be passed to all operations that * needs to be in this transaction. * @return A <code>CompletableFuture</code> which returns a new transaction */ public CompletableFuture<TransactionContext> startTransactionAsync() { return this.getController() .thenCompose(controller -> controller.declareAsync() .thenApply(binary -> new TransactionContext(binary.asByteBuffer(), this))); }
@Override public byte[] getCorrelationIdBytes() throws JMSException { Object correlationId = null; if (properties != null) { correlationId = properties.getCorrelationId(); } if (correlationId == null) { return null; } else if (correlationId instanceof Binary) { ByteBuffer dup = ((Binary) correlationId).asByteBuffer(); byte[] bytes = new byte[dup.remaining()]; dup.get(bytes); return bytes; } else { // TODO - Do we need to throw here, or could we just stringify whatever is in // there and return the UTF-8 bytes? This method is pretty useless so // maybe we just return something and let the user sort if out if they // really think they need this. throw new JMSException("The underlying correlation-id is not binary and so can't be returned"); } }
@Override public byte[] getCorrelationIdBytes() throws JMSException { Object correlationId = null; if (properties != null) { correlationId = properties.getCorrelationId(); } if (correlationId == null) { return null; } else if (correlationId instanceof Binary) { ByteBuffer dup = ((Binary) correlationId).asByteBuffer(); byte[] bytes = new byte[dup.remaining()]; dup.get(bytes); return bytes; } else { // TODO - Do we need to throw here, or could we just stringify whatever is in // there and return the UTF-8 bytes? This method is pretty useless so // maybe we just return something and let the user sort if out if they // really think they need this. throw new JMSException("The underlying correlation-id is not binary and so can't be returned"); } }
/** * Returns the amqp body used in the message * @return Byte array */ public byte[] getAmqpBody() { Data msgData = (Data)this.messageImpl.getBody(); Binary binData = msgData.getValue(); byte[] msgBody = new byte[binData.getLength()]; ByteBuffer buffer = binData.asByteBuffer(); buffer.get(msgBody); return msgBody; }
@Override public void handleResponse(SaslResponse saslResponse, Binary payload, Void context) { checkRole(Role.SERVER); setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer()); }
@Override public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context) { checkRole(Role.CLIENT); setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer()); }
public void handleResponse(SaslResponse saslResponse, Binary payload, Void context) { checkRole(Role.SERVER); setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer()); }
@Override public void handleResponse(SaslResponse saslResponse, Binary payload, Void context) { checkRole(Role.SERVER); setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer()); }
public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context) { checkRole(Role.CLIENT); setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer()); }
@Override public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context) { checkRole(Role.CLIENT); setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer()); }
@Override public void handleResponse(SaslResponse saslResponse, Binary payload, Void context) { checkRole(Role.SERVER); setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer()); if(_saslListener != null) { _saslListener.onSaslResponse(this, _transport); } }
@Override public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context) { checkRole(Role.CLIENT); setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer()); if(_saslListener != null) { _saslListener.onSaslChallenge(this, _transport); } }
@Override public void handleInit(SaslInit saslInit, Binary payload, Void context) { if(_role == null) { server(); } checkRole(Role.SERVER); _hostname = saslInit.getHostname(); _chosenMechanism = saslInit.getMechanism(); _initReceived = true; if(saslInit.getInitialResponse() != null) { setPending(saslInit.getInitialResponse().asByteBuffer()); } }
@Override public void handleInit(SaslInit saslInit, Binary payload, Void context) { if(_role == null) { server(); } checkRole(Role.SERVER); _hostname = saslInit.getHostname(); _chosenMechanism = saslInit.getMechanism(); _initReceived = true; if(saslInit.getInitialResponse() != null) { setPending(saslInit.getInitialResponse().asByteBuffer()); } }
public void handleInit(SaslInit saslInit, Binary payload, Void context) { if(_role == null) { server(); } checkRole(Role.SERVER); _hostname = saslInit.getHostname(); _chosenMechanism = saslInit.getMechanism(); _initReceived = true; if(saslInit.getInitialResponse() != null) { setPending(saslInit.getInitialResponse().asByteBuffer()); } }
@Override public void handleInit(SaslInit saslInit, Binary payload, Void context) { if(_role == null) { server(); } checkRole(Role.SERVER); _hostname = saslInit.getHostname(); _chosenMechanism = saslInit.getMechanism(); _initReceived = true; if(saslInit.getInitialResponse() != null) { setPending(saslInit.getInitialResponse().asByteBuffer()); } if(_saslListener != null) { _saslListener.onSaslInit(this, _transport); } }