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

x33g5p2x  于2022-01-30 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(107)

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

Symbol.valueOf介绍

暂无

代码示例

代码示例来源:origin: org.apache.activemq/activemq-osgi

/**
 * Lookup and return the correct Proton Symbol instance based on the given key.
 *
 * @param key
 *        the String value name of the Symbol to locate.
 *
 * @return the Symbol value that matches the given key.
 */
public static Symbol getSymbol(String key) {
  return Symbol.valueOf(key);
}

代码示例来源:origin: org.apache.activemq/activemq-all

/**
 * Lookup and return the correct Proton Symbol instance based on the given key.
 *
 * @param key
 *        the String value name of the Symbol to locate.
 *
 * @return the Symbol value that matches the given key.
 */
public static Symbol getSymbol(String key) {
  return Symbol.valueOf(key);
}

代码示例来源:origin: apache/activemq-artemis

/**
* Lookup and return the correct Proton Symbol instance based on the given key.
*
* @param key
*        the String value name of the Symbol to locate.
*
* @return the Symbol value that matches the given key.
*/
public static Symbol getSymbol(String key) {
 return Symbol.valueOf(key);
}

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

TerminusExpiryPolicy(String policy)
{
  _policy = Symbol.valueOf(policy);
}

代码示例来源:origin: apache/activemq-artemis

/**
* Given a message annotation name, lookup and return the value associated with
* that annotation name.  If the message annotations have not been created yet
* then this method will always return null.
*
* @param key the Symbol name that should be looked up in the message annotations.
* @return the value of the annotation if it exists, or null if not set or not accessible.
*/
public Object getDeliveryAnnotation(String key) {
 if (deliveryAnnotationsMap == null) {
   return null;
 }
 return deliveryAnnotationsMap.get(Symbol.valueOf(key));
}

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

@Override
  public void parse(ByteBuffer b, Data data)
  {
    int size = b.get() & 0xff;
    byte[] bytes = new byte[size];
    b.get(bytes);
    data.putSymbol(Symbol.valueOf(new String(bytes, ASCII)));
  }
}

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

private Object readQuotedSymbol(CharBuffer s)
{
  String str = readString(s);
  return Symbol.valueOf(str);
}

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

private Object readQuotedSymbol(CharBuffer s)
{
  String str = readString(s);
  return Symbol.valueOf(str);
}

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

@Override
  public void parse(ByteBuffer b, Data data)
  {
    int size = b.getInt();
    byte[] bytes = new byte[size];
    b.get(bytes);
    data.putSymbol(Symbol.valueOf(new String(bytes, ASCII)));
  }
}

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

@Override
  public void parse(ByteBuffer b, Data data)
  {
    int size = b.get() & 0xff;
    byte[] bytes = new byte[size];
    b.get(bytes);
    data.putSymbol(Symbol.valueOf(new String(bytes, ASCII)));
  }
}

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

@Override
  public void parse(ByteBuffer b, Data data)
  {
    int size = b.get() & 0xff;
    byte[] bytes = new byte[size];
    b.get(bytes);
    data.putSymbol(Symbol.valueOf(new String(bytes, ASCII)));
  }
}

代码示例来源:origin: apache/activemq-artemis

/**
* Perform a proper delivery annotation set on the AMQP Message based on a Symbol
* key and the target value to append to the current delivery annotations.
*
* @param key   The name of the Symbol whose value is being set.
* @param value The new value to set in the delivery annotations of this message.
*/
public void setDeliveryAnnotation(String key, Object value) {
 checkReadOnly();
 lazyCreateDeliveryAnnotations();
 deliveryAnnotationsMap.put(Symbol.valueOf(key), value);
}

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

public void plain(String username, String password)
{
  client();
  _chosenMechanism = Symbol.valueOf("PLAIN");
  byte[] usernameBytes = username.getBytes();
  byte[] passwordBytes = password.getBytes();
  byte[] data = new byte[usernameBytes.length+passwordBytes.length+2];
  System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
  System.arraycopy(passwordBytes, 0, data, 2+usernameBytes.length, passwordBytes.length);
  setChallengeResponse(new Binary(data));
}

代码示例来源:origin: apache/activemq-artemis

/**
* Perform a proper annotation set on the AMQP Message based on a Symbol key and
* the target value to append to the current annotations.
*
* @param key   The name of the Symbol whose value is being set.
* @param value The new value to set in the annotations of this message.
*/
public void setMessageAnnotation(String key, Object value) {
 checkReadOnly();
 lazyCreateMessageAnnotations();
 messageAnnotationsMap.put(Symbol.valueOf(key), value);
}

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

@Override
public void plain(String username, String password)
{
  client();
  _chosenMechanism = Symbol.valueOf("PLAIN");
  byte[] usernameBytes = username.getBytes(StandardCharsets.UTF_8);
  byte[] passwordBytes = password.getBytes(StandardCharsets.UTF_8);
  byte[] data = new byte[usernameBytes.length+passwordBytes.length+2];
  System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
  System.arraycopy(passwordBytes, 0, data, 2+usernameBytes.length, passwordBytes.length);
  setChallengeResponse(new Binary(data));
}

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

@Override
public void plain(String username, String password)
{
  client();
  _chosenMechanism = Symbol.valueOf("PLAIN");
  byte[] usernameBytes = username.getBytes();
  byte[] passwordBytes = password.getBytes();
  byte[] data = new byte[usernameBytes.length+passwordBytes.length+2];
  System.arraycopy(usernameBytes, 0, data, 1, usernameBytes.length);
  System.arraycopy(passwordBytes, 0, data, 2+usernameBytes.length, passwordBytes.length);
  setChallengeResponse(new Binary(data));
}

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

@Override
public void setContentType(String contentType)
{
  if(_properties == null)
  {
    if(contentType == null)
    {
      return;
    }
    _properties = new Properties();
  }
  _properties.setContentType(Symbol.valueOf(contentType));
}

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

@Override
public void setContentType(String contentType)
{
  if(_properties == null)
  {
    if(contentType == null)
    {
      return;
    }
    _properties = new Properties();
  }
  _properties.setContentType(Symbol.valueOf(contentType));
}

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

@Override
public void setContentType(String contentType)
{
  if(_properties == null)
  {
    if(contentType == null)
    {
      return;
    }
    _properties = new Properties();
  }
  _properties.setContentType(Symbol.valueOf(contentType));
}

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

public void processRemoteOpen(Endpoint endpoint, Task onComplete) {
  ErrorCondition condition = endpoint.getCondition();
  condition.setCondition(Symbol.valueOf("error"));
  condition.setDescription("Not supported");
  endpoint.close();
  onComplete.run();
}

相关文章