All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.servicebus.IMessageSessionEntity Maven / Gradle / Ivy

Go to download

Java library for Azure Service Bus. Please note, a newer package com.azure:azure-messaging-servicebus for Azure Service Bus is available as of December 2020. While this package will continue to receive critical bug fixes, we strongly encourage you to upgrade. Read the migration guide at https://aka.ms/azsdk/java/migrate/sb for more details.

There is a newer version: 3.6.7
Show newest version
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package com.microsoft.azure.servicebus;

import java.time.Instant;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;

import com.microsoft.azure.servicebus.primitives.ServiceBusException;

/**
 * Represents a session full client entity.
 */
public interface IMessageSessionEntity {
//	int getSessionPrefetchCount();
//	
//	void setSessionPrefetchCount(int prefetchCount);
//
//    IMessageSession acceptMessageSession() throws InterruptedException, ServiceBusException;
//
//    IMessageSession acceptMessageSession(Duration serverWaitTime) throws InterruptedException, ServiceBusException;
//
//    IMessageSession acceptMessageSession(String sessionId) throws InterruptedException, ServiceBusException;
//
//    IMessageSession acceptMessageSession(String sessionId, Duration serverWaitTime) throws InterruptedException, ServiceBusException;
//
//    CompletableFuture acceptMessageSessionAsync();
//
//    CompletableFuture acceptMessageSessionAsync(Duration serverWaitTime);
//
//    CompletableFuture acceptMessageSessionAsync(String sessionId);
//
//    CompletableFuture acceptMessageSessionAsync(String sessionId, Duration serverWaitTime);

    /**
     * Gets the message sessions, enabling you to browse sessions on queues.
     *
     * @return A collection of sessions.
     * @throws InterruptedException if the current thread was interrupted while waiting.
     * @throws ServiceBusException  if get sessions failed.
     */
    Collection getMessageSessions() throws InterruptedException, ServiceBusException;

    /**
     * Retrieves all message sessions whose session state was updated since lastUpdatedTime.
     *
     * @param lastUpdatedTime The time the session was last updated.
     * @return A collection of sessions.
     * @throws InterruptedException if the current thread was interrupted while waiting.
     * @throws ServiceBusException  if get sessions failed.
     */
    Collection getMessageSessions(Instant lastUpdatedTime) throws InterruptedException, ServiceBusException;

    /**
     * Asynchronously gets the message sessions, enabling you to browse sessions on queues.
     *
     * @return a CompletableFuture representing the pending operation to get sessions.
     * @see IMessageSessionEntity#getMessageSessions
     */
    CompletableFuture> getMessageSessionsAsync();

    /**
     * Asynchronously retrieves all message sessions whose session state was updated since lastUpdatedTime.
     *
     * @param lastUpdatedTime The time the session was last updated.
     * @return a CompletableFuture representing the pending operation to get sessions.
     * @see IMessageSessionEntity#getMessageSessions(Instant)
     */
    CompletableFuture> getMessageSessionsAsync(Instant lastUpdatedTime);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy