Class ResponseMetadata
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.api.client.ResponseMetadata
-
public final class ResponseMetadata extends Object
Immutable HTTP response metadata captured before the connection is closed.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>contentLocation()Optional<String>firstHeaderValue(String name)Map<String,List<String>>headers()List<String>headerValues(String name)List<String>links()Optional<String>preferenceApplied()Optional<URI>requestUri()Set<ResultScope>resultScopes()intstatusCode()List<String>warnings()
-
-
-
Constructor Detail
-
ResponseMetadata
public ResponseMetadata(int statusCode, Map<String,List<String>> headers, URI requestUri)Creates immutable response metadata.- Parameters:
statusCode- HTTP status codeheaders- response headers, preserving repeated valuesrequestUri- effective request URI, ornullwhen unavailable
-
-
Method Detail
-
statusCode
public int statusCode()
- Returns:
- the HTTP status code
-
headers
public Map<String,List<String>> headers()
- Returns:
- the immutable case-insensitive multi-valued header map
-
headerValues
public List<String> headerValues(String name)
- Parameters:
name- header name- Returns:
- immutable values associated with the name
-
firstHeaderValue
public Optional<String> firstHeaderValue(String name)
- Parameters:
name- header name- Returns:
- the first value, when present
-
contentLocation
public Optional<String> contentLocation()
- Returns:
- the
Content-Locationvalue, when present
-
preferenceApplied
public Optional<String> preferenceApplied()
- Returns:
- the
Preference-Appliedvalue, when present
-
resultScopes
public Set<ResultScope> resultScopes()
- Returns:
- recognized immutable
X-Result-Scopevalues
-
-