public String getTopic() { return topic.toString(); }
public void onPublish(UTF8Buffer topic, Buffer payload, Runnable ack) { LOG.debug("Received message: topic={}, payload={}", topic.toString(), new String(payload.toByteArray())); try { this.incoming.put(new AckableMessage(topic.toString(), payload.toByteArray(), ack)); } catch (InterruptedException e) { LOG.warn("Interrupted while queueing an MQTT message."); } }
public String getHost() throws IOException { UTF8Buffer buff = (UTF8Buffer) getProperty("Host"); if( buff == null ) { return null; } return buff.toString(); }
LOG.info("MQTT ClientID: {}", client.getClientId().toString()); client.setCleanSession(options.isCleanConnection());
private Throwable createThrowable(UTF8Buffer className, UTF8Buffer message) { try { Class clazz = Class.forName(className.toString(), false, BaseDataStreamMarshaller.class.getClassLoader()); Constructor constructor = clazz.getConstructor(new Class[] {UTF8Buffer.class}); return (Throwable)constructor.newInstance(new Object[] {message.toString()}); } catch (Throwable e) { return new OpenwireException(message.toString(), className.toString()); } }
public String getHost() throws IOException { UTF8Buffer buff = (UTF8Buffer) getProperty("Host"); if( buff == null ) { return null; } return buff.toString(); }
public String getHost() throws IOException { UTF8Buffer buff = (UTF8Buffer) getProperty("Host"); if( buff == null ) { return null; } return buff.toString(); }
@Override public int compareTo(Buffer other) { // Do a char comparison.. not a byte for byte comparison. return toString().compareTo(other.toString()); }
@Override public int compareTo(Buffer other) { // Do a char comparison.. not a byte for byte comparison. return toString().compareTo(other.toString()); }
@Override public int compareTo(Buffer other) { // Do a char comparison.. not a byte for byte comparison. return toString().compareTo(other.toString()); }
public String getHost() throws IOException { UTF8Buffer buff = (UTF8Buffer) getProperty("Host"); if( buff == null ) { return null; } return buff.toString(); }
public URL getURL() throws OpenwireException { if (url == null && remoteBlobUrl != null) { try { url = new URL(remoteBlobUrl.toString()); } catch (MalformedURLException e) { throw new OpenwireException(e); } } return url; }
@Override public void onPublish(final UTF8Buffer topic, final Buffer body, final Callback<Callback<Void>> ack) { handleMessageArrived(topic.toString(), body, ack); } };
private static void loadMapIntoProperties(TypedProperties props, Map<String, Object> map) { for (Entry<String, Object> entry : map.entrySet()) { SimpleString key = new SimpleString(entry.getKey()); Object value = entry.getValue(); if (value instanceof UTF8Buffer) { value = ((UTF8Buffer) value).toString(); } TypedProperties.setObjectProperty(key, value, props); } }
public String getClientId() { if (clientId == null) { if (connect != null && connect.clientId() != null) { clientId = connect.clientId().toString(); } else { clientId = ""; } } return clientId; }
public String getClientId() { if (clientId == null) { if (connect != null && connect.clientId() != null) { clientId = connect.clientId().toString(); } else { clientId = ""; } } return clientId; }
public String getClientId() { if (clientId == null) { if (connect != null && connect.clientId() != null) { clientId = connect.clientId().toString(); } else { clientId = ""; } } return clientId; }
public String getClientId() { if (clientId == null) { if (connect != null && connect.clientId() != null) { clientId = connect.clientId().toString(); } else { clientId = ""; } } return clientId; }
public String getClientId() { if (clientId == null) { if (connect != null && connect.clientId() != null) { clientId = connect.clientId().toString(); } else { clientId = ""; } } return clientId; }
public SimpleAddress decode_destination(UTF8Buffer value) { SimpleAddress rc = destination_parser.decode_single_destination(value.toString(), Scala2Java.toScala(new Fn1<String, SimpleAddress>() { public SimpleAddress apply(String name) { return new SimpleAddress("topic", destination_parser.decode_path(name)); } })); if (rc == null && handler != null) { handler.die("Invalid mqtt destination name: " + value); } return rc; }