org.codegist.crest.config
Interface InterfaceConfig


public interface InterfaceConfig

Interface configuration holder object.

Implementors must respect the following contract :

- No method return null except for the ones documented or when used as an override template (see Configs.override(InterfaceConfig, InterfaceConfig))

- Defaults values must either be taken from interface's defaults constant or from InterfaceContext.getProperties()'s defaults overrides.

- Every methods in the interface must have it's respective MethodConfig configured.

- Every arguments of every methods in the interface must have it's respective ParamConfig configured in its respective MethodConfig object.

Author:
Laurent Gilles (laurent.gilles@codegist.org)
See Also:
MethodConfig, ParamConfig, InterfaceConfigFactory

Field Summary
static String DEFAULT_CONTEXT_PATH
          Default service url fragment applied when non specified.
static String DEFAULT_ENCODING
          Default encoding applied when non specified.
static Class<? extends RequestInterceptor> DEFAULT_GLOBAL_INTERCEPTOR
          Default request interceptor applied when non specified.
 
Method Summary
 String getContextPath()
          Service base path (eg: /base/service/path).
 String getEncoding()
          Encoding of the interface.
 String getEndPoint()
          Server path (eg: http://www.my-end-point.com:8080)
 RequestInterceptor getGlobalInterceptor()
          Global service request interceptor.
 Class<?> getInterface()
           
 MethodConfig getMethodConfig(Method meth)
           
 Method[] getMethods()
           
 

Field Detail

DEFAULT_ENCODING

static final String DEFAULT_ENCODING
Default encoding applied when non specified.

See Also:
getEncoding(), Constant Field Values

DEFAULT_CONTEXT_PATH

static final String DEFAULT_CONTEXT_PATH
Default service url fragment applied when non specified.

See Also:
getContextPath(), Constant Field Values

DEFAULT_GLOBAL_INTERCEPTOR

static final Class<? extends RequestInterceptor> DEFAULT_GLOBAL_INTERCEPTOR
Default request interceptor applied when non specified.

See Also:
getGlobalInterceptor()
Method Detail

getEncoding

String getEncoding()
Encoding of the interface.

Returns:
the encoding of the interface

getEndPoint

String getEndPoint()
Server path (eg: http://www.my-end-point.com:8080)

Returns:
server's path

getContextPath

String getContextPath()
Service base path (eg: /base/service/path). Full service path is then getEndPoint() concatenated to this value.

Returns:
server's path

getGlobalInterceptor

RequestInterceptor getGlobalInterceptor()
Global service request interceptor.

For a given request, the call order is :

- InterfaceConfig.requestInterceptor.beforeParamsInjectionHandle(...)

- MethodConfig.requestInterceptor.beforeParamsInjectionHandle(...)

- MethodConfig.requestInterceptor.afterParamsInjectionHandle(...)

- InterfaceConfig.requestInterceptor.afterParamsInjectionHandle(...)

Returns:
global service request interceptor.

getInterface

Class<?> getInterface()
Returns:
The interface being configured by the current object.

getMethods

Method[] getMethods()
Returns:
Method list of the interface being configured by the current object.

getMethodConfig

MethodConfig getMethodConfig(Method meth)
Parameters:
meth - Method to retrieve the config for
Returns:
The method config object for the given method, null if not found.


Copyright © 2011. All Rights Reserved.