Class ExecutionContext.ApplicationData
- java.lang.Object
-
- com.vmware.vapi.core.ExecutionContext.ApplicationData
-
- Enclosing class:
- ExecutionContext
public static class ExecutionContext.ApplicationData extends java.lang.Object
Immutable class representing additional application specific data associated with the request for method execution represented by thisExecutionContext
.The application data format is key-value pairs of
String
s.This application data is provided by the client initiating the execution, it is then transported as is over the wire and is available for the provider-side service implementations on the server. This extra data is completely opaque for the infrastructure, in other words it is a contract between the client and the service implementation only.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACCEPT_LANGUAGE_KEY
ApplicationData
translation language preference property key.static java.lang.String
FORMAT_LOCALE_KEY
ApplicationData
formatting locale property key.static java.lang.String
TIMEZONE_KEY
ApplicationData
timezone preference property key.static java.lang.String
USER_AGENT_KEY
ApplicationData
property key for user agent.
-
Constructor Summary
Constructors Constructor Description ApplicationData()
Constructs an empty instance.ApplicationData(java.lang.String key, java.lang.String value)
Constructs an instance with a single property only.ApplicationData(java.util.Map<java.lang.String,java.lang.String> data)
Constructs an instance with the specified data as a source.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
getAllProperties()
java.lang.String
getProperty(java.lang.String key)
static ExecutionContext.ApplicationData
merge(ExecutionContext.ApplicationData source, java.lang.String key, java.lang.String value)
Merges the specifiedsource
and property into a newly createdApplicationData
instance.static ExecutionContext.ApplicationData
merge(ExecutionContext.ApplicationData source, java.util.Map<java.lang.String,java.lang.String> data)
Merges the specifiedsource
anddata
into a newly createdApplicationData
instance.
-
-
-
Field Detail
-
USER_AGENT_KEY
public static final java.lang.String USER_AGENT_KEY
ApplicationData
property key for user agent.- See Also:
- Constant Field Values
-
TIMEZONE_KEY
public static final java.lang.String TIMEZONE_KEY
ApplicationData
timezone preference property key.Optional Timezone ID from the IANA database to be used for rendering date and time values. When missing, UTC will be used.
- See Also:
- Constant Field Values
-
ACCEPT_LANGUAGE_KEY
public static final java.lang.String ACCEPT_LANGUAGE_KEY
ApplicationData
translation language preference property key.Optional parameter following the format of the HTTP 1.1 Accept-Language header (RFC 7231 section 5.3.5) used for selecting localization bundle.
When missing "en" will be used.
- See Also:
- Constant Field Values
-
FORMAT_LOCALE_KEY
public static final java.lang.String FORMAT_LOCALE_KEY
ApplicationData
formatting locale property key.Optional parameter following the format of the HTTP 1.1 Accept-Language header (RFC 7231 section 5.3.5) used for overriding the value format locale. When missing, implementations will fall back to the
accept-language
parameter.If both parameters are missing, locale neutral formatting should be applied i.e. short date to use "yyyy-MM-dd".
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApplicationData
public ApplicationData()
Constructs an empty instance.
-
ApplicationData
public ApplicationData(java.util.Map<java.lang.String,java.lang.String> data)
Constructs an instance with the specified data as a source.- Parameters:
data
- key-value entries- Throws:
java.lang.NullPointerException
- ifdata
isnull
-
ApplicationData
public ApplicationData(java.lang.String key, java.lang.String value)
Constructs an instance with a single property only.- Parameters:
key
- the key of the propertyvalue
- the value of the property
-
-
Method Detail
-
getProperty
public java.lang.String getProperty(java.lang.String key)
- Parameters:
key
- of the property- Returns:
- value for the specified
key
ornull
if it is unavailable
-
getAllProperties
public java.util.Map<java.lang.String,java.lang.String> getAllProperties()
- Returns:
- an immutable
Map
representing all the properties; cannot benull
-
merge
public static ExecutionContext.ApplicationData merge(ExecutionContext.ApplicationData source, java.util.Map<java.lang.String,java.lang.String> data)
Merges the specifiedsource
anddata
into a newly createdApplicationData
instance. Any conflicts are resolved in favor of the specifieddata
.- Parameters:
source
- the source of data; may benull
data
- a collection of properties to merge with thesource
- Returns:
- a new instance of
ApplicationData
combining the specifiedsource
anddata
- Throws:
java.lang.NullPointerException
- ifdata
isnull
-
merge
public static ExecutionContext.ApplicationData merge(ExecutionContext.ApplicationData source, java.lang.String key, java.lang.String value)
Merges the specifiedsource
and property into a newly createdApplicationData
instance. The specifiedvalue
will override the previous one, if a property with the specifiedkey
is already present in thesource
.- Parameters:
source
- the source of data; may benull
key
- the key of the property to merge with thesource
value
- the value of the property to merge with thesource
- Returns:
- a new instance of
ApplicationData
combining the specifiedsource
and property
-
-