Search in sources :

Example 1 with ClientOperationEvent

use of com.alibaba.nacos.naming.core.v2.event.client.ClientOperationEvent in project nacos by alibaba.

the class ClientServiceIndexesManager method handleClientOperation.

private void handleClientOperation(ClientOperationEvent event) {
    Service service = event.getService();
    String clientId = event.getClientId();
    if (event instanceof ClientOperationEvent.ClientRegisterServiceEvent) {
        addPublisherIndexes(service, clientId);
    } else if (event instanceof ClientOperationEvent.ClientDeregisterServiceEvent) {
        removePublisherIndexes(service, clientId);
    } else if (event instanceof ClientOperationEvent.ClientSubscribeServiceEvent) {
        addSubscriberIndexes(service, clientId);
    } else if (event instanceof ClientOperationEvent.ClientUnsubscribeServiceEvent) {
        removeSubscriberIndexes(service, clientId);
    }
}
Also used : ClientOperationEvent(com.alibaba.nacos.naming.core.v2.event.client.ClientOperationEvent) Service(com.alibaba.nacos.naming.core.v2.pojo.Service)

Aggregations

ClientOperationEvent (com.alibaba.nacos.naming.core.v2.event.client.ClientOperationEvent)1 Service (com.alibaba.nacos.naming.core.v2.pojo.Service)1