public class DefaultRedmineServiceImplementor extends Object implements RedmineServiceImplementor
RedmineServiceImplementor| Modifier and Type | Field and Description |
|---|---|
protected boolean |
init
internal state to known if service was init
|
protected org.nuiton.io.rest.RestClient |
session
Redmine Client Rest.
|
protected RedmineXpp3Helper |
xpp3Helper
xpp3 xpp3Helper to transform xml stream to pojo
|
| Constructor and Description |
|---|
DefaultRedmineServiceImplementor() |
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
askDataStream(String requestName,
Object... args) |
protected void |
checkInit() |
void |
checkLoggued()
Checks if the current session is not a anonymous one.
|
void |
checkNotLoggued(org.nuiton.io.rest.RestClient session)
Checks if the current session is anonymous.
|
protected void |
checkSessionConfigurationNotNull(org.nuiton.io.rest.RestClient session) |
protected void |
checkSessionNotNull(org.nuiton.io.rest.RestClient session) |
void |
destroy()
Close the service and destroy any connexion to the redmine service.
|
<T> T |
getData(String requestName,
Class<T> type,
Object... args)
Generic method to obtain a single data from a redmine server.
|
protected <T> T |
getDataFromStream(Class<T> type,
InputStream stream) |
<T> T[] |
getDatas(String requestName,
Class<T> type,
Object... args)
Generic method to obtain a array of data from a redmine server.
|
protected <T> T[] |
getDatasFromStream(Class<T> type,
InputStream stream) |
protected org.nuiton.io.rest.RestRequest |
getRequest(String requestName,
Object... args) |
org.nuiton.io.rest.RestClient |
getSession()
Gets the transport layer based on
RestClient. |
RedmineServiceImplementor |
init(RedmineServiceConfiguration configuration)
Initialize the service given a client configuration.
|
boolean |
isInit()
Tests if the service is loogued to the redmine service.
|
<T> T |
sendData(String requestName,
Class<T> klazz,
Object... args)
Generic method to send a data to a redmine server and return the single
data updated from the redmine server.
|
<T> T[] |
sendDatas(String requestName,
Class<T> klazz,
Object... args)
Generic method to send a data (or more ) to a redmine server and
return the array of data from the redmine server.
|
protected InputStream |
sendDataStream(String requestName,
Object... args) |
protected org.nuiton.io.rest.RestClient session
protected final RedmineXpp3Helper xpp3Helper
protected boolean init
public boolean isInit()
RedmineServiceImplementorisInit in interface RedmineServiceImplementortrue is service is init and loggued to Redmine service,
false otherwise.public RedmineServiceImplementor init(RedmineServiceConfiguration configuration) throws RedmineServiceException
RedmineServiceImplementorinit in interface RedmineServiceImplementorconfiguration - the configuration to be used to init the internal redmine clientRedmineServiceException - if any pbpublic void destroy()
throws RedmineServiceException
RedmineServiceImplementordestroy in interface RedmineServiceImplementorRedmineServiceException - if any pbpublic org.nuiton.io.rest.RestClient getSession()
RedmineServiceImplementorRestClient.getSession in interface RedmineServiceImplementorpublic <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException
RedmineServiceImplementorgetData in interface RedmineServiceImplementorT - the type of data to obtainrequestName - the name of the request to usetype - the type of data to obtainargs - the parameters to obtain the dataRedmineServiceException - if any pbpublic <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException
RedmineServiceImplementorgetDatas in interface RedmineServiceImplementorT - the type of data to obtainrequestName - the name of the request to usetype - the type of data to obtainargs - the parameters to obtain the datasRedmineServiceException - if any pbpublic <T> T sendData(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException
RedmineServiceImplementorsendData in interface RedmineServiceImplementorT - the type of data to treaterequestName - the name of the request usedklazz - the type of data to treateargs - the parameters of the requestRedmineServiceException - if any pbpublic <T> T[] sendDatas(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException
RedmineServiceImplementorsendDatas in interface RedmineServiceImplementorT - the type of data to treaterequestName - the name of the request usedklazz - the type of data to treateargs - the parameters of the requestRedmineServiceException - if any pbpublic void checkLoggued()
throws IllegalStateException,
RedmineServiceLoginException,
NullPointerException
RedmineServiceImplementorcheckLoggued in interface RedmineServiceImplementorIllegalStateException - if service not initRedmineServiceLoginException - if not logguedNullPointerException - if something is nullpublic void checkNotLoggued(org.nuiton.io.rest.RestClient session)
throws RedmineServiceLoginException,
NullPointerException
RedmineServiceImplementorcheckNotLoggued in interface RedmineServiceImplementorsession - the session to testRedmineServiceLoginException - if not anonymousNullPointerException - if something is nullprotected InputStream askDataStream(String requestName, Object... args) throws RedmineServiceException
RedmineServiceExceptionprotected InputStream sendDataStream(String requestName, Object... args) throws RedmineServiceException
RedmineServiceExceptionprotected org.nuiton.io.rest.RestRequest getRequest(String requestName, Object... args) throws RedmineServiceException
RedmineServiceExceptionprotected <T> T getDataFromStream(Class<T> type, InputStream stream) throws RedmineServiceException
RedmineServiceExceptionprotected <T> T[] getDatasFromStream(Class<T> type, InputStream stream) throws RedmineServiceException
RedmineServiceExceptionprotected void checkInit()
throws IllegalStateException
IllegalStateExceptionprotected void checkSessionNotNull(org.nuiton.io.rest.RestClient session)
protected void checkSessionConfigurationNotNull(org.nuiton.io.rest.RestClient session)
Copyright © 2009-2012 CodeLutin. All Rights Reserved.