congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
QoS.valueOf
Code IndexAdd Tabnine to your IDE (free)

How to use
valueOf
method
in
org.fusesource.mqtt.client.QoS

Best Java code snippets using org.fusesource.mqtt.client.QoS.valueOf (Showing top 9 results out of 315)

origin: org.apache.activemq/activemq-all

protected void restoreDurableSubs(List<SubscriptionInfo> subs) {
  try {
    for (SubscriptionInfo sub : subs) {
      String name = sub.getSubcriptionName();
      String[] split = name.split(":", 2);
      QoS qoS = QoS.valueOf(split[0]);
      onSubscribe(new Topic(split[1], qoS));
      // mark this durable subscription as restored by Broker
      restoredDurableSubs.add(MQTTProtocolSupport.convertMQTTToActiveMQ(split[1]));
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT durable subs.", e);
  }
}
origin: org.apache.activemq/activemq-mqtt

protected void restoreDurableSubs(List<SubscriptionInfo> subs) {
  try {
    for (SubscriptionInfo sub : subs) {
      String name = sub.getSubcriptionName();
      String[] split = name.split(":", 2);
      QoS qoS = QoS.valueOf(split[0]);
      onSubscribe(new Topic(split[1], qoS));
      // mark this durable subscription as restored by Broker
      restoredDurableSubs.add(MQTTProtocolSupport.convertMQTTToActiveMQ(split[1]));
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT durable subs.", e);
  }
}
origin: org.apache.activemq/activemq-osgi

protected void restoreDurableSubs(List<SubscriptionInfo> subs) {
  try {
    for (SubscriptionInfo sub : subs) {
      String name = sub.getSubcriptionName();
      String[] split = name.split(":", 2);
      QoS qoS = QoS.valueOf(split[0]);
      onSubscribe(new Topic(split[1], qoS));
      // mark this durable subscription as restored by Broker
      restoredDurableSubs.add(MQTTProtocolSupport.convertMQTTToActiveMQ(split[1]));
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT durable subs.", e);
  }
}
origin: PerfCake/PerfCake

@Override
public Serializable doSend(Message message, MeasurementUnit measurementUnit) throws Exception {
 String response = null;
 mqttConnection.publish(topicName, message.getPayload().toString().getBytes(Utils.getDefaultEncoding()), QoS.valueOf(qos.toUpperCase()), false);
 if (isResponseExpected) {
   mqttResponse = mqttResponseConnection.receive();
   if (mqttResponse != null) {
    response = new String(mqttResponse.getPayload(), Utils.getDefaultEncoding());
   }
 }
 return response;
}
origin: org.apache.activemq/activemq-all

private void restoreDurableQueue(List<ActiveMQQueue> queues) {
  try {
    for (ActiveMQQueue queue : queues) {
      String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length());
      StringTokenizer tokenizer = new StringTokenizer(name);
      tokenizer.nextToken(":.");
      String qosString = tokenizer.nextToken();
      tokenizer.nextToken();
      String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1));
      QoS qoS = QoS.valueOf(qosString);
      LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS);
      ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId());
      consumerInfo.setDestination(queue);
      consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH);
      if (protocol.getActiveMQSubscriptionPrefetch() > 0) {
        consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch());
      }
      consumerInfo.setRetroactive(true);
      consumerInfo.setDispatchAsync(true);
      doSubscribe(consumerInfo, topicName, qoS);
      // mark this durable subscription as restored by Broker
      restoredQueues.add(queue);
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT queue subscriptions.", e);
  }
}
origin: org.apache.activemq/activemq-mqtt

private void restoreDurableQueue(List<ActiveMQQueue> queues) {
  try {
    for (ActiveMQQueue queue : queues) {
      String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length());
      StringTokenizer tokenizer = new StringTokenizer(name);
      tokenizer.nextToken(":.");
      String qosString = tokenizer.nextToken();
      tokenizer.nextToken();
      String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1));
      QoS qoS = QoS.valueOf(qosString);
      LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS);
      ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId());
      consumerInfo.setDestination(queue);
      consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH);
      if (protocol.getActiveMQSubscriptionPrefetch() > 0) {
        consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch());
      }
      consumerInfo.setRetroactive(true);
      consumerInfo.setDispatchAsync(true);
      doSubscribe(consumerInfo, topicName, qoS);
      // mark this durable subscription as restored by Broker
      restoredQueues.add(queue);
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT queue subscriptions.", e);
  }
}
origin: org.apache.activemq/activemq-osgi

private void restoreDurableQueue(List<ActiveMQQueue> queues) {
  try {
    for (ActiveMQQueue queue : queues) {
      String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length());
      StringTokenizer tokenizer = new StringTokenizer(name);
      tokenizer.nextToken(":.");
      String qosString = tokenizer.nextToken();
      tokenizer.nextToken();
      String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1));
      QoS qoS = QoS.valueOf(qosString);
      LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS);
      ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId());
      consumerInfo.setDestination(queue);
      consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH);
      if (protocol.getActiveMQSubscriptionPrefetch() > 0) {
        consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch());
      }
      consumerInfo.setRetroactive(true);
      consumerInfo.setDispatchAsync(true);
      doSubscribe(consumerInfo, topicName, qoS);
      // mark this durable subscription as restored by Broker
      restoredQueues.add(queue);
    }
  } catch (IOException e) {
    LOG.warn("Could not restore the MQTT queue subscriptions.", e);
  }
}
origin: PerfCake/PerfCake

 mqttResponseConnection = mqttConnection;
final Topic[] responseTopic = { new Topic(responseTopicName, QoS.valueOf(responseQos)) };
mqttResponseConnection.subscribe(responseTopic);
origin: apache/activemq-artemis

connection.connect();
connection.publish(topic, topic.getBytes(), QoS.EXACTLY_ONCE, true);
connection.subscribe(new Topic[]{new Topic(topic, QoS.valueOf(topic))});
org.fusesource.mqtt.clientQoSvalueOf

Popular methods of QoS

  • ordinal
  • values
  • compareTo
  • equals
  • hashCode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Table (org.hibernate.mapping)
    A relational table
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now