public abstract class AbstractMaileonService
extends java.lang.Object
AbstractMaileonService
provides an abstract interface for all its subservices.Modifier and Type | Class and Description |
---|---|
static class |
AbstractMaileonService.QueryParameters
The Class QueryParameters is used to represent the parameters of the client requests.
|
Modifier and Type | Field and Description |
---|---|
static MediaType |
MAILEON_XML_TYPE
The Constant MAILEON_XML_TYPE.
|
Constructor and Description |
---|
AbstractMaileonService(MaileonConfiguration config,
java.lang.String service)
Instantiates a new abstract Maileon service.
|
Modifier and Type | Method and Description |
---|---|
protected ResponseWrapper |
delete(java.lang.String path)
Represents a DELETE request.
|
protected ResponseWrapper |
delete(java.lang.String path,
AbstractMaileonService.QueryParameters parameters)
Represents a DELETE request with parameters.
|
protected ResponseWrapper |
delete(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
MediaType mediaType)
Represents a PUT request with parameters and media type.
|
protected static java.lang.String |
encodePath(java.lang.String path)
Encodes the path to a particular resource.
|
protected ResponseWrapper |
get(java.lang.String path)
Represents GET request.
|
protected ResponseWrapper |
get(java.lang.String path,
AbstractMaileonService.QueryParameters parameters)
Represents GET request with parameters.
|
protected ResponseWrapper |
get(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
MediaType mediaType)
Represents a GET request with parameters and media type.
|
boolean |
isCompressionEnabled() |
boolean |
isDebug()
Checks if is for debugging purposes.
|
boolean |
isRequestCompressionEnabled() |
protected ResponseWrapper |
post(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
MediaType mediaType,
java.lang.Object entity)
Represents a POST request with parameters and media type.
|
protected ResponseWrapper |
post(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
java.lang.Object entity)
Represents a POST request with parameters.
|
protected ResponseWrapper |
post(java.lang.String path,
java.lang.Object entity)
Represents a POST request.
|
protected ResponseWrapper |
put(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
MediaType mediaType,
java.lang.Object entity)
Represents a PUT request with parameters and media type.
|
protected ResponseWrapper |
put(java.lang.String path,
AbstractMaileonService.QueryParameters parameters,
java.lang.Object entity)
Represents a PUT request with parameters.
|
protected ResponseWrapper |
put(java.lang.String path,
java.lang.Object entity)
Represents a PUT request.
|
void |
setCompressionEnabled(boolean compressionEnabled) |
void |
setDebug(boolean debug)
Sets the debug.
|
void |
setRequestCompressionEnabled(boolean requestCompressionEnabled) |
public static final MediaType MAILEON_XML_TYPE
public AbstractMaileonService(MaileonConfiguration config, java.lang.String service)
config
- The Maileon API-Configurationservice
- The concrete subservicepublic boolean isDebug()
true
, if is debugpublic void setDebug(boolean debug)
debug
- the new debugpublic boolean isCompressionEnabled()
public final void setCompressionEnabled(boolean compressionEnabled)
public boolean isRequestCompressionEnabled()
public final void setRequestCompressionEnabled(boolean requestCompressionEnabled)
protected ResponseWrapper get(java.lang.String path) throws MaileonException
path
- The path to the corresponding resourcesResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper get(java.lang.String path, AbstractMaileonService.QueryParameters parameters) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the GET requestResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper get(java.lang.String path, AbstractMaileonService.QueryParameters parameters, MediaType mediaType) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the GET requestmediaType
- The required media typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper post(java.lang.String path, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesentity
- The entity to post as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper post(java.lang.String path, AbstractMaileonService.QueryParameters parameters, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the POST requestentity
- The entity to post as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper post(java.lang.String path, AbstractMaileonService.QueryParameters parameters, MediaType mediaType, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the POST requestmediaType
- The required media typeentity
- The entity to post as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper put(java.lang.String path, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesentity
- The entity to put as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper put(java.lang.String path, AbstractMaileonService.QueryParameters parameters, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the PUT requestentity
- The entity to put as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper put(java.lang.String path, AbstractMaileonService.QueryParameters parameters, MediaType mediaType, java.lang.Object entity) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the PUT requestmediaType
- The required media typeentity
- The entity to put as an object typeResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper delete(java.lang.String path) throws MaileonException
path
- The path to the corresponding resourcesResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper delete(java.lang.String path, AbstractMaileonService.QueryParameters parameters) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the DELETE requestResponseWrapper
MaileonException
- the Maileon exceptionprotected ResponseWrapper delete(java.lang.String path, AbstractMaileonService.QueryParameters parameters, MediaType mediaType) throws MaileonException
path
- The path to the corresponding resourcesparameters
- The parameters of the DELETE requestmediaType
- The required media typeResponseWrapper
MaileonException
- the Maileon exceptionprotected static java.lang.String encodePath(java.lang.String path) throws MaileonException
path
- The path to encodeMaileonException
Copyright © 2018. All Rights Reserved.