/** * @return The Debug Properties */ public Properties getDebug() { final String strNull="null"; Properties p = new Properties(); p.put("MqttVersion", new Integer(getMqttVersion())); p.put("CleanSession", Boolean.valueOf(isCleanSession())); p.put("ConTimeout", new Integer(getConnectionTimeout())); p.put("KeepAliveInterval", new Integer(getKeepAliveInterval())); p.put("UserName", (getUserName() == null) ? strNull : getUserName()); p.put("WillDestination", (getWillDestination() == null) ? strNull : getWillDestination()); if (getSocketFactory()==null) { p.put("SocketFactory", strNull); } else { p.put("SocketFactory", getSocketFactory()); } if (getSSLProperties()==null) { p.put("SSLProperties", strNull); } else { p.put("SSLProperties", getSSLProperties()); } return p; }
private ContentValues getValues(Connection connection){ MqttConnectOptions conOpts = connection.getConnectionOptions(); MqttMessage lastWill = conOpts.getWillMessage(); ContentValues values = new ContentValues(); //put the column values object values.put(COLUMN_CLIENT_HANDLE, connection.handle()); values.put(COLUMN_HOST, connection.getHostName()); values.put(COLUMN_port, connection.getPort()); values.put(COLUMN_client_ID, connection.getId()); values.put(COLUMN_ssl, connection.isSSL()); values.put(COLUMN_KEEP_ALIVE, conOpts.getKeepAliveInterval()); values.put(COLUMN_TIME_OUT, conOpts.getConnectionTimeout()); values.put(COLUMN_USER_NAME, conOpts.getUserName()); values.put(COLUMN_TOPIC, conOpts.getWillDestination()); //uses "condition ? trueValue: falseValue" for in line converting of values char[] password = conOpts.getPassword(); values.put(COLUMN_CLEAN_SESSION, conOpts.isCleanSession() ? 1 : 0); //convert boolean to int and then put in values values.put(COLUMN_PASSWORD, password != null ? String.valueOf(password) : null); //convert char[] to String values.put(COLUMN_MESSAGE, lastWill != null ? new String(lastWill.getPayload()) : null); // convert byte[] to string values.put(COLUMN_QOS, lastWill != null ? lastWill.getQos() : 0); if (lastWill == null) { values.put(COLUMN_RETAINED, 0); } else { values.put(COLUMN_RETAINED, lastWill.isRetained() ? 1 : 0); //convert from boolean to int } return values; }
/** * Get the username to use for authentication with the server. * @return the value */ public String getUserName() { return options.getUserName(); }
", username: " + options.getUserName());
cleanSession = connection.getConnectionOptions().isCleanSession(); if(connection.getConnectionOptions().getUserName() == null){ username = ""; }else { username = connection.getConnectionOptions().getUserName();
assertSame(socketFactory, options.getSocketFactory()); assertSame(props, options.getSSLProperties()); assertEquals("user", options.getUserName()); assertEquals("foo", options.getWillDestination()); assertEquals("bar", new String(options.getWillMessage().getPayload()));
assertSame(socketFactory, options.getSocketFactory()); assertSame(props, options.getSSLProperties()); assertEquals("user", options.getUserName()); assertEquals("foo", options.getWillDestination()); assertEquals("bar", new String(options.getWillMessage().getPayload()));
new Integer(options.getKeepAliveInterval()), options.getUserName(), ((null == options.getPassword()) ? "[null]" : "[notnull]"), ((null == options.getWillMessage()) ? "[null]" : "[notnull]"), userContext, callback });
private String getConnectionId() { return mqttClient.getCurrentServerURI()+"/"+ connectOptions.getUserName(); }
conOptions.isCleanSession(), conOptions.getKeepAliveInterval(), conOptions.getUserName(), conOptions.getPassword(), conOptions.getWillMessage(),
public Properties getDebug() { Properties p = new Properties(); p.put("CleanSession", new Boolean(isCleanSession())); p.put("ConTimeout", new Integer(getConnectionTimeout())); p.put("KeepAliveInterval", new Integer(getKeepAliveInterval())); p.put("UserName", (getUserName()==null)?"null":getUserName()); p.put("WillDestination", (getWillDestination()==null)?"null":getWillDestination()); if (getSocketFactory()==null) { p.put("SocketFactory", "null"); } else { p.put("SocketFactory", getSocketFactory()); } if (getSSLProperties()==null) { p.put("SSLProperties", "null"); } else { p.put("SSLProperties", getSSLProperties()); } return p; }
/** * @return The Debug Properties */ public Properties getDebug() { final String strNull="null"; Properties p = new Properties(); p.put("MqttVersion", new Integer(getMqttVersion())); p.put("CleanSession", Boolean.valueOf(isCleanSession())); p.put("ConTimeout", new Integer(getConnectionTimeout())); p.put("KeepAliveInterval", new Integer(getKeepAliveInterval())); p.put("UserName", (getUserName() == null) ? strNull : getUserName()); p.put("WillDestination", (getWillDestination() == null) ? strNull : getWillDestination()); if (getSocketFactory()==null) { p.put("SocketFactory", strNull); } else { p.put("SocketFactory", getSocketFactory()); } if (getSSLProperties()==null) { p.put("SSLProperties", strNull); } else { p.put("SSLProperties", getSSLProperties()); } return p; }
/** * @return The Debug Properties */ public Properties getDebug() { final String strNull="null"; Properties p = new Properties(); p.put("MqttVersion", new Integer(getMqttVersion())); p.put("CleanSession", Boolean.valueOf(isCleanSession())); p.put("ConTimeout", new Integer(getConnectionTimeout())); p.put("KeepAliveInterval", new Integer(getKeepAliveInterval())); p.put("UserName", (getUserName() == null) ? strNull : getUserName()); p.put("WillDestination", (getWillDestination() == null) ? strNull : getWillDestination()); if (getSocketFactory()==null) { p.put("SocketFactory", strNull); } else { p.put("SocketFactory", getSocketFactory()); } if (getSSLProperties()==null) { p.put("SSLProperties", strNull); } else { p.put("SSLProperties", getSSLProperties()); } return p; }
values.put(COLUMN_USER_NAME, conOpts.getUserName()); values.put(COLUMN_TOPIC, conOpts.getWillDestination());
new Integer(options.getConnectionTimeout()), new Integer(options.getKeepAliveInterval()), options.getUserName(), ((null == options.getPassword())?"[null]":"[notnull]"), ((null == options.getWillMessage())?"[null]":"[notnull]"),
id(), options.isCleanSession(), options.getUserName(), options.getPassword() == null ? null : "*****", config.getIdleTimeout(),
new Integer(options.getKeepAliveInterval()), options.getUserName(), ((null == options.getPassword()) ? "[null]" : "[notnull]"), ((null == options.getWillMessage()) ? "[null]" : "[notnull]"), userContext, callback });
new Integer(options.getKeepAliveInterval()), options.getUserName(), ((null == options.getPassword()) ? "[null]" : "[notnull]"), ((null == options.getWillMessage()) ? "[null]" : "[notnull]"), userContext, callback });
options.isCleanSession(), options.getKeepAliveInterval(), options.getUserName(), options.getPassword(), options.getWillMessage(),
conOptions.isCleanSession(), conOptions.getKeepAliveInterval(), conOptions.getUserName(), conOptions.getPassword(), conOptions.getWillMessage(),