public class AgrosystCliServiceContext extends Object implements ServiceContext
| Modifier and Type | Field and Description |
|---|---|
protected String |
authenticationToken |
protected AgrosystCliServiceConfig |
config |
protected String |
configFileName |
protected AgrosystTopiaApplicationContext |
rootContext |
protected SecurityContext |
securityContext |
protected ServiceFactory |
serviceFactory |
protected AgrosystTopiaPersistenceContext |
transaction |
| Constructor and Description |
|---|
AgrosystCliServiceContext(String configFileName) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup() |
void |
close() |
AgrosystCliServiceConfig |
getAgrosystCliConfig() |
AgrosystCliServiceConfig |
getConfig() |
Date |
getCurrentDate() |
AgrosystTopiaDaoSupplier |
getDaoSupplier() |
com.google.gson.Gson |
getGson() |
AgrosystTopiaPersistenceContext |
getPersistenceContext() |
AgrosystTopiaPersistenceContext |
getPersistenceContext(boolean create) |
SecurityContext |
getSecurityContext() |
SecurityContext |
getSecurityContextAsUser(String userId) |
ServiceFactory |
getServiceFactory() |
org.nuiton.topia.persistence.TopiaTransaction |
getTransaction() |
org.nuiton.topia.persistence.TopiaTransaction |
getTransaction(boolean create) |
<I> I |
newInstance(Class<I> clazz) |
<E extends AgrosystService> |
newService(Class<E> clazz) |
ServiceContext |
newServiceContext() |
void |
setAuthenticationToken(String authenticationToken) |
protected AgrosystTopiaPersistenceContext transaction
protected AgrosystTopiaApplicationContext rootContext
protected ServiceFactory serviceFactory
protected AgrosystCliServiceConfig config
protected String authenticationToken
protected SecurityContext securityContext
protected String configFileName
public AgrosystCliServiceContext(String configFileName)
configFileName - configuration file path, if null 'agrosyst-import.properties' will be usedpublic void setAuthenticationToken(String authenticationToken)
public ServiceFactory getServiceFactory()
public ServiceContext newServiceContext()
newServiceContext in interface ServiceContextpublic void close()
close in interface ServiceContextpublic Date getCurrentDate()
getCurrentDate in interface ServiceContextpublic org.nuiton.topia.persistence.TopiaTransaction getTransaction()
getTransaction in interface ServiceContextpublic org.nuiton.topia.persistence.TopiaTransaction getTransaction(boolean create)
getTransaction in interface ServiceContextpublic AgrosystTopiaDaoSupplier getDaoSupplier()
getDaoSupplier in interface ServiceContextpublic AgrosystTopiaPersistenceContext getPersistenceContext()
getPersistenceContext in interface ServiceContextpublic AgrosystTopiaPersistenceContext getPersistenceContext(boolean create)
getPersistenceContext in interface ServiceContextpublic <E extends AgrosystService> E newService(Class<E> clazz)
newService in interface ServiceContextpublic <I> I newInstance(Class<I> clazz)
newInstance in interface ServiceContextpublic AgrosystCliServiceConfig getConfig()
getConfig in interface ServiceContextpublic AgrosystCliServiceConfig getAgrosystCliConfig()
public void cleanup()
public SecurityContext getSecurityContext()
getSecurityContext in interface ServiceContextpublic SecurityContext getSecurityContextAsUser(String userId)
getSecurityContextAsUser in interface ServiceContextpublic com.google.gson.Gson getGson()
getGson in interface ServiceContextCopyright © 2013–2014 Inra. All rights reserved.