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

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

本文整理了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

public void setResponse(Binary initialResponse)
{
  setPending(initialResponse.asByteBuffer());
}

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

public void setResponse(Binary initialResponse)
{
  setPending(initialResponse.asByteBuffer());
}

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

public void setResponse(Binary initialResponse)
{
  setPending(initialResponse.asByteBuffer());
}

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

public void setResponse(Binary initialResponse)
{
  setPending(initialResponse.asByteBuffer());
}

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

/**
 * 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)));
}

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

@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");
  }
}

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

@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");
  }
}

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

/**
 * 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;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

@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);
  }
}

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

@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);
  }
}

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

@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());
  }
}

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

@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());
  }
}

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

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());
  }
}

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

@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);
  }
}

相关文章