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

com.github.sseserver.qos.Message Maven / Gradle / Ivy

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

import com.github.sseserver.util.SnowflakeIdWorker;

import java.io.Serializable;
import java.util.Collection;

public interface Message extends Serializable {
    int FILTER_TENANT_ID = (1 << 1);
    int FILTER_ACCESS_TOKEN = (1 << 2);
    int FILTER_USER_ID = (1 << 3);
    int FILTER_LISTENER_NAME = (1 << 4);
    int FILTER_CHANNEL = (1 << 5);

    static String newId(String type, String serverId) {
        return type + serverId + "-" + SnowflakeIdWorker.INSTANCE.nextId();
    }

    String getListenerName();

    Collection getUserIdList();

    Collection getTenantIdList();

    Collection getAccessTokenList();

    Collection getChannelList();

    Object getBody();

    String getEventName();

    String getId();

    default void setId(String id) {

    }

    int getFilters();

    default boolean isFilter(int filter) {
        return (getFilters() & filter) != 0;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy