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 String
DEFAULT_SERVICE_ID_STRING
static String
DEFAULT_SERVICE_ID_WITH_ACTIVE_PROFILES_STRING
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
combineParts(String firstPart, String separator, String secondPart)
static String
getDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver)
static String
getDefaultInstanceId(org.springframework.core.env.PropertyResolver resolver, boolean includeHostname)
static String
getResolvedServiceId(org.springframework.core.env.PropertyResolver resolver)
Gets the resolved service id.static String
getUnresolvedServiceId()
Gets the unresolved template for the service id without active profiles.static String
getUnresolvedServiceIdWithActiveProfiles()
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.
-
-