Class IdUtils
- java.lang.Object
-
- org.springframework.cloud.commons.util.IdUtils
-
public final class IdUtils extends Object
- Author:
- Spencer Gibb
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_SERVICE_ID_STRINGstatic StringDEFAULT_SERVICE_ID_WITH_ACTIVE_PROFILES_STRING
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcombineParts(String firstPart, String separator, String secondPart)static StringgetDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver)static StringgetDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver, boolean includeHostname)static StringgetResolvedServiceId(org.springframework.core.env.PropertyResolver resolver)Gets the resolved service id.static StringgetUnresolvedServiceId()Gets the unresolved template for the service id without active profiles.static StringgetUnresolvedServiceIdWithActiveProfiles()Gets the unresolved template for the service id including active profiles.
-
-
-
Field Detail
-
DEFAULT_SERVICE_ID_STRING
public static final String DEFAULT_SERVICE_ID_STRING
- See Also:
- Constant Field Values
-
DEFAULT_SERVICE_ID_WITH_ACTIVE_PROFILES_STRING
public static final String DEFAULT_SERVICE_ID_WITH_ACTIVE_PROFILES_STRING
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefaultInstanceId
public static String getDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver)
-
getDefaultInstanceId
public static String getDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver, boolean includeHostname)
-
getResolvedServiceId
public static String getResolvedServiceId(org.springframework.core.env.PropertyResolver resolver)
Gets the resolved service id.- Parameters:
resolver- A property resolved- Returns:
- A unique id that can be used to uniquely identify a service
-
getUnresolvedServiceId
public static String getUnresolvedServiceId()
Gets the unresolved template for the service id without active profiles.- Returns:
- The combination of properties to create a unique service id.
-
getUnresolvedServiceIdWithActiveProfiles
public static String getUnresolvedServiceIdWithActiveProfiles()
Gets the unresolved template for the service id including active profiles.- Returns:
- The combination of properties to create a unique service id.
-
-