public static class RedirectUri.Builder extends Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
RedirectUri |
build() |
RedirectUri.Builder |
copy(RedirectUri model) |
RedirectUri.Builder |
host(String host)
The valid domain name (hostname) or IP address to use in the redirect URI.
|
RedirectUri.Builder |
path(String path)
The HTTP URI path to use in the redirect URI.
|
RedirectUri.Builder |
port(Integer port)
The communication port to use in the redirect URI.
|
RedirectUri.Builder |
protocol(String protocol)
The HTTP protocol to use in the redirect URI.
|
RedirectUri.Builder |
query(String query)
The query string to use in the redirect URI.
|
public RedirectUri.Builder protocol(String protocol)
The HTTP protocol to use in the redirect URI.
When this value is null, not set, or set to {protocol}
, the service preserves
the original protocol from the incoming HTTP request URI. Allowed values are:
HTTP * HTTPS * {protocol}
{protocol}
is the only valid token for this property. It can appear only once
in the value string.
Example: HTTPS
protocol
- the value to setpublic RedirectUri.Builder host(String host)
The valid domain name (hostname) or IP address to use in the redirect URI.
When this value is null, not set, or set to {host}
, the service preserves the
original domain name from the incoming HTTP request URI.
All RedirectUri tokens are valid for this property. You can use any token more than once.
Curly braces are valid in this property only to surround tokens, such as {host}
Examples:
**example.com** appears as example.com
in the redirect URI.
**in{host}** appears as inexample.com
in the redirect URI if example.com
is the hostname in the incoming HTTP request URI.
**{port}{host}** appears as 8081example.com
in the redirect URI if example.com
is the hostname and the port is 8081
in the incoming HTTP request
URI.
host
- the value to setpublic RedirectUri.Builder port(Integer port)
The communication port to use in the redirect URI.
Valid values include integers from 1 to 65535.
When this value is null, the service preserves the original port from the incoming HTTP request URI.
Example: 8081
port
- the value to setpublic RedirectUri.Builder path(String path)
The HTTP URI path to use in the redirect URI.
When this value is null, not set, or set to {path}
, the service preserves the
original path from the incoming HTTP request URI. To omit the path from the redirect URI,
set this value to an empty string, "".
All RedirectUri tokens are valid for this property. You can use any token more than once.
The path string must begin with /
if it does not begin with the {path}
token.
Examples:
__/example/video/123__ appears as /example/video/123
in the redirect URI.
__/example{path}__ appears as /example/video/123
in the redirect URI if /video/123
is the path in the incoming HTTP request URI.
__{path}/123__ appears as /example/video/123
in the redirect URI if /example/video
is the path in the incoming HTTP request URI.
__{path}123__ appears as /example/video123
in the redirect URI if /example/video
is the path in the incoming HTTP request URI.
__/{host}/123__ appears as /example.com/123
in the redirect URI if example.com
is the hostname in the incoming HTTP request URI.
__/{host}/{port}__ appears as /example.com/123
in the redirect URI if example.com
is the hostname and 123
is the port in the incoming HTTP request
URI.
__/{query}__ appears as /lang=en
in the redirect URI if the query is lang=en
in the incoming HTTP request URI.
path
- the value to setpublic RedirectUri.Builder query(String query)
The query string to use in the redirect URI.
When this value is null, not set, or set to {query}
, the service preserves the
original query parameters from the incoming HTTP request URI.
All RedirectUri
tokens are valid for this property. You can use any token more
than once.
If the query string does not begin with the {query}
token, it must begin with
the question mark (?) character.
You can specify multiple query parameters as a single string. Separate each query parameter with an ampersand (&) character. To omit all incoming query parameters from the redirect URI, set this value to an empty string, "".
If the specified query string results in a redirect URI ending with ?
or
&
, the last character is truncated. For example, if the incoming URI is http://host.com:8080/documents
and the query property value is ?lang=en&{query}
,
the redirect URI is http://host.com:8080/documents?lang=en
. The system truncates
the final ampersand (&) because the incoming URI included no value to replace the {query}
token.
Examples: * **lang=en&time_zone=PST** appears as lang=en&time_zone=PST
in the
redirect URI.
**{query}** appears as lang=en&time_zone=PST
in the redirect URI if lang=en&time_zone=PST
is the query string in the incoming HTTP request. If the incoming
HTTP request has no query parameters, the {query}
token renders as an empty
string.
**lang=en&{query}&time_zone=PST** appears as lang=en&country=us&time_zone=PST
in the redirect URI if country=us
is the query string in the incoming HTTP
request. If the incoming HTTP request has no query parameters, this value renders as
lang=en&time_zone=PST
.
**protocol={protocol}&hostname={host}** appears as protocol=http&hostname=example.com
in the redirect URI if the protocol is HTTP
and the hostname is example.com
in the incoming HTTP request.
**port={port}&hostname={host}** appears as port=8080&hostname=example.com
in
the redirect URI if the port is 8080
and the hostname is example.com
in
the incoming HTTP request URI.
query
- the value to setpublic RedirectUri build()
public RedirectUri.Builder copy(RedirectUri model)
Copyright © 2016–2024. All rights reserved.