private String getHostName() { String hostname = this.config.getGatewayHostname(); if (hostname == null || hostname.isEmpty()) { hostname = this.config.getIotHubHostname(); } return hostname; } }
private String chooseHostname() { String gatewayHostname = this.deviceClientConfig.getGatewayHostname(); if (gatewayHostname != null && !gatewayHostname.isEmpty()) { return gatewayHostname; } return this.deviceClientConfig.getIotHubHostname(); }
if (config.getIotHubHostname() == null || config.getIotHubHostname().length() == 0)
if (config.getIotHubHostname() == null || config.getIotHubHostname().length() == 0)
public static String buildExceptionMessage(String baseMessage, Collection<InternalClient> clients) { String hostname = ""; String protocol = ""; Collection<String> deviceIds = new ArrayList<>(); Collection<String> moduleIds = new ArrayList<>(); for (InternalClient client : clients) { hostname = client.getConfig().getIotHubHostname(); protocol = client.getConfig().getProtocol().toString(); deviceIds.add(client.getConfig().getDeviceId()); if (client.getConfig().getModuleId() != null && !client.getConfig().getModuleId().isEmpty()) { moduleIds.add(client.getConfig().getModuleId()); } } return buildExceptionMessage( baseMessage, deviceIds, protocol, hostname, moduleIds); }
public static String buildExceptionMessage(String baseMessage, InternalClient client) { if (client == null || client.getConfig() == null) { throw new IllegalArgumentException("client and config must not be null"); } return buildExceptionMessage( baseMessage, client.getConfig().getDeviceId(), client.getConfig().getProtocol().toString(), client.getConfig().getIotHubHostname(), client.getConfig().getModuleId()); }
public CorrelationDetailsLoggingAssert(InternalClient internalClient) { this(internalClient.getConfig().getIotHubHostname(), internalClient.getConfig().getDeviceId(), internalClient.getConfig().getProtocol().toString(), internalClient.getConfig().getModuleId()); }
if (host == null || host.isEmpty()) host = deviceClientConfig.getIotHubHostname();
public SendMessagesTestInstance(InternalClient client, IotHubClientProtocol protocol, BaseDevice identity, AuthenticationType authenticationType, ClientType clientType, String publicKeyCert, String privateKey, String x509Thumbprint) { this.client = client; this.protocol = protocol; this.identity = identity; this.authenticationType = authenticationType; this.clientType = clientType; this.publicKeyCert = publicKeyCert; this.privateKey = privateKey; this.x509Thumbprint = x509Thumbprint; String deviceId = ""; String moduleId = ""; if (identity instanceof Module) { deviceId = identity.getDeviceId(); moduleId = ((Module) identity).getId(); } else if (identity instanceof Device) { deviceId = identity.getDeviceId(); } this.correlationDetailsLoggingAssert = new CorrelationDetailsLoggingAssert(this.client.getConfig().getIotHubHostname(), deviceId, protocol.toString(), moduleId); } }
this.iotHubUserName = this.config.getIotHubHostname() + "/" + clientId + "/" + API_VERSION + "&" + clientUserAgentIdentifier; host = this.config.getIotHubHostname();