public class ConfigPlugin extends PluginActivator implements ConfigService, PostCreateTopicListener
Modifier and Type | Field and Description |
---|---|
private static String |
ASSOC_TYPE_CONFIGURATION |
private Logger |
logger |
private Map<String,List<ConfigDefinition>> |
registry
Key: the "configurable URI" as a config target's hash key, that is either "topic_uri:{uri}" or "type_uri:{uri}".
|
private javax.servlet.http.HttpServletRequest |
request |
private static String |
ROLE_TYPE_CONFIGURABLE |
private static String |
ROLE_TYPE_DEFAULT |
bundle, dm4, mf
Constructor and Description |
---|
ConfigPlugin() |
Modifier and Type | Method and Description |
---|---|
private RelatedTopic |
_createConfigTopic(ConfigDefinition configDef,
Topic topic) |
private RelatedTopic |
_getConfigTopic(String configTypeUri,
long topicId) |
void |
createConfigTopic(String configTypeUri,
Topic topic) |
private ConfigDefinition |
findByConfigTypeUri(List<ConfigDefinition> configDefs,
String configTypeUri) |
private ConfigDefinition |
getApplicableConfigDefinition(Topic topic,
String configTypeUri)
Returns the configuration definition for the given config type that is applicable to the given topic.
|
private List<ConfigDefinition> |
getApplicableConfigDefinitions(Topic topic)
Returns all configuration definitions applicable to a given topic.
|
ConfigDefinitions |
getConfigDefinitions() |
RelatedTopic |
getConfigTopic(String configTypeUri,
long topicId) |
private String |
info(Topic topic) |
private boolean |
isRegistered(ConfigDefinition configDef) |
private List<ConfigDefinition> |
lookupConfigDefinitions(String hashKey) |
void |
postCreateTopic(Topic topic) |
void |
registerConfigDefinition(ConfigDefinition configDef) |
void |
unregisterConfigDefinition(String configTypeUri) |
private long |
workspaceId(ConfigModificationRole role) |
getBundleContext, getPluginName, getStaticResource, getUri, init, preInstall, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
private static String ASSOC_TYPE_CONFIGURATION
private static String ROLE_TYPE_CONFIGURABLE
private static String ROLE_TYPE_DEFAULT
private Map<String,List<ConfigDefinition>> registry
@Context private javax.servlet.http.HttpServletRequest request
public ConfigPlugin()
public RelatedTopic getConfigTopic(String configTypeUri, long topicId)
getConfigTopic
in interface ConfigService
public void createConfigTopic(String configTypeUri, Topic topic)
createConfigTopic
in interface ConfigService
public void registerConfigDefinition(ConfigDefinition configDef)
registerConfigDefinition
in interface ConfigService
public void unregisterConfigDefinition(String configTypeUri)
unregisterConfigDefinition
in interface ConfigService
public ConfigDefinitions getConfigDefinitions()
public void postCreateTopic(Topic topic)
postCreateTopic
in interface PostCreateTopicListener
private RelatedTopic _getConfigTopic(String configTypeUri, long topicId)
private RelatedTopic _createConfigTopic(ConfigDefinition configDef, Topic topic)
private long workspaceId(ConfigModificationRole role)
private List<ConfigDefinition> getApplicableConfigDefinitions(Topic topic)
private ConfigDefinition getApplicableConfigDefinition(Topic topic, String configTypeUri)
RuntimeException
- if no such configuration definition is registered.private boolean isRegistered(ConfigDefinition configDef)
private ConfigDefinition findByConfigTypeUri(List<ConfigDefinition> configDefs, String configTypeUri)
private List<ConfigDefinition> lookupConfigDefinitions(String hashKey)
Copyright © 2016. All Rights Reserved.