Package com.nimbusds.common.jsonrpc2
Class Banner
java.lang.Object
com.nimbusds.common.jsonrpc2.Banner
Welcome banner for Connect2id JSON-RPC 2.0 services.
Example output:
Use HTTP POST to submit your JSON-RPC 2.0 request Web service: LdapAuth, version 3.0.1 (2014-02-20) Vendor: Connect2id Ltd., https://connect2id.com Supported JSON-RPC 2.0 requests: * user.auth * user.get * ws.getName * ws.getTime * ws.getVersion
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(jakarta.servlet.http.HttpServletResponse httpResponse) Applies this banner to the specified HTTP servlet response.static String
composeMessage
(String wsName, String wsVersion, String[] methods) Composes a banner message.String[]
Gets the handled JSON-RPC 2.0 methods.Gets the web service name.Gets the web service version and build date.
-
Constructor Details
-
Banner
Creates a new welcome banner for a Connect2id JSON-RPC 2.0 service.- Parameters:
wsName
- The web service name. Must not benull
.wsVersion
- The web service version and build date. Must not benull
.methods
- The handled methods. Must not benull
.
-
-
Method Details
-
getWsName
Gets the web service name.- Returns:
- The web service name.
-
getWsVersion
Gets the web service version and build date.- Returns:
- The web service version and build date.
-
getHandledJSONRPC2Methods
Gets the handled JSON-RPC 2.0 methods.- Returns:
- The handled JSON-RPC 2.0 methods, sorted.
-
composeMessage
Composes a banner message.- Parameters:
wsName
- The web service name. Must not benull
.wsVersion
- The web service version and build date. Must not benull
.methods
- The handled methods. Must not benull
.- Returns:
- The banner message.
-
apply
Applies this banner to the specified HTTP servlet response.Appends a "X-Web-Service" HTTP header set to
getWsName()
.Sets the "Content-Type" HTTP header to "text/plain;charset=utf-8".
Prints a message with the following format:
Use HTTP POST to submit your JSON-RPC 2.0 request Web service: [ws-name], [ws-version] Vendor: Connect2id Ltd., https://connect2id.com Supported JSON-RPC 2.0 requests: * [method-1] * [method-2] * [method-x]
- Parameters:
httpResponse
- The HTTP servlet response.- Throws:
IOException
- If an I/O exception was encountered.
-