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

com.github.sseserver.remote.RemoteConnectionService Maven / Gradle / Ivy

There is a newer version: 1.2.19
Show newest version
package com.github.sseserver.remote;

import com.github.sseserver.ConnectionQueryService;
import com.github.sseserver.SendService;
import com.github.sseserver.springboot.SseServerProperties;

import java.io.Closeable;
import java.io.Serializable;
import java.net.URL;
import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface RemoteConnectionService extends ConnectionQueryService, SendService>, Closeable {

    URL getRemoteUrl();

    @Override
    void close();

    String getId();

    RemoteCompletableFuture isOnlineAsync(Serializable userId);

     RemoteCompletableFuture getUserAsync(Serializable userId);

     RemoteCompletableFuture, RemoteConnectionService> getUsersAsync();

     RemoteCompletableFuture, RemoteConnectionService> getUsersAsync(SseServerProperties.AutoType autoType);

     RemoteCompletableFuture, RemoteConnectionService> getUsersByListeningAsync(String sseListenerName);

     RemoteCompletableFuture, RemoteConnectionService> getUsersByTenantIdListeningAsync(Serializable tenantId, String sseListenerName);

    /* getConnection */

     RemoteCompletableFuture>, RemoteConnectionService> getConnectionDTOAllAsync(SseServerProperties.AutoType autoTypeEnum);

    RemoteCompletableFuture, RemoteConnectionService> getConnectionDTOByUserIdAsync(Serializable userId);

    /* getUserIds */

     RemoteCompletableFuture, RemoteConnectionService> getUserIdsAsync(Class type);

     RemoteCompletableFuture, RemoteConnectionService> getUserIdsByListeningAsync(String sseListenerName, Class type);

     RemoteCompletableFuture, RemoteConnectionService> getUserIdsByTenantIdListeningAsync(Serializable tenantId, String sseListenerName, Class type);

    /* getAccessToken */

    RemoteCompletableFuture, RemoteConnectionService> getAccessTokensAsync();

    /* getTenantId */

     RemoteCompletableFuture, RemoteConnectionService> getTenantIdsAsync(Class type);

    /* getChannels */

    RemoteCompletableFuture, RemoteConnectionService> getChannelsAsync();

    /**
     * 获取当前连接数量
     */
    RemoteCompletableFuture getConnectionCountAsync();

    /* disconnect */

    RemoteCompletableFuture disconnectByUserId(Serializable userId);

    RemoteCompletableFuture disconnectByAccessToken(String accessToken);

    RemoteCompletableFuture disconnectByConnectionId(Long connectionId);

    RemoteCompletableFuture disconnectByConnectionId(Long connectionId, Long duration, Long sessionDuration);

    RemoteCompletableFuture disconnectByConnectionIds(Collection connectionIds);

    /**
     * 修改已统计的在线时长
     *
     * @param userId         用户ID
     * @param durationSecond 在线时长(秒)
     * @return 清空的链接
     */
    RemoteCompletableFuture setDurationByUserId(Serializable userId, long durationSecond);

    RemoteCompletableFuture setDurationByAccessToken(String accessToken, long durationSecond);

    RemoteCompletableFuture active(List> activeList);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy