public class NamingUtils extends Object
| 构造器和说明 |
|---|
NamingUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
checkInstanceIsLegal(Instance instance)
Check instance param about keep alive.
|
static void |
checkServiceNameFormat(String combineServiceName)
check combineServiceName format. the serviceName can't be blank.
|
static String |
getGroupedName(String serviceName,
String groupName)
Returns a combined string with serviceName and groupName. serviceName can not be nil.
|
static String |
getGroupedNameOptional(String serviceName,
String groupName)
Returns a combined string with serviceName and groupName.
|
static String |
getGroupName(String serviceNameWithGroup) |
static String |
getServiceName(String serviceNameWithGroup) |
public static String getGroupedName(String serviceName, String groupName)
In most cases, serviceName can not be nil. In other cases, for search or anything, See getGroupedNameOptional(String, String)
etc:
serviceName | groupName | result
serviceA | groupA | groupA@@serviceA
nil | groupA | threw IllegalArgumentException
public static void checkServiceNameFormat(String combineServiceName)
serviceName = "@@"; the length = 0; illegal serviceName = "group@@"; the length = 1; illegal serviceName = "@@serviceName"; the length = 2; illegal serviceName = "group@@serviceName"; the length = 2; legal
combineServiceName - such as: groupName@@serviceNamepublic static String getGroupedNameOptional(String serviceName, String groupName)
This method works similar with getGroupedName(java.lang.String, java.lang.String) But not
verify any parameters.
serviceName | groupName | result
serviceA | groupA | groupA@@serviceA
nil | groupA | groupA@@
nil | nil | @@
public static void checkInstanceIsLegal(Instance instance) throws NacosException
Check instance param about keep alive.
heart beat timeout must > heart beat interval ip delete timeout must > heart beat interval
instance - need checked instanceNacosException - if check failed, throw exceptionCopyright © 2018–2021 Alibaba Group. All rights reserved.