org.nuiton.jredmine
Interface RedmineServiceImplementor

All Known Implementing Classes:
DefaultRedmineAnonymousService, DefaultRedmineService, DefaultRedmineServiceImplementor

public interface RedmineServiceImplementor

Technical contract to implements a redmine service which wrap the RedmineRestClient.

A default implementation is offered in DefaultRedmineServiceImplementor.

Any concrete implentation of a redmine service should implements this..

Since:
1.0.0
Author:
tchemit
See Also:
DefaultRedmineServiceImplementor

Method Summary
 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.
 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.
<T> T[]
getDatas(String requestName, Class<T> type, Object... args)
          Generic method to obtain a array of data from a redmine server.
 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.
<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.
 

Method Detail

isInit

boolean isInit()
Tests if the service is loogued to the redmine service.

Returns:
true is service is init and loggued to Redmine service, false otherwise.

init

RedmineServiceImplementor init(org.nuiton.io.rest.RestClient session)
                               throws RedmineServiceException
Initialize the service given a redmine client already initialized.

Parameters:
session - the redmine client to be used by the service
Returns:
the initialized service
Throws:
RedmineServiceException - if any pb
See Also:
RedmineRestClient

init

RedmineServiceImplementor init(org.nuiton.io.rest.RestClientConfiguration configuration)
                               throws RedmineServiceException
Initialize the service given a client configuration.

Parameters:
configuration - the configuration to be used to init the internal redmine client
Returns:
the initialized service
Throws:
RedmineServiceException - if any pb

destroy

void destroy()
             throws RedmineServiceException
Close the service and destroy any connexion to the redmine service.

Throws:
RedmineServiceException - if any pb

getData

<T> T getData(String requestName,
              Class<T> type,
              Object... args)
          throws RedmineServiceException
Generic method to obtain a single data from a redmine server.

Type Parameters:
T - the type of data to obtain
Parameters:
requestName - the name of the request to use
type - the type of data to obtain
args - the parameters to obtain the data
Returns:
the obtained data
Throws:
RedmineServiceException - if any pb

getDatas

<T> T[] getDatas(String requestName,
                 Class<T> type,
                 Object... args)
             throws RedmineServiceException
Generic method to obtain a array of data from a redmine server.

Type Parameters:
T - the type of data to obtain
Parameters:
requestName - the name of the request to use
type - the type of data to obtain
args - the parameters to obtain the datas
Returns:
the obtained datas
Throws:
RedmineServiceException - if any pb

sendData

<T> T sendData(String requestName,
               Class<T> klazz,
               Object... args)
           throws RedmineServiceException
Generic method to send a data to a redmine server and return the single data updated from the redmine server.

Type Parameters:
T - the type of data to treate
Parameters:
requestName - the name of the request used
klazz - the type of data to treate
args - the parameters of the request
Returns:
the updated data
Throws:
RedmineServiceException - if any pb

sendDatas

<T> T[] sendDatas(String requestName,
                  Class<T> klazz,
                  Object... args)
              throws RedmineServiceException
Generic method to send a data (or more ) to a redmine server and return the array of data from the redmine server.

Type Parameters:
T - the type of data to treate
Parameters:
requestName - the name of the request used
klazz - the type of data to treate
args - the parameters of the request
Returns:
the updated data
Throws:
RedmineServiceException - if any pb

checkLoggued

void checkLoggued()
                  throws IllegalStateException,
                         RedmineServiceLoginException,
                         NullPointerException
Checks if the current session is not a anonymous one.

Throws:
IllegalStateException - if service not init
RedmineServiceLoginException - if not loggued
NullPointerException - if something is null

checkNotLoggued

void checkNotLoggued(org.nuiton.io.rest.RestClient session)
                     throws RedmineServiceLoginException,
                            NullPointerException
Checks if the current session is anonymous.

Parameters:
session - the session to test
Throws:
RedmineServiceLoginException - if not anonymous
NullPointerException - if something is null


Copyright © 2009-2012 CodeLutin. All Rights Reserved.