org.apache.qpid.proton.amqp.Binary.asByteBuffer()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中org.apache.qpid.proton.amqp.Binary.asByteBuffer()方法的一些代码示例,展示了Binary.asByteBuffer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binary.asByteBuffer()方法的具体详情如下:
包路径:org.apache.qpid.proton.amqp.Binary
类名称:Binary
方法名:asByteBuffer

Binary.asByteBuffer介绍

暂无

代码示例

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

  1. public void setResponse(Binary initialResponse)
  2. {
  3. setPending(initialResponse.asByteBuffer());
  4. }

代码示例来源:origin: org.apache.qpid/proton

  1. public void setResponse(Binary initialResponse)
  2. {
  3. setPending(initialResponse.asByteBuffer());
  4. }

代码示例来源:origin: org.apache.qpid/proton-j

  1. public void setResponse(Binary initialResponse)
  2. {
  3. setPending(initialResponse.asByteBuffer());
  4. }

代码示例来源:origin: org.apache.qpid/proton-j-impl

  1. public void setResponse(Binary initialResponse)
  2. {
  3. setPending(initialResponse.asByteBuffer());
  4. }

代码示例来源:origin: Azure/azure-service-bus-java

  1. /**
  2. * Starts a new service side transaction. The {@link TransactionContext} should be passed to all operations that
  3. * needs to be in this transaction.
  4. * @return A <code>CompletableFuture</code> which returns a new transaction
  5. */
  6. public CompletableFuture<TransactionContext> startTransactionAsync() {
  7. return this.getController()
  8. .thenCompose(controller -> controller.declareAsync()
  9. .thenApply(binary -> new TransactionContext(binary.asByteBuffer(), this)));
  10. }

代码示例来源:origin: org.apache.qpid/qpid-jms-client

  1. @Override
  2. public byte[] getCorrelationIdBytes() throws JMSException {
  3. Object correlationId = null;
  4. if (properties != null) {
  5. correlationId = properties.getCorrelationId();
  6. }
  7. if (correlationId == null) {
  8. return null;
  9. } else if (correlationId instanceof Binary) {
  10. ByteBuffer dup = ((Binary) correlationId).asByteBuffer();
  11. byte[] bytes = new byte[dup.remaining()];
  12. dup.get(bytes);
  13. return bytes;
  14. } else {
  15. // TODO - Do we need to throw here, or could we just stringify whatever is in
  16. // there and return the UTF-8 bytes? This method is pretty useless so
  17. // maybe we just return something and let the user sort if out if they
  18. // really think they need this.
  19. throw new JMSException("The underlying correlation-id is not binary and so can't be returned");
  20. }
  21. }

代码示例来源:origin: apache/qpid-jms

  1. @Override
  2. public byte[] getCorrelationIdBytes() throws JMSException {
  3. Object correlationId = null;
  4. if (properties != null) {
  5. correlationId = properties.getCorrelationId();
  6. }
  7. if (correlationId == null) {
  8. return null;
  9. } else if (correlationId instanceof Binary) {
  10. ByteBuffer dup = ((Binary) correlationId).asByteBuffer();
  11. byte[] bytes = new byte[dup.remaining()];
  12. dup.get(bytes);
  13. return bytes;
  14. } else {
  15. // TODO - Do we need to throw here, or could we just stringify whatever is in
  16. // there and return the UTF-8 bytes? This method is pretty useless so
  17. // maybe we just return something and let the user sort if out if they
  18. // really think they need this.
  19. throw new JMSException("The underlying correlation-id is not binary and so can't be returned");
  20. }
  21. }

代码示例来源:origin: Azure/azure-iot-sdk-java

  1. /**
  2. * Returns the amqp body used in the message
  3. * @return Byte array
  4. */
  5. public byte[] getAmqpBody()
  6. {
  7. Data msgData = (Data)this.messageImpl.getBody();
  8. Binary binData = msgData.getValue();
  9. byte[] msgBody = new byte[binData.getLength()];
  10. ByteBuffer buffer = binData.asByteBuffer();
  11. buffer.get(msgBody);
  12. return msgBody;
  13. }

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

  1. @Override
  2. public void handleResponse(SaslResponse saslResponse, Binary payload, Void context)
  3. {
  4. checkRole(Role.SERVER);
  5. setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer());
  6. }

代码示例来源:origin: org.apache.qpid/proton-j-impl

  1. @Override
  2. public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context)
  3. {
  4. checkRole(Role.CLIENT);
  5. setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer());
  6. }

代码示例来源:origin: org.apache.qpid/proton

  1. public void handleResponse(SaslResponse saslResponse, Binary payload, Void context)
  2. {
  3. checkRole(Role.SERVER);
  4. setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer());
  5. }

代码示例来源:origin: org.apache.qpid/proton-j-impl

  1. @Override
  2. public void handleResponse(SaslResponse saslResponse, Binary payload, Void context)
  3. {
  4. checkRole(Role.SERVER);
  5. setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer());
  6. }

代码示例来源:origin: org.apache.qpid/proton

  1. public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context)
  2. {
  3. checkRole(Role.CLIENT);
  4. setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer());
  5. }

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

  1. @Override
  2. public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context)
  3. {
  4. checkRole(Role.CLIENT);
  5. setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer());
  6. }

代码示例来源:origin: org.apache.qpid/proton-j

  1. @Override
  2. public void handleResponse(SaslResponse saslResponse, Binary payload, Void context)
  3. {
  4. checkRole(Role.SERVER);
  5. setPending(saslResponse.getResponse() == null ? null : saslResponse.getResponse().asByteBuffer());
  6. if(_saslListener != null) {
  7. _saslListener.onSaslResponse(this, _transport);
  8. }
  9. }

代码示例来源:origin: org.apache.qpid/proton-j

  1. @Override
  2. public void handleChallenge(SaslChallenge saslChallenge, Binary payload, Void context)
  3. {
  4. checkRole(Role.CLIENT);
  5. setPending(saslChallenge.getChallenge() == null ? null : saslChallenge.getChallenge().asByteBuffer());
  6. if(_saslListener != null) {
  7. _saslListener.onSaslChallenge(this, _transport);
  8. }
  9. }

代码示例来源:origin: org.apache.qpid/proton-j-impl

  1. @Override
  2. public void handleInit(SaslInit saslInit, Binary payload, Void context)
  3. {
  4. if(_role == null)
  5. {
  6. server();
  7. }
  8. checkRole(Role.SERVER);
  9. _hostname = saslInit.getHostname();
  10. _chosenMechanism = saslInit.getMechanism();
  11. _initReceived = true;
  12. if(saslInit.getInitialResponse() != null)
  13. {
  14. setPending(saslInit.getInitialResponse().asByteBuffer());
  15. }
  16. }

代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot

  1. @Override
  2. public void handleInit(SaslInit saslInit, Binary payload, Void context)
  3. {
  4. if(_role == null)
  5. {
  6. server();
  7. }
  8. checkRole(Role.SERVER);
  9. _hostname = saslInit.getHostname();
  10. _chosenMechanism = saslInit.getMechanism();
  11. _initReceived = true;
  12. if(saslInit.getInitialResponse() != null)
  13. {
  14. setPending(saslInit.getInitialResponse().asByteBuffer());
  15. }
  16. }

代码示例来源:origin: org.apache.qpid/proton

  1. public void handleInit(SaslInit saslInit, Binary payload, Void context)
  2. {
  3. if(_role == null)
  4. {
  5. server();
  6. }
  7. checkRole(Role.SERVER);
  8. _hostname = saslInit.getHostname();
  9. _chosenMechanism = saslInit.getMechanism();
  10. _initReceived = true;
  11. if(saslInit.getInitialResponse() != null)
  12. {
  13. setPending(saslInit.getInitialResponse().asByteBuffer());
  14. }
  15. }

代码示例来源:origin: org.apache.qpid/proton-j

  1. @Override
  2. public void handleInit(SaslInit saslInit, Binary payload, Void context)
  3. {
  4. if(_role == null)
  5. {
  6. server();
  7. }
  8. checkRole(Role.SERVER);
  9. _hostname = saslInit.getHostname();
  10. _chosenMechanism = saslInit.getMechanism();
  11. _initReceived = true;
  12. if(saslInit.getInitialResponse() != null)
  13. {
  14. setPending(saslInit.getInitialResponse().asByteBuffer());
  15. }
  16. if(_saslListener != null) {
  17. _saslListener.onSaslInit(this, _transport);
  18. }
  19. }

相关文章