|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.splunk.HttpService
public class HttpService
The HttpService
class represents a generic HTTP service at a given
address (host:port
), accessed using a given protocol scheme
(http
or https
).
Field Summary | |
---|---|
protected java.lang.String |
host
The host name of the service. |
protected java.net.URLStreamHandler |
httpsHandler
A variable to hold an optional custom HTTPS handler |
protected int |
port
The port number of the service. |
protected java.lang.String |
scheme
The scheme used to access the service. |
protected static SSLSecurityProtocol |
sslSecurityProtocol
|
Constructor Summary | |
---|---|
HttpService()
Constructs a new HttpService instance. |
|
HttpService(java.lang.String host)
Constructs a new HttpService instance at the given host. |
|
HttpService(java.lang.String host,
int port)
Constructs a new HttpService instance at the given host and port. |
|
HttpService(java.lang.String host,
int port,
java.lang.String scheme)
Constructs a new HttpService instance using the given host,
port, and scheme. |
|
HttpService(java.lang.String host,
int port,
java.lang.String scheme,
java.net.URLStreamHandler httpsHandler)
Constructs a new HttpService instance using the given host,
port, and scheme, and instructing it to use the specified HTTPS handler. |
Method Summary | |
---|---|
static javax.net.ssl.SSLSocketFactory |
createSSLFactory()
|
ResponseMessage |
delete(java.lang.String path)
Issues a DELETE request against the service using a given path. |
ResponseMessage |
delete(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues a DELETE request against the service using a given path and query arguments. |
ResponseMessage |
get(java.lang.String path)
Issues an HTTP GET request against the service using a given path. |
ResponseMessage |
get(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues an HTTP GET request against the service using a given path and query arguments. |
java.lang.String |
getHost()
Returns the host name of this service. |
int |
getPort()
Returns the port number of this service. |
java.lang.String |
getPrefix()
Returns the URL prefix of this service, consisting of scheme://host[:port] . |
java.lang.String |
getScheme()
Returns the scheme used by this service. |
static SSLSecurityProtocol |
getSslSecurityProtocol()
Returns the SSL security protocol of this service. |
static javax.net.ssl.SSLSocketFactory |
getSSLSocketFactory()
|
java.net.URL |
getUrl(java.lang.String path)
Constructs a fully-qualified URL for this service using a given path. |
ResponseMessage |
post(java.lang.String path)
Issues a POST request against the service using a given path. |
ResponseMessage |
post(java.lang.String path,
java.util.Map<java.lang.String,java.lang.Object> args)
Issues a POST request against the service using a given path and form arguments. |
ResponseMessage |
send(java.lang.String path,
RequestMessage request)
Issue an HTTP request against the service using a given path and request message. |
static void |
setSslSecurityProtocol(SSLSecurityProtocol securityProtocol)
Sets the SSL security protocol of this service. |
static void |
setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static SSLSecurityProtocol sslSecurityProtocol
protected java.net.URLStreamHandler httpsHandler
protected java.lang.String scheme
protected java.lang.String host
protected int port
Constructor Detail |
---|
public HttpService()
HttpService
instance.
public HttpService(java.lang.String host)
HttpService
instance at the given host.
host
- The host name of the service.public HttpService(java.lang.String host, int port)
HttpService
instance at the given host and port.
host
- The host name of the service.port
- The port number of the service.public HttpService(java.lang.String host, int port, java.lang.String scheme)
HttpService
instance using the given host,
port, and scheme.
host
- The host name of the service.port
- The port number of the service.scheme
- Scheme for accessing the service (http
or
https
).public HttpService(java.lang.String host, int port, java.lang.String scheme, java.net.URLStreamHandler httpsHandler)
HttpService
instance using the given host,
port, and scheme, and instructing it to use the specified HTTPS handler.
host
- The host name of the service.port
- The port number of the service.scheme
- Scheme for accessing the service (http
or
https
).httpsHandler
- A custom URL Stream handler.Method Detail |
---|
public ResponseMessage get(java.lang.String path)
path
- The request path.
public ResponseMessage get(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The query arguments.
public java.lang.String getHost()
public int getPort()
public static SSLSecurityProtocol getSslSecurityProtocol()
public static void setSslSecurityProtocol(SSLSecurityProtocol securityProtocol)
public java.lang.String getPrefix()
scheme://host[:port]
.
public java.lang.String getScheme()
public java.net.URL getUrl(java.lang.String path)
path
- The path to qualify.
public ResponseMessage post(java.lang.String path)
path
- The request path.
public ResponseMessage post(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The form arguments.
public ResponseMessage delete(java.lang.String path)
path
- The request path.
public ResponseMessage delete(java.lang.String path, java.util.Map<java.lang.String,java.lang.Object> args)
path
- The request path.args
- The query arguments.
public ResponseMessage send(java.lang.String path, RequestMessage request)
path
- The request path.request
- The request message.
public static void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory)
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory()
public static javax.net.ssl.SSLSocketFactory createSSLFactory()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |