Resource Identifiers offer a common encoding for wrapping existing unique identifiers with some additional context that can be useful when storing those identifiers in other applications. Additionally, the context can be used to disambiguate application-unique, but not globally-unique, identifiers when used in a common space.
This project provides a basic utility class (
ResourceIdentifier) to create and verify new identifier
strings that follow the specified format, and, parse existing identifier strings into component parts.
Resource Identifiers contain 4 components, prefixed by a format identifier
ri and separated with periods:
- Service: a string that represents the service (or application) that namespaces the rest of the
identifier. Must conform with regex pattern
- Instance: an optionally empty string that represents a specific service cluster, to allow
disambiguation of artifacts from different service clusters. Must conform to regex pattern
- Type: a service-specific resource type to namespace a group of locators. Must conform to regex
- Locator: a string used to uniquely locate the specific resource. Must conform to regex pattern
This project is made available under the Apache 2.0 License.