com.microsoft.azure.eventhubs.impl.ManagementChannel Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.azure.eventhubs.impl;
import com.microsoft.azure.eventhubs.OperationCancelledException;
import com.microsoft.azure.eventhubs.TimeoutException;
import org.apache.qpid.proton.Proton;
import org.apache.qpid.proton.amqp.messaging.AmqpValue;
import org.apache.qpid.proton.amqp.messaging.ApplicationProperties;
import org.apache.qpid.proton.message.Message;
import java.io.IOException;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
final class ManagementChannel {
final FaultTolerantObject innerChannel;
ManagementChannel(final SessionProvider sessionProvider, final AmqpConnection connection, final String clientId, final ScheduledExecutorService executor) {
final RequestResponseCloser closer = new RequestResponseCloser();
this.innerChannel = new FaultTolerantObject<>(
new RequestResponseOpener(
sessionProvider,
clientId,
"mgmt-session",
"mgmt",
ClientConstants.MANAGEMENT_ADDRESS,
connection,
executor),
closer);
closer.setInnerChannel(this.innerChannel);
}
public CompletableFuture