|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.jredmine.DefaultRedmineServiceImplementor
public class DefaultRedmineServiceImplementor
Created: 2 janv. 2010
|
| Field Summary | |
|---|---|
protected boolean |
init
internal state to known if service was init |
protected org.nuiton.io.rest.RestClient |
session
|
protected RedmineXpp3Helper |
xpp3Helper
xpp3 xpp3Helper to transform xml stream to pojo |
| Constructor Summary | |
|---|---|
DefaultRedmineServiceImplementor()
|
|
| Method Summary | ||
|---|---|---|
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. |
|
|
getData(String requestName,
Class<T> type,
Object... args)
Generic method to obtain a single data from a redmine server. |
|
protected
|
getDataFromStream(Class<T> type,
InputStream stream)
|
|
|
getDatas(String requestName,
Class<T> type,
Object... args)
Generic method to obtain a array of data from a redmine server. |
|
protected
|
getDatasFromStream(Class<T> type,
InputStream stream)
|
|
protected org.nuiton.io.rest.RestRequest |
getRequest(String requestName,
Object... args)
|
|
RedmineServiceImplementor |
init(org.nuiton.io.rest.RestClient session)
Initialize the service given a redmine client already initialized. |
|
RedmineServiceImplementor |
init(org.nuiton.io.rest.RestClientConfiguration configuration)
Initialize the service given a client configuration. |
|
boolean |
isInit()
Tests if the service is loogued to the redmine service. |
|
|
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. |
|
|
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)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.nuiton.io.rest.RestClient session
protected final RedmineXpp3Helper xpp3Helper
protected boolean init
| Constructor Detail |
|---|
public DefaultRedmineServiceImplementor()
| Method Detail |
|---|
public boolean isInit()
RedmineServiceImplementor
isInit in interface RedmineServiceImplementortrue is service is init and loggued to Redmine service,
false otherwise.
public RedmineServiceImplementor init(org.nuiton.io.rest.RestClientConfiguration configuration)
throws RedmineServiceException
RedmineServiceImplementor
init in interface RedmineServiceImplementorconfiguration - the configuration to be used to init the internal redmine client
RedmineServiceException - if any pb
public RedmineServiceImplementor init(org.nuiton.io.rest.RestClient session)
throws RedmineServiceException
RedmineServiceImplementor
init in interface RedmineServiceImplementorsession - the redmine client to be used by the service
RedmineServiceException - if any pbRedmineRestClient
public void destroy()
throws RedmineServiceException
RedmineServiceImplementor
destroy in interface RedmineServiceImplementorRedmineServiceException - if any pb
public <T> T getData(String requestName,
Class<T> type,
Object... args)
throws RedmineServiceException
RedmineServiceImplementor
getData 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 data
RedmineServiceException - if any pb
public <T> T[] getDatas(String requestName,
Class<T> type,
Object... args)
throws RedmineServiceException
RedmineServiceImplementor
getDatas 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 datas
RedmineServiceException - if any pb
public <T> T sendData(String requestName,
Class<T> klazz,
Object... args)
throws RedmineServiceException
RedmineServiceImplementor
sendData 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 request
RedmineServiceException - if any pb
public <T> T[] sendDatas(String requestName,
Class<T> klazz,
Object... args)
throws RedmineServiceException
RedmineServiceImplementor
sendDatas 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 request
RedmineServiceException - if any pb
public void checkLoggued()
throws IllegalStateException,
RedmineServiceLoginException,
NullPointerException
RedmineServiceImplementor
checkLoggued in interface RedmineServiceImplementorIllegalStateException - if service not init
RedmineServiceLoginException - if not loggued
NullPointerException - if something is null
public void checkNotLoggued(org.nuiton.io.rest.RestClient session)
throws RedmineServiceLoginException,
NullPointerException
RedmineServiceImplementor
checkNotLoggued in interface RedmineServiceImplementorsession - the session to test
RedmineServiceLoginException - if not anonymous
NullPointerException - if something is null
protected InputStream askDataStream(String requestName,
Object... args)
throws RedmineServiceException
RedmineServiceException
protected InputStream sendDataStream(String requestName,
Object... args)
throws RedmineServiceException
RedmineServiceException
protected org.nuiton.io.rest.RestRequest getRequest(String requestName,
Object... args)
throws RedmineServiceException
RedmineServiceException
protected <T> T getDataFromStream(Class<T> type,
InputStream stream)
throws RedmineServiceException
RedmineServiceException
protected <T> T[] getDatasFromStream(Class<T> type,
InputStream stream)
throws RedmineServiceException
RedmineServiceException
protected void checkInit()
throws IllegalStateException
IllegalStateExceptionprotected void checkSessionNotNull(org.nuiton.io.rest.RestClient session)
protected void checkSessionConfigurationNotNull(org.nuiton.io.rest.RestClient session)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||