接口 InstanceOperator
-
- 所有已知实现类:
InstanceOperatorClientImpl
public interface InstanceOperatorInstance operator.- 作者:
- xiweng.yy
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 java.util.List<java.lang.String>batchDeleteMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata)Batch delete metadata of instances.java.util.List<java.lang.String>batchUpdateMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata)Batch update metadata of instances.longgetHeartBeatInterval(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster)Get heart beat interval for specified instance.com.alibaba.nacos.api.naming.pojo.InstancegetInstance(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String cluster, java.lang.String ip, int port)Get instance detail information.inthandleBeat(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster, RsInfo clientBeat, BeatInfoInstanceBuilder builder)Handle beat request.java.util.List<? extends com.alibaba.nacos.api.naming.pojo.Instance>listAllInstances(java.lang.String namespaceId, java.lang.String serviceName)List all instances whatever status they are.com.alibaba.nacos.api.naming.pojo.ServiceInfolistInstance(java.lang.String namespaceId, java.lang.String serviceName, Subscriber subscriber, java.lang.String cluster, boolean healthOnly)Get all instance of input service.voidpatchInstance(java.lang.String namespaceId, java.lang.String serviceName, InstancePatchObject patchObject)Patch update instance information.voidregisterInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)Register an instance to a service in AP mode.voidremoveInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)Remove instance from service.voidupdateInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance)Update instance information.
-
-
-
方法详细资料
-
registerInstance
void registerInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance) throws com.alibaba.nacos.api.exception.NacosExceptionRegister an instance to a service in AP mode.- 参数:
namespaceId- id of namespaceserviceName- grouped service name group@@serviceinstance- instance to register- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when register failed
-
removeInstance
void removeInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance) throws com.alibaba.nacos.api.exception.NacosExceptionRemove instance from service.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceinstance- instance- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when remove failed
-
updateInstance
void updateInstance(java.lang.String namespaceId, java.lang.String serviceName, com.alibaba.nacos.api.naming.pojo.Instance instance) throws com.alibaba.nacos.api.exception.NacosExceptionUpdate instance information. Due to the basic information can't be changed, so this update should only update metadata.Update API will replace the whole metadata with new input instance.
- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceinstance- instance- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when update failed
-
patchInstance
void patchInstance(java.lang.String namespaceId, java.lang.String serviceName, InstancePatchObject patchObject) throws com.alibaba.nacos.api.exception.NacosExceptionPatch update instance information. Due to the basic information can't be changed, so this update should only update metadata.Patch update will only update variables in requests, the others will keep original value.
- 参数:
namespaceId- namespaceserviceName- grouped service name group@@servicepatchObject- objects need to be patch- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when update failed
-
listInstance
com.alibaba.nacos.api.naming.pojo.ServiceInfo listInstance(java.lang.String namespaceId, java.lang.String serviceName, Subscriber subscriber, java.lang.String cluster, boolean healthOnly) throws java.lang.ExceptionGet all instance of input service.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@servicesubscriber- subscriber infocluster- cluster of instanceshealthOnly- whether only return health instances- 返回:
- service info
- 抛出:
java.lang.Exception- exception when list instance failed
-
getInstance
com.alibaba.nacos.api.naming.pojo.Instance getInstance(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String cluster, java.lang.String ip, int port) throws com.alibaba.nacos.api.exception.NacosExceptionGet instance detail information.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@servicecluster- cluster of instanceip- ip of instanceport- port of instance- 返回:
- instance info
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception during query
-
handleBeat
int handleBeat(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster, RsInfo clientBeat, BeatInfoInstanceBuilder builder) throws com.alibaba.nacos.api.exception.NacosExceptionHandle beat request.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceip- ip of instanceport- port of instancecluster- cluster of instanceclientBeat- client beat infobuilder- client beat instance builder, will be used when current instance is not exist and clientBeat exist- 返回:
- result code
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception when service non-exist and client beat info is null
-
getHeartBeatInterval
long getHeartBeatInterval(java.lang.String namespaceId, java.lang.String serviceName, java.lang.String ip, int port, java.lang.String cluster)Get heart beat interval for specified instance.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@serviceip- ip of instanceport- port of instancecluster- cluster of instance- 返回:
- heart beat interval
-
listAllInstances
java.util.List<? extends com.alibaba.nacos.api.naming.pojo.Instance> listAllInstances(java.lang.String namespaceId, java.lang.String serviceName) throws com.alibaba.nacos.api.exception.NacosExceptionList all instances whatever status they are.- 参数:
namespaceId- namespaceserviceName- grouped service name group@@service- 返回:
- all instances
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception during query
-
batchUpdateMetadata
java.util.List<java.lang.String> batchUpdateMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata) throws com.alibaba.nacos.api.exception.NacosExceptionBatch update metadata of instances.- 参数:
namespaceId- namespace Id of instancesinstanceOperationInfo- instance operation infometadata- updated metadata- 返回:
- updated instance
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception during update
-
batchDeleteMetadata
java.util.List<java.lang.String> batchDeleteMetadata(java.lang.String namespaceId, InstanceOperationInfo instanceOperationInfo, java.util.Map<java.lang.String,java.lang.String> metadata) throws com.alibaba.nacos.api.exception.NacosExceptionBatch delete metadata of instances.- 参数:
namespaceId- namespace Id of instancesinstanceOperationInfo- instance operation infometadata- delete metadata- 返回:
- updated instance
- 抛出:
com.alibaba.nacos.api.exception.NacosException- nacos exception during update
-
-