Package org.cyclos.impl
Class ServiceInvokerHandlerImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractGlobalServerComponent
-
- org.cyclos.impl.BaseGlobalHandlerImpl
-
- org.cyclos.impl.ServiceInvokerHandlerImpl
-
- All Implemented Interfaces:
ServiceInvokerHandler
@Component public class ServiceInvokerHandlerImpl extends BaseGlobalHandlerImpl implements ServiceInvokerHandler
Implementation forServiceInvokerHandler
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.AbstractGlobalServerComponent
rawEntityManagerHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description ServiceInvokerHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateErrorLog(String remoteAddress, Long networkId, Long configurationId, String channelName, Long loggedUserId, String operation, Supplier<String> paremetersAsJson, Throwable error)Generates an error log in a new transactionLogContextgetLogContext(SessionData sessionData, Long customWebServiceId, String serviceName, String methodName, Pair<?,com.fasterxml.jackson.databind.JsonNode> parametersPair)Returns log information about a service invocation.RequestDatagetRequestDataWithNetwork(Network network)Return aRequestDatainstance for the specifiedNetworkvoidinitialize()InvocationResultinvoke(InvocationData invocationData)Invokes a service methodServiceInterceptorsAccessorresolveInterceptors(Network network, Class<? extends Service> serviceInterface, Method method, ServiceInterceptorContext context)Resolve the interceptors defined for the given service and method.SessionDataresolveSessionData(InvocationData invocation)Resolves the session data from the given InvocationData.voidshutdown()-
Methods inherited from class org.cyclos.impl.AbstractGlobalServerComponent
getBaseEntityManagerHandler, getEntityManager
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
-
-
-
Method Detail
-
generateErrorLog
public void generateErrorLog(String remoteAddress, Long networkId, Long configurationId, String channelName, Long loggedUserId, String operation, Supplier<String> paremetersAsJson, Throwable error)
Description copied from interface:ServiceInvokerHandlerGenerates an error log in a new transaction- Specified by:
generateErrorLogin interfaceServiceInvokerHandler
-
getLogContext
public LogContext getLogContext(SessionData sessionData, Long customWebServiceId, String serviceName, String methodName, Pair<?,com.fasterxml.jackson.databind.JsonNode> parametersPair)
Description copied from interface:ServiceInvokerHandlerReturns log information about a service invocation. It never returns a null context, if the invocation must not be logged then an empty context is returned.- Specified by:
getLogContextin interfaceServiceInvokerHandler
-
getRequestDataWithNetwork
public RequestData getRequestDataWithNetwork(Network network)
Description copied from interface:ServiceInvokerHandlerReturn aRequestDatainstance for the specifiedNetwork- Specified by:
getRequestDataWithNetworkin interfaceServiceInvokerHandler
-
initialize
@PostConstruct public void initialize() throws IOException- Throws:
IOException
-
invoke
public InvocationResult invoke(InvocationData invocationData) throws IllegalInvocationException
Description copied from interface:ServiceInvokerHandlerInvokes a service method- Specified by:
invokein interfaceServiceInvokerHandler- Throws:
IllegalInvocationException
-
resolveInterceptors
public ServiceInterceptorsAccessor resolveInterceptors(Network network, Class<? extends Service> serviceInterface, Method method, ServiceInterceptorContext context)
Description copied from interface:ServiceInvokerHandlerResolve the interceptors defined for the given service and method.- Specified by:
resolveInterceptorsin interfaceServiceInvokerHandler
-
resolveSessionData
public SessionData resolveSessionData(InvocationData invocation)
Description copied from interface:ServiceInvokerHandlerResolves the session data from the given InvocationData. Requires to be running inside a transaction- Specified by:
resolveSessionDatain interfaceServiceInvokerHandler
-
shutdown
@PreDestroy public void shutdown()
-
-