private void addOptions(final ProtonClientOptions clientOptions, final String username, final String password) { addTlsTrustOptions(clientOptions); if (!Strings.isNullOrEmpty(username) && !Strings.isNullOrEmpty(password)) { clientOptions.addEnabledSaslMechanism(ProtonSaslPlainImpl.MECH_NAME); } else { addTlsKeyCertOptions(clientOptions); } }
private void addOptions(final ProtonClientOptions clientOptions, final String username, final String password) { addTlsTrustOptions(clientOptions); if (!Strings.isNullOrEmpty(username) && !Strings.isNullOrEmpty(password)) { clientOptions.addEnabledSaslMechanism(ProtonSaslPlainImpl.MECH_NAME); } else { addTlsKeyCertOptions(clientOptions); } }
private static Future<ResourceIdentifier> getResourceIdentifier(final String resource) { final Future<ResourceIdentifier> result = Future.future(); try { if (Strings.isNullOrEmpty(resource)) { result.fail(new ClientErrorException(HttpURLConnection.HTTP_NOT_FOUND, "no such node")); } else { result.complete(ResourceIdentifier.fromString(resource)); } } catch (Throwable e) { result.fail(e); } return result; }
if (Strings.isNullOrEmpty(message.getContentType()) && String.class.isInstance(prop.getValue())) { if (Strings.isNullOrEmpty(message.getContentEncoding()) && String.class.isInstance(prop.getValue())) { message.setContentEncoding((String) prop.getValue());
if (Strings.isNullOrEmpty(message.getContentType()) && String.class.isInstance(prop.getValue())) { if (Strings.isNullOrEmpty(message.getContentEncoding()) && String.class.isInstance(prop.getValue())) { message.setContentEncoding((String) prop.getValue());
if (Strings.isNullOrEmpty(getTypeName())) { result.fail(new IllegalStateException("adapter does not define a typeName")); } else if (tenantServiceClient == null) {
if (Strings.isNullOrEmpty(getTypeName())) { result.fail(new IllegalStateException("adapter does not define a typeName")); } else if (tenantServiceClient == null) {
/** * Adds JMS vendor properties defined by * <a href="https://www.oasis-open.org/committees/download.php/60574/amqp-bindmap-jms-v1.0-wd09.pdf"> AMQP JMS * Mapping 1.0</a> as AMQP 1.0 application properties to a given message. * <p> * The following vendor properties are added (if the message has a corresponding non-null value set): * <ul> * <li>{@link #JMS_VENDOR_PROPERTY_CONTENT_TYPE}</li> * <li>{@link #JMS_VENDOR_PROPERTY_CONTENT_ENCODING}</li> * </ul> * * @param msg the message to add the vendor properties to. */ public static void addJmsVendorProperties(final Message msg) { if (!Strings.isNullOrEmpty(msg.getContentType())) { MessageHelper.addProperty(msg, JMS_VENDOR_PROPERTY_CONTENT_TYPE, msg.getContentType()); } if (!Strings.isNullOrEmpty(msg.getContentEncoding())) { MessageHelper.addProperty(msg, JMS_VENDOR_PROPERTY_CONTENT_ENCODING, msg.getContentEncoding()); } }
/** * Adds JMS vendor properties defined by * <a href="https://www.oasis-open.org/committees/download.php/60574/amqp-bindmap-jms-v1.0-wd09.pdf"> AMQP JMS * Mapping 1.0</a> as AMQP 1.0 application properties to a given message. * <p> * The following vendor properties are added (if the message has a corresponding non-null value set): * <ul> * <li>{@link #JMS_VENDOR_PROPERTY_CONTENT_TYPE}</li> * <li>{@link #JMS_VENDOR_PROPERTY_CONTENT_ENCODING}</li> * </ul> * * @param msg the message to add the vendor properties to. */ public static void addJmsVendorProperties(final Message msg) { if (!Strings.isNullOrEmpty(msg.getContentType())) { MessageHelper.addProperty(msg, JMS_VENDOR_PROPERTY_CONTENT_TYPE, msg.getContentType()); } if (!Strings.isNullOrEmpty(msg.getContentEncoding())) { MessageHelper.addProperty(msg, JMS_VENDOR_PROPERTY_CONTENT_ENCODING, msg.getContentEncoding()); } }
Optional.ofNullable(properties.getAmqpHostname()).ifPresent(s -> options.setVirtualHost(s)); if (!Strings.isNullOrEmpty(properties.getUsername()) && !Strings.isNullOrEmpty(properties.getPassword())) {
if (Strings.isNullOrEmpty(message.getContentType())) {
if (Strings.isNullOrEmpty(message.getContentType())) {