public class SynapseConfiguration extends java.lang.Object implements ManagedLifecycle, SynapseArtifact
Constructor and Description |
---|
SynapseConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addAPI(java.lang.String name,
API api) |
void |
addAPI(java.lang.String name,
API api,
boolean reOrder) |
void |
addEndpoint(java.lang.String key,
Endpoint endpoint)
Define a named endpoint with the given key.
|
void |
addEndpoint(java.lang.String key,
Entry entry)
Deprecated.
|
void |
addEndpointTemplate(java.lang.String name,
Template template) |
void |
addEntry(java.lang.String key,
Entry entry)
Define a resource to the local registry.
|
void |
addEventSource(java.lang.String name,
SynapseEventSource eventSource)
Add an event source to the configuration.
|
void |
addInboundEndpoint(java.lang.String name,
InboundEndpoint inboundEndpoint) |
void |
addMessageProcessor(java.lang.String name,
MessageProcessor processor)
Add message processor to the synapse configuration with given name
|
void |
addMessageStore(java.lang.String name,
MessageStore messageStore)
Add MessageStore to the configuration with a given name.
|
void |
addPriorityExecutor(java.lang.String name,
org.apache.synapse.commons.executors.PriorityExecutor executor)
Add an executor
|
void |
addProxyService(java.lang.String name,
ProxyService proxy)
Add a Proxy service to the configuration.
|
void |
addSequence(java.lang.String key,
Entry entry)
Deprecated.
|
void |
addSequence(java.lang.String key,
Mediator mediator)
Add a named sequence into the local registry.
|
void |
addSequenceTemplate(java.lang.String key,
TemplateMediator mediator)
Add a sequence-template into the local registry.
|
void |
addStartup(Startup startup)
Add a startup to the startups map in the configuration.
|
void |
addSwaggerDefinition(java.lang.String apiName,
java.lang.String swaggerDefinition)
Add swagger definition of an API.
|
void |
addSynapseImport(java.lang.String name,
SynapseImport synImport)
Add Synapse Import to a configuration with given name
|
void |
addSynapseLibrary(java.lang.String name,
Library library)
Add Synapse library to configuration with given name
|
void |
addToCommentedTextList(java.lang.String comment)
Add new comment text entry to the existing list*
|
void |
clearCache()
Clears the cache of all the remote entries which has been
cached in the configuration
|
void |
clearCachedEntry(java.lang.String key)
Clears the cache of the remote entry with the key specified
|
void |
destroy()
This method will be called on the soft shutdown or destroying the configuration
and will destroy all the stateful managed parts of the configuration.
|
void |
destroy(boolean preserverState) |
API |
getAPI(java.lang.String name) |
java.util.Collection<API> |
getAPIs() |
java.util.Collection<API> |
getAPIs(java.lang.String bindTo)
Get the API specifying the binds to option
|
SynapseArtifactDeploymentStore |
getArtifactDeploymentStore()
Get the SynapseArtifactDeploymentStore which is used to store the information about
the deployed artifacts
|
org.apache.axis2.engine.AxisConfiguration |
getAxisConfiguration()
Get the Axis2 AxisConfiguration for the SynapseConfiguration
|
java.util.Map<java.lang.String,Entry> |
getCachedEntries()
Gives the set of remote entries that are cached in localRegistry as mapping of entry key
to the Entry definition
|
java.util.List<java.lang.String> |
getCommentedTextList()
Returns CommentedText List
|
CompletedStructureStore |
getCompletedStructureStore()
This method returns the CompletedStructureStore responsible for collecting completed statistics for this synapse
instance.
|
java.util.Map<java.lang.String,java.lang.Object> |
getDecryptedCacheMap()
Returns the map which contains the Decrypted values read via the secure
vault provider
|
Mediator |
getDefaultConfiguration(java.lang.String key) |
javax.xml.namespace.QName |
getDefaultQName()
Get the default QName of the configuration.
|
java.util.Map<java.lang.String,Endpoint> |
getDefinedEndpoints()
Returns the map of defined endpoints in the configuration excluding the
fetched endpoints from remote registry
|
java.util.Map<java.lang.String,Entry> |
getDefinedEntries()
Returns the map of defined entries in the configuration excluding the
fetched entries from remote registry.
|
java.util.Map<java.lang.String,SequenceMediator> |
getDefinedSequences()
Returns the map of defined sequences in the configuration excluding the
fetched sequences from remote registry.
|
java.lang.String |
getDescription()
Gets the configuration description
|
Endpoint |
getEndpoint(java.lang.String key)
Get the definition of the endpoint with the given key
|
Template |
getEndpointTemplate(java.lang.String key) |
java.util.Map<java.lang.String,Template> |
getEndpointTemplates()
Returns the map of defined synapse endpoint templates in the configuration excluding the
fetched sequences from remote registry.
|
java.lang.Object |
getEntry(java.lang.String key)
Get the resource with the given key
|
Entry |
getEntryDefinition(java.lang.String key)
Get the Entry object mapped to the given key
|
SynapseEventSource |
getEventSource(java.lang.String name) |
java.util.Collection<SynapseEventSource> |
getEventSources() |
Mediator |
getFaultSequence()
Return the fault sequence to be executed when Synapse encounters a fault
scenario during processing
|
org.apache.axiom.om.OMElement |
getFormat(java.lang.String key)
Return the format of the payload factory specified by the given key
|
InboundEndpoint |
getInboundEndpoint(java.lang.String name) |
java.util.Collection<InboundEndpoint> |
getInboundEndpoints() |
java.util.Map |
getLocalRegistry()
Return an unmodifiable copy of the local registry
|
java.lang.Object |
getLocalRegistryEntry(java.lang.String key)
Get the resource from local registry
|
Mediator |
getMainSequence()
Return the main/default sequence to be executed.
|
Mediator |
getMandatorySequence()
Gets the mandatory sequence, from the direct reference.
|
java.util.Map<java.lang.String,MessageProcessor> |
getMessageProcessors()
Get all Message processors in the Synapse configuration
|
MessageStore |
getMessageStore(java.lang.String name)
Get the Message store for the configuration with a given name.
|
java.util.Map<java.lang.String,MessageStore> |
getMessageStores()
Get Message stores defined
|
java.util.List<SynapseObserver> |
getObservers() |
java.lang.String |
getPathToConfigFile()
The path to the currently loaded configuration file
|
java.util.Map<java.lang.String,org.apache.synapse.commons.executors.PriorityExecutor> |
getPriorityExecutors()
Get the executors map
|
java.util.Properties |
getProperties()
Gets the properties to configure the Synapse environment.
|
java.lang.String |
getProperty(java.lang.String propKey)
Gets the property value if the property specified by the propKey is there or null else
|
long |
getProperty(java.lang.String propKey,
long def)
Gets the String representation of the property value if there is a property for the
given propKey or returns the default value passed
|
java.lang.String |
getProperty(java.lang.String propKey,
java.lang.String def)
Gets the String representation of the property value if there is a property for the
given propKey or returns the default value passed
|
ProxyService |
getProxyService(java.lang.String name)
Get the Proxy service with the given name
|
java.util.Collection<ProxyService> |
getProxyServices()
Return the list of defined proxy services
|
Registry |
getRegistry()
Get the remote registry defined (if any)
|
Mediator |
getSequence(java.lang.String key)
Return the sequence specified with the given key
|
TemplateMediator |
getSequenceTemplate(java.lang.String key)
Return the template specified with the given key
|
java.util.Map<java.lang.String,TemplateMediator> |
getSequenceTemplates()
Returns the map of defined synapse templates in the configuration excluding the
fetched sequences from remote registry.
|
Startup |
getStartup(java.lang.String id)
Get the Startup with the specified name
|
java.util.Collection<Startup> |
getStartups()
Get the startup collection in the configuration
|
java.lang.String |
getSwaggerOfTheAPI(java.lang.String apiName)
Get swagger definition of a given API.
|
java.util.Map<java.lang.String,SynapseImport> |
getSynapseImports()
Get all Synapse libraries in the Synapse configuration
|
java.util.Map<java.lang.String,Library> |
getSynapseLibraries()
Get all Synapse libraries in the Synapse configuration
|
java.util.Timer |
getSynapseTimer()
Get the timer object for the Synapse Configuration
|
org.apache.synapse.task.TaskManager |
getTaskManager() |
void |
init(SynapseEnvironment se)
This method will be called in the startup of Synapse or in an initiation
and will initialize all the managed parts of the Synapse Configuration
|
boolean |
isAllowHotUpdate() |
void |
reconstructAPITable()
This method reconstructs the apiTable, and inboundApiMappings in descending order of context
|
void |
registerObserver(SynapseObserver o) |
void |
removeAPI(java.lang.String name) |
void |
removeEndpoint(java.lang.String key)
Deletes the endpoint with the given key.
|
void |
removeEndpointTemplate(java.lang.String name) |
void |
removeEntry(java.lang.String key)
Deletes any reference mapped to the given key from the local registry
|
void |
removeEventSource(java.lang.String name)
Remove an event source from the configuration.
|
org.apache.synapse.commons.executors.PriorityExecutor |
removeExecutor(java.lang.String name)
Removes an executor from the configuration
|
void |
removeInboundEndpoint(java.lang.String name) |
MessageProcessor |
removeMessageProcessor(java.lang.String name)
remove the message processor from the synapse configuration
|
MessageStore |
removeMessageStore(java.lang.String name)
Removes a Message store from the configuration
|
void |
removeProxyService(java.lang.String name)
Deletes the Proxy Service named with the given name.
|
void |
removeSequence(java.lang.String key)
Removes a sequence from the local registry
|
void |
removeSequenceTemplate(java.lang.String name)
Removes a template from the local registry
|
void |
removeStartup(java.lang.String name)
Removes the startup specified by the name.
|
void |
removeSwaggerFromTheAPI(java.lang.String name)
Remove the swagger definition from Synapse Context if it exists.
|
SynapseImport |
removeSynapseImport(java.lang.String name)
remove the Synapse library from the synapse configuration
|
Library |
removeSynapseLibrary(java.lang.String name)
remove the Synapse library from the synapse configuration
|
void |
setAllowHotUpdate(boolean allowHotUpdate) |
void |
setAxisConfiguration(org.apache.axis2.engine.AxisConfiguration axisConfig)
Set the Axis2 AxisConfiguration to the SynapseConfiguration
|
void |
setDefaultQName(javax.xml.namespace.QName defaultQName)
Set the default QName of the Synapse Configuration
|
void |
setDescription(java.lang.String description)
Sets the description of the configuration
|
void |
setEventSources(java.util.Map<java.lang.String,SynapseEventSource> eventSources) |
void |
setMandatorySequence(Mediator mandatorySequence)
Sets the mandatory sequence direct reference
|
void |
setPathToConfigFile(java.lang.String pathToConfigFile)
Set the path to the loaded synapse.xml
|
void |
setProperties(java.util.Properties properties)
Deprecated.
|
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets the specified property to the Synapse configuration
|
void |
setRegistry(Registry registry)
Set the remote registry for the configuration
|
void |
setTaskManager(org.apache.synapse.task.TaskManager taskManager) |
void |
unregisterObserver(SynapseObserver observer) |
void |
updateAPI(java.lang.String name,
API api) |
void |
updateEndpoint(java.lang.String key,
Endpoint endpoint) |
void |
updateEndpointTemplate(java.lang.String name,
Template template) |
void |
updateEntry(java.lang.String key,
Entry entry) |
void |
updateInboundEndpoint(java.lang.String name,
InboundEndpoint inboundEndpoint) |
void |
updatePriorityExecutor(java.lang.String name,
org.apache.synapse.commons.executors.PriorityExecutor executor) |
void |
updateSequence(java.lang.String key,
Mediator mediator) |
void |
updateSequenceTemplate(java.lang.String key,
TemplateMediator mediator)
Update a sequence-template into the local registry.
|
void |
updateStartup(Startup startup) |
void |
validateSwaggerTable()
Remove swagger contents without corresponding API.
|
public void addSequence(java.lang.String key, Mediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void addSequenceTemplate(java.lang.String key, TemplateMediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void updateSequenceTemplate(java.lang.String key, TemplateMediator mediator)
key
- the name for the sequencemediator
- a Sequence mediatorpublic void updateSequence(java.lang.String key, Mediator mediator)
public void addSequence(java.lang.String key, Entry entry)
key
- the key to lookup the sequence from the remote registryentry
- the Entry object which holds meta information and the cached
resourcepublic java.util.Map<java.lang.String,SequenceMediator> getDefinedSequences()
public java.util.Map<java.lang.String,TemplateMediator> getSequenceTemplates()
public java.util.Map<java.lang.String,Template> getEndpointTemplates()
public void addInboundEndpoint(java.lang.String name, InboundEndpoint inboundEndpoint)
public InboundEndpoint getInboundEndpoint(java.lang.String name)
public java.util.Collection<InboundEndpoint> getInboundEndpoints()
public void updateInboundEndpoint(java.lang.String name, InboundEndpoint inboundEndpoint)
public void removeInboundEndpoint(java.lang.String name)
public void addAPI(java.lang.String name, API api)
public void addAPI(java.lang.String name, API api, boolean reOrder)
public void addSwaggerDefinition(java.lang.String apiName, java.lang.String swaggerDefinition)
apiName
- name of the API.swaggerDefinition
- Swagger definition as string.public void validateSwaggerTable()
public java.lang.String getSwaggerOfTheAPI(java.lang.String apiName)
apiName
- deployed name of the API.public void updateAPI(java.lang.String name, API api)
public java.util.Collection<API> getAPIs()
public java.util.Collection<API> getAPIs(java.lang.String bindTo)
bindTo
- Name of inbound/binds-topublic API getAPI(java.lang.String name)
public void removeAPI(java.lang.String name)
public void removeSwaggerFromTheAPI(java.lang.String name)
name
- artifact name of the API.public TemplateMediator getSequenceTemplate(java.lang.String key)
key
- the key being referenced for the templatepublic Mediator getMandatorySequence()
getSequence(String)
but this method improves the
performance hence this will be required for all messagespublic void setMandatorySequence(Mediator mandatorySequence)
mandatorySequence
- to be set as the direct referencepublic Mediator getSequence(java.lang.String key)
key
- the key being referencedpublic org.apache.axiom.om.OMElement getFormat(java.lang.String key)
key
- public void removeSequence(java.lang.String key)
key
- of the sequence to be removedpublic void removeSequenceTemplate(java.lang.String name)
name
- of the template to be removedpublic Mediator getMainSequence()
public Mediator getFaultSequence()
public void addEntry(java.lang.String key, Entry entry)
key
- the key associated with the resourceentry
- the Entry that holds meta information about the resource and
its contents (or cached contents if the Entry refers to a
dynamic resource off a remote registry)public void updateEntry(java.lang.String key, Entry entry)
public java.util.Map<java.lang.String,Entry> getCachedEntries()
public java.util.Map<java.lang.String,Entry> getDefinedEntries()
public java.lang.Object getLocalRegistryEntry(java.lang.String key)
key
- the key of the resource requiredpublic java.lang.Object getEntry(java.lang.String key)
key
- the key of the resource requiredpublic Entry getEntryDefinition(java.lang.String key)
key
- the key for which the Entry is requiredpublic void removeEntry(java.lang.String key)
key
- the key of the reference to be removedpublic void clearCachedEntry(java.lang.String key)
key
- - String key of the entrypublic void clearCache()
public void addEndpoint(java.lang.String key, Endpoint endpoint)
key
- the key for the endpointendpoint
- the endpoint definitionpublic void updateEndpoint(java.lang.String key, Endpoint endpoint)
public void addEndpoint(java.lang.String key, Entry entry)
key
- the key for the endpoint definitionentry
- the actual endpoint definition to be addedpublic java.util.Map<java.lang.String,Endpoint> getDefinedEndpoints()
public Endpoint getEndpoint(java.lang.String key)
key
- the key of the endpointpublic void removeEndpoint(java.lang.String key)
key
- of the endpoint to be deletedpublic void addProxyService(java.lang.String name, ProxyService proxy)
name
- the name of the Proxy serviceproxy
- the Proxy service instancepublic ProxyService getProxyService(java.lang.String name)
name
- the name being looked uppublic void removeProxyService(java.lang.String name)
name
- of the Proxy Service to be deletedpublic java.util.Collection<ProxyService> getProxyServices()
public java.util.Map getLocalRegistry()
public Registry getRegistry()
public void setRegistry(Registry registry)
registry
- the remote registry for the configurationpublic void setAxisConfiguration(org.apache.axis2.engine.AxisConfiguration axisConfig)
axisConfig
- AxisConfiguration to be setpublic org.apache.axis2.engine.AxisConfiguration getAxisConfiguration()
public java.lang.String getPathToConfigFile()
public void setPathToConfigFile(java.lang.String pathToConfigFile)
pathToConfigFile
- path to the synapse.xml loadedpublic void setDefaultQName(javax.xml.namespace.QName defaultQName)
defaultQName
- QName specifying the default QName of the configurationpublic javax.xml.namespace.QName getDefaultQName()
public java.util.Timer getSynapseTimer()
public java.util.Collection<Startup> getStartups()
public Startup getStartup(java.lang.String id)
id
- - String name of the startup to be retrievedpublic void addStartup(Startup startup)
startup
- - Startup object to be addedpublic void updateStartup(Startup startup)
public void removeStartup(java.lang.String name)
name
- - name of the startup that needs to be removedpublic java.util.Properties getProperties()
public void setProperty(java.lang.String key, java.lang.String value)
key
- Name of the propertyvalue
- Value of the property to be setpublic void setProperties(java.util.Properties properties)
properties
- - Properties which needs to be setpublic java.lang.String getProperty(java.lang.String propKey, java.lang.String def)
propKey
- - key for the property lookupdef
- - default valuepublic long getProperty(java.lang.String propKey, long def)
propKey
- - key for the property lookupdef
- - default valuepublic java.lang.String getProperty(java.lang.String propKey)
propKey
- - key for the property lookuppublic void destroy()
destroy
in interface ManagedLifecycle
public void destroy(boolean preserverState)
public void init(SynapseEnvironment se)
init
in interface ManagedLifecycle
se
- SynapseEnvironment specifying the env to be initializedpublic void addEventSource(java.lang.String name, SynapseEventSource eventSource)
name
- name of the event sourceeventSource
- the event source to be addedpublic SynapseEventSource getEventSource(java.lang.String name)
public void removeEventSource(java.lang.String name)
name
- name of the event source to be removedpublic java.util.Collection<SynapseEventSource> getEventSources()
public void setEventSources(java.util.Map<java.lang.String,SynapseEventSource> eventSources)
public void registerObserver(SynapseObserver o)
public java.util.List<SynapseObserver> getObservers()
public void unregisterObserver(SynapseObserver observer)
public void addPriorityExecutor(java.lang.String name, org.apache.synapse.commons.executors.PriorityExecutor executor)
name
- name of the executorexecutor
- executorpublic void updatePriorityExecutor(java.lang.String name, org.apache.synapse.commons.executors.PriorityExecutor executor)
public java.util.Map<java.lang.String,org.apache.synapse.commons.executors.PriorityExecutor> getPriorityExecutors()
public org.apache.synapse.commons.executors.PriorityExecutor removeExecutor(java.lang.String name)
name
- name of the executorpublic MessageStore getMessageStore(java.lang.String name)
name
- Name of the message storepublic void addMessageStore(java.lang.String name, MessageStore messageStore)
name
- Name of the message storemessageStore
- a MessageStore instancepublic java.util.Map<java.lang.String,MessageStore> getMessageStores()
public MessageStore removeMessageStore(java.lang.String name)
name
- name of the message storepublic void addMessageProcessor(java.lang.String name, MessageProcessor processor)
name
- of the Message processorprocessor
- instancepublic java.util.Map<java.lang.String,MessageProcessor> getMessageProcessors()
public MessageProcessor removeMessageProcessor(java.lang.String name)
name
- of the messagepublic void addSynapseLibrary(java.lang.String name, Library library)
name
- of synapse liblibrary
- instancepublic java.util.Map<java.lang.String,Library> getSynapseLibraries()
public Library removeSynapseLibrary(java.lang.String name)
name
- of the libpublic void addSynapseImport(java.lang.String name, SynapseImport synImport)
name
- of synapse libsynImport
- instancepublic java.util.Map<java.lang.String,SynapseImport> getSynapseImports()
public SynapseImport removeSynapseImport(java.lang.String name)
name
- of the libpublic void setDescription(java.lang.String description)
setDescription
in interface SynapseArtifact
description
- tobe set to the artifactpublic java.lang.String getDescription()
getDescription
in interface SynapseArtifact
public SynapseArtifactDeploymentStore getArtifactDeploymentStore()
public java.util.Map<java.lang.String,java.lang.Object> getDecryptedCacheMap()
public org.apache.synapse.task.TaskManager getTaskManager()
public void setTaskManager(org.apache.synapse.task.TaskManager taskManager)
public void addEndpointTemplate(java.lang.String name, Template template)
public void updateEndpointTemplate(java.lang.String name, Template template)
public void removeEndpointTemplate(java.lang.String name)
public Template getEndpointTemplate(java.lang.String key)
public Mediator getDefaultConfiguration(java.lang.String key)
public boolean isAllowHotUpdate()
public void setAllowHotUpdate(boolean allowHotUpdate)
public java.util.List<java.lang.String> getCommentedTextList()
public void addToCommentedTextList(java.lang.String comment)
comment
- String commentpublic CompletedStructureStore getCompletedStructureStore()
public void reconstructAPITable()
Copyright © 2005-2021 Apache Software Foundation. All Rights Reserved.