Class SequenceAdmin
- java.lang.Object
-
- org.wso2.carbon.core.AbstractAdmin
-
- org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
-
- org.wso2.carbon.sequences.services.SequenceAdmin
-
public class SequenceAdmin extends org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
Takes care of all the administration activities related toSequences
in the initialized synapse environmentThe administration activities include;
- Adding sequences
- Editing sequences
- Saving sequence
- Deleting sequences
- Enabling/disabling statistics/tracing of sequences
- Editing of dynamic sequences
- and so on...
-
-
Field Summary
Fields Modifier and Type Field Description static String
WSO2_SEQUENCE_MEDIA_TYPE
-
Constructor Summary
Constructors Constructor Description SequenceAdmin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDynamicSequence(String key, org.apache.axiom.om.OMElement sequence)
void
addSequence(org.apache.axiom.om.OMElement sequenceElement)
Add a sequence into the synapseConfigurationvoid
addSequenceForTenant(org.apache.axiom.om.OMElement sequenceElement, String tenantDomain)
Set the tenant domain when a publisher deploys custom sequences in MT mode.void
deleteAllSequence()
Delete all the sequences in the synapse configurationvoid
deleteDynamicSequence(String key)
void
deleteSelectedSequence(String[] sequenceNames)
Delete Selected Sequence in the synapse configurationvoid
deleteSequence(String sequenceName)
Deletes the sequence with the given name from SynapseConfigurationvoid
deleteSequenceForTenant(String sequenceName, String tenantDomain)
Set the tenant domain when a publisher deletes custom sequences in MT mode.String
disableStatistics(String sequenceName)
String
disableTracing(String sequenceName)
String
enableStatistics(String sequenceName)
String
enableTracing(String sequenceName)
protected org.apache.axis2.engine.AxisConfiguration
getAxisConfig()
Override the AbstarctAdmin.java's getAxisConfig() to create the CarbonContext from ThreadLoaclContext.protected org.apache.axis2.context.ConfigurationContext
getConfigContext()
org.wso2.carbon.sequences.common.to.ConfigurationObject[]
getDependents(String sequence)
org.apache.axiom.om.OMElement
getDynamicSequence(String key)
int
getDynamicSequenceCount()
org.wso2.carbon.sequences.common.to.SequenceInfo[]
getDynamicSequences(int pageNumber, int sequencePerPage)
String
getEntryNamesString()
org.apache.axiom.om.OMElement
getSequence(String sequenceName)
Returns the OMelement representation of the sequence given by sequence nameorg.apache.axiom.om.OMElement
getSequenceForTenant(String sequenceName, String tenantDomain)
Set the tenant domain when a publisher tries to get custom sequences in MT mode.org.wso2.carbon.sequences.common.to.SequenceInfo[]
getSequences(int pageNumber, int sequencePerPage)
int
getSequencesCount()
org.wso2.carbon.sequences.common.to.SequenceInfo[]
getSequencesSearch(String searchText)
boolean
isExistingSequence(String sequenceName)
boolean
isExistingSequenceForTenant(String sequenceName, String tenantDomain)
void
saveDynamicSequence(String key, org.apache.axiom.om.OMElement sequence)
void
saveSequence(org.apache.axiom.om.OMElement sequenceElement)
Saves the sequence described with the sequence stringvoid
updateDynamicSequence(String key, org.apache.axiom.om.OMElement omElement)
-
Methods inherited from class org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
getLock, getMediationPersistenceManager, getServerConfigurationInformation, getServerContextInformation, getSynapseConfiguration, getSynapseEnvironment, getSynapseEnvironment, lockSynapseConfiguration, unlockSynapseConfiguration
-
Methods inherited from class org.wso2.carbon.core.AbstractAdmin
getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUserId, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
-
-
-
-
Field Detail
-
WSO2_SEQUENCE_MEDIA_TYPE
public static final String WSO2_SEQUENCE_MEDIA_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSequences
public org.wso2.carbon.sequences.common.to.SequenceInfo[] getSequences(int pageNumber, int sequencePerPage) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getSequencesCount
public int getSequencesCount() throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getDynamicSequences
public org.wso2.carbon.sequences.common.to.SequenceInfo[] getDynamicSequences(int pageNumber, int sequencePerPage) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getDynamicSequenceCount
public int getDynamicSequenceCount() throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
deleteSequence
public void deleteSequence(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
Deletes the sequence with the given name from SynapseConfiguration- Parameters:
sequenceName
- - Name of the sequence to delete- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
- if the Sequence described by the given name doesn't exist in the Synapse Configuration
-
deleteSequenceForTenant
public void deleteSequenceForTenant(String sequenceName, String tenantDomain) throws org.wso2.carbon.sequences.common.SequenceEditorException
Set the tenant domain when a publisher deletes custom sequences in MT mode. When publisher deletes the sequence, we login the gateway as supertenant. But we need to delete in the particular tenant domain.- Parameters:
sequenceName
-tenantDomain
-- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
deleteSelectedSequence
public void deleteSelectedSequence(String[] sequenceNames) throws org.wso2.carbon.sequences.common.SequenceEditorException
Delete Selected Sequence in the synapse configuration- Parameters:
sequenceNames
-- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
deleteAllSequence
public void deleteAllSequence() throws org.wso2.carbon.sequences.common.SequenceEditorException
Delete all the sequences in the synapse configuration- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getSequence
public org.apache.axiom.om.OMElement getSequence(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
Returns the OMelement representation of the sequence given by sequence name- Parameters:
sequenceName
- - name of the sequence to get- Returns:
- OMElement representing the SequenceMediator of the given sequence name
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
- if any error occured while getting the data from the SynapseConfiguration
-
getSequenceForTenant
public org.apache.axiom.om.OMElement getSequenceForTenant(String sequenceName, String tenantDomain) throws org.wso2.carbon.sequences.common.SequenceEditorException
Set the tenant domain when a publisher tries to get custom sequences in MT mode. When publisher tries to get the sequence, we login the gateway as supertenant. But we need to get in the particular tenant domain.- Parameters:
sequenceName
-tenantDomain
-- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
addSequence
public void addSequence(org.apache.axiom.om.OMElement sequenceElement) throws org.wso2.carbon.sequences.common.SequenceEditorException
Add a sequence into the synapseConfiguration- Parameters:
sequenceElement
- - Sequence object to be added as an OMElement- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
- if a sequence exists with the same name or if the element provided is not a Sequence element
-
addSequenceForTenant
public void addSequenceForTenant(org.apache.axiom.om.OMElement sequenceElement, String tenantDomain) throws org.wso2.carbon.sequences.common.SequenceEditorException
Set the tenant domain when a publisher deploys custom sequences in MT mode. When publisher deploys the sequence, we login the gateway as supertenant. But we need to deploy in the particular tenant domain.- Parameters:
sequenceElement
-tenantDomain
-- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
isExistingSequence
public boolean isExistingSequence(String sequenceName)
-
isExistingSequenceForTenant
public boolean isExistingSequenceForTenant(String sequenceName, String tenantDomain)
-
saveSequence
public void saveSequence(org.apache.axiom.om.OMElement sequenceElement) throws org.wso2.carbon.sequences.common.SequenceEditorException
Saves the sequence described with the sequence string- Parameters:
sequenceElement
- - String representing the XML describing the Sequence- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
- if the sequence name already exists or if the string doesn't represent a Sequence element
-
enableStatistics
public String enableStatistics(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
disableStatistics
public String disableStatistics(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
enableTracing
public String enableTracing(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
disableTracing
public String disableTracing(String sequenceName) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getEntryNamesString
public String getEntryNamesString() throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
updateDynamicSequence
public void updateDynamicSequence(String key, org.apache.axiom.om.OMElement omElement) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
deleteDynamicSequence
public void deleteDynamicSequence(String key) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
addDynamicSequence
public void addDynamicSequence(String key, org.apache.axiom.om.OMElement sequence) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getDynamicSequence
public org.apache.axiom.om.OMElement getDynamicSequence(String key) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
saveDynamicSequence
public void saveDynamicSequence(String key, org.apache.axiom.om.OMElement sequence) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
getDependents
public org.wso2.carbon.sequences.common.to.ConfigurationObject[] getDependents(String sequence)
-
getAxisConfig
protected org.apache.axis2.engine.AxisConfiguration getAxisConfig()
Override the AbstarctAdmin.java's getAxisConfig() to create the CarbonContext from ThreadLoaclContext. We do this to support, publishing APIs as a supertenant but want to deploy that in tenant space. (This model is needed for APIManager)- Overrides:
getAxisConfig
in classorg.wso2.carbon.core.AbstractAdmin
-
getConfigContext
protected org.apache.axis2.context.ConfigurationContext getConfigContext()
- Overrides:
getConfigContext
in classorg.wso2.carbon.core.AbstractAdmin
-
getSequencesSearch
public org.wso2.carbon.sequences.common.to.SequenceInfo[] getSequencesSearch(String searchText) throws org.wso2.carbon.sequences.common.SequenceEditorException
- Throws:
org.wso2.carbon.sequences.common.SequenceEditorException
-
-