- All Implemented Interfaces:
Serializable
A service ID identifies a service.
It basically comes down to a service URI with particular constraints:
- It must be absolute (i.e. have a scheme).
- It must have an authority component when not opaque.
A service ID can be created with two kinds of service URI: when the URI is an opaque URI, the service ID is obtained from the scheme and the scheme specific part (e.g. scheme:service-name), otherwise it is obtained from the scheme and the authority (e.g. scheme://service-name).
A service URI conveys two information: the service ID and the request target. In case of a an opaque URI, the request target is specified in the fragment component
(e.g. scheme:service-name#/path/to/resource?k1=v1&k2=v2), otherwise, the resource target is specified by the path and query components
(e.g. scheme://service-name/path/to/resource?k1=v1&k2=v2).
When creating a service ID from a service URI, the request target is evicted because it doesn't identify the service.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic StringgetRequestTarget(URI uri) Returns the request target in the specified service URI.Returns the service ID scheme.getURI()Return the service ID URI.inthashCode()static ServiceIDCreates a service ID from the specified service URI.static ServiceIDCreates a service ID from the specified service URI.toString()
-
Method Details
-
getRequestTarget
Returns the request target in the specified service URI.
- Parameters:
uri- a service URI- Returns:
- a request target
- Throws:
IllegalArgumentException- if the specified URI is not a valid service URI
-
of
Creates a service ID from the specified service URI.
- Parameters:
uri- a service URI- Returns:
- a service ID
- Throws:
IllegalArgumentException- if the specified URI is not a valid service URI
-
of
Creates a service ID from the specified service URI.
- Parameters:
uri- a service URI- Returns:
- a service ID
- Throws:
IllegalArgumentException- if the specified URI is not a valid service URI
-
getScheme
Returns the service ID scheme.
- Returns:
- the service ID scheme
-
getURI
Return the service ID URI.
Note that the service ID URI doesn't contain the request target.
- Returns:
- the service ID URI
-
equals
-
hashCode
public int hashCode() -
toString
-