Search in sources :

Example 11 with NoneSelector

use of com.alibaba.nacos.api.selector.NoneSelector in project nacos by alibaba.

the class NacosNamingMaintainServiceTest method testCreateService4.

@Test
public void testCreateService4() throws NacosException {
    // given
    Service service = new Service();
    AbstractSelector selector = new NoneSelector();
    // when
    nacosNamingMaintainService.createService(service, selector);
    // then
    verify(serverProxy, times(1)).createService(service, selector);
}
Also used : AbstractSelector(com.alibaba.nacos.api.selector.AbstractSelector) Service(com.alibaba.nacos.api.naming.pojo.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) NoneSelector(com.alibaba.nacos.api.selector.NoneSelector) Test(org.junit.Test)

Example 12 with NoneSelector

use of com.alibaba.nacos.api.selector.NoneSelector in project nacos by alibaba.

the class NacosNamingMaintainService method updateService.

@Override
public void updateService(String serviceName, String groupName, float protectThreshold, Map<String, String> metadata) throws NacosException {
    Service service = new Service();
    service.setName(serviceName);
    service.setGroupName(groupName);
    service.setProtectThreshold(protectThreshold);
    service.setMetadata(metadata);
    updateService(service, new NoneSelector());
}
Also used : NamingMaintainService(com.alibaba.nacos.api.naming.NamingMaintainService) Service(com.alibaba.nacos.api.naming.pojo.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) NoneSelector(com.alibaba.nacos.api.selector.NoneSelector)

Example 13 with NoneSelector

use of com.alibaba.nacos.api.selector.NoneSelector in project nacos by alibaba.

the class NacosNamingMaintainService method updateService.

@Override
public void updateService(String serviceName, String groupName, float protectThreshold) throws NacosException {
    Service service = new Service();
    service.setName(serviceName);
    service.setGroupName(groupName);
    service.setProtectThreshold(protectThreshold);
    updateService(service, new NoneSelector());
}
Also used : NamingMaintainService(com.alibaba.nacos.api.naming.NamingMaintainService) Service(com.alibaba.nacos.api.naming.pojo.Service) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) NoneSelector(com.alibaba.nacos.api.selector.NoneSelector)

Aggregations

NoneSelector (com.alibaba.nacos.api.selector.NoneSelector)13 Service (com.alibaba.nacos.api.naming.pojo.Service)11 Test (org.junit.Test)11 AbstractSelector (com.alibaba.nacos.api.selector.AbstractSelector)5 NamingMaintainService (com.alibaba.nacos.api.naming.NamingMaintainService)4 ServiceInfoHolder (com.alibaba.nacos.client.naming.cache.ServiceInfoHolder)4 Properties (java.util.Properties)4 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)4 ServerListManager (com.alibaba.nacos.client.naming.core.ServerListManager)3 SecurityProxy (com.alibaba.nacos.client.security.SecurityProxy)3 HttpRestResult (com.alibaba.nacos.common.http.HttpRestResult)3 NacosRestTemplate (com.alibaba.nacos.common.http.client.NacosRestTemplate)3 Field (java.lang.reflect.Field)3 NamingService (com.alibaba.nacos.api.naming.NamingService)2 NamingGrpcRedoService (com.alibaba.nacos.client.naming.remote.gprc.redo.NamingGrpcRedoService)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 NacosException (com.alibaba.nacos.api.exception.NacosException)1 ServiceListResponse (com.alibaba.nacos.api.naming.remote.response.ServiceListResponse)1 ExpressionSelector (com.alibaba.nacos.api.selector.ExpressionSelector)1 InstancesChangeNotifier (com.alibaba.nacos.client.naming.event.InstancesChangeNotifier)1