Class ConfigurationServiceImpl
- java.lang.Object
-
- org.guvnor.structure.backend.config.ConfigurationServiceImpl
-
- All Implemented Interfaces:
AsyncWatchServiceCallback,org.guvnor.structure.server.config.ConfigurationService
@ApplicationScoped public class ConfigurationServiceImpl extends Object implements org.guvnor.structure.server.config.ConfigurationService, AsyncWatchServiceCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent>changedEventprotected Map<org.guvnor.structure.server.config.ConfigType,Map<String,List<org.guvnor.structure.server.config.ConfigGroup>>>configGroupsByTypeWithNamespaceprotected Map<org.guvnor.structure.server.config.ConfigType,List<org.guvnor.structure.server.config.ConfigGroup>>configGroupsByTypeWithoutNamespaceprotected org.guvnor.structure.backend.config.ConfigurationServiceImpl.CheckConfigurationUpdatesconfigUpdatesprotected ConfigServiceWatchServiceExecutorexecutorprotected ExecutorServiceexecutorServiceprotected org.uberfire.java.nio.file.FileSystemfsprotected org.jboss.errai.security.shared.api.identity.Useridentityprotected static StringINVALID_FILENAME_CHARSprotected org.uberfire.io.IOServiceioServiceprotected Set<Future<?>>jobsprotected AtomicLonglocalLastModifiedValueprotected ConfigGroupMarshallermarshallerprotected static StringMONITOR_DISABLEDprotected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent>repoChangedEventprotected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent>spaceChangedEventprotected org.guvnor.structure.repositories.RepositorysystemRepositoryprotected org.uberfire.java.nio.file.WatchServicewatchService
-
Constructor Summary
Constructors Constructor Description ConfigurationServiceImpl()ConfigurationServiceImpl(org.guvnor.structure.repositories.Repository systemRepository, ConfigGroupMarshaller marshaller, org.jboss.errai.security.shared.api.identity.User identity, org.uberfire.io.IOService ioService, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> repoChangedEvent, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> spaceChangedEvent, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> changedEvent, org.uberfire.java.nio.file.FileSystem fs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)voidcallback(long value)booleancleanUpSystemRepository()voidendBatch()List<org.guvnor.structure.server.config.ConfigGroup>getConfiguration(org.guvnor.structure.server.config.ConfigType type)List<org.guvnor.structure.server.config.ConfigGroup>getConfiguration(org.guvnor.structure.server.config.ConfigType type, String namespace)Map<String,List<org.guvnor.structure.server.config.ConfigGroup>>getConfigurationByNamespace(org.guvnor.structure.server.config.ConfigType type)protected StringgetIdentityName()protected longgetLastModified()protected ConfigServiceWatchServiceExecutorgetWatchServiceExecutor()booleanremoveConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)voidsetup()voidshutdown()voidstartBatch()booleanupdateConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)protected voidupdateLastModified()
-
-
-
Field Detail
-
MONITOR_DISABLED
protected static final String MONITOR_DISABLED
- See Also:
- Constant Field Values
-
INVALID_FILENAME_CHARS
protected static final String INVALID_FILENAME_CHARS
- See Also:
- Constant Field Values
-
systemRepository
protected org.guvnor.structure.repositories.Repository systemRepository
-
marshaller
protected ConfigGroupMarshaller marshaller
-
identity
protected org.jboss.errai.security.shared.api.identity.User identity
-
configGroupsByTypeWithoutNamespace
protected final Map<org.guvnor.structure.server.config.ConfigType,List<org.guvnor.structure.server.config.ConfigGroup>> configGroupsByTypeWithoutNamespace
-
configGroupsByTypeWithNamespace
protected final Map<org.guvnor.structure.server.config.ConfigType,Map<String,List<org.guvnor.structure.server.config.ConfigGroup>>> configGroupsByTypeWithNamespace
-
localLastModifiedValue
protected AtomicLong localLastModifiedValue
-
ioService
protected org.uberfire.io.IOService ioService
-
repoChangedEvent
protected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> repoChangedEvent
-
spaceChangedEvent
protected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> spaceChangedEvent
-
changedEvent
protected javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> changedEvent
-
executorService
protected final ExecutorService executorService
-
executor
protected ConfigServiceWatchServiceExecutor executor
-
configUpdates
protected org.guvnor.structure.backend.config.ConfigurationServiceImpl.CheckConfigurationUpdates configUpdates
-
watchService
protected org.uberfire.java.nio.file.WatchService watchService
-
fs
protected org.uberfire.java.nio.file.FileSystem fs
-
-
Constructor Detail
-
ConfigurationServiceImpl
public ConfigurationServiceImpl()
-
ConfigurationServiceImpl
@Inject public ConfigurationServiceImpl(@Named("system") org.guvnor.structure.repositories.Repository systemRepository, ConfigGroupMarshaller marshaller, org.jboss.errai.security.shared.api.identity.User identity, @Named("configIO") org.uberfire.io.IOService ioService, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> repoChangedEvent, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> spaceChangedEvent, javax.enterprise.event.Event<org.guvnor.structure.config.SystemRepositoryChangedEvent> changedEvent, @Named("systemFS") org.uberfire.java.nio.file.FileSystem fs)
-
-
Method Detail
-
setup
@PostConstruct public void setup()
-
shutdown
@PreDestroy public void shutdown()
-
startBatch
public void startBatch()
- Specified by:
startBatchin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
endBatch
public void endBatch()
- Specified by:
endBatchin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
getConfiguration
public List<org.guvnor.structure.server.config.ConfigGroup> getConfiguration(org.guvnor.structure.server.config.ConfigType type)
- Specified by:
getConfigurationin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
getConfiguration
public List<org.guvnor.structure.server.config.ConfigGroup> getConfiguration(org.guvnor.structure.server.config.ConfigType type, String namespace)
- Specified by:
getConfigurationin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
getConfigurationByNamespace
public Map<String,List<org.guvnor.structure.server.config.ConfigGroup>> getConfigurationByNamespace(org.guvnor.structure.server.config.ConfigType type)
- Specified by:
getConfigurationByNamespacein interfaceorg.guvnor.structure.server.config.ConfigurationService
-
addConfiguration
public boolean addConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)
- Specified by:
addConfigurationin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
updateConfiguration
public boolean updateConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)
- Specified by:
updateConfigurationin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
removeConfiguration
public boolean removeConfiguration(org.guvnor.structure.server.config.ConfigGroup configGroup)
- Specified by:
removeConfigurationin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
getIdentityName
protected String getIdentityName()
-
getLastModified
protected long getLastModified()
-
updateLastModified
protected void updateLastModified()
-
callback
public void callback(long value)
- Specified by:
callbackin interfaceAsyncWatchServiceCallback
-
cleanUpSystemRepository
public boolean cleanUpSystemRepository()
- Specified by:
cleanUpSystemRepositoryin interfaceorg.guvnor.structure.server.config.ConfigurationService
-
getWatchServiceExecutor
protected ConfigServiceWatchServiceExecutor getWatchServiceExecutor()
-
-