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.AbstractServiceBusAdminTakes care of all the administration activities related toSequencesin 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 StringWSO2_SEQUENCE_MEDIA_TYPE
-
Constructor Summary
Constructors Constructor Description SequenceAdmin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDynamicSequence(String key, org.apache.axiom.om.OMElement sequence)voidaddSequence(org.apache.axiom.om.OMElement sequenceElement)Add a sequence into the synapseConfigurationvoidaddSequenceForTenant(org.apache.axiom.om.OMElement sequenceElement, String tenantDomain)Set the tenant domain when a publisher deploys custom sequences in MT mode.voiddeleteAllSequence()Delete all the sequences in the synapse configurationvoiddeleteDynamicSequence(String key)voiddeleteSelectedSequence(String[] sequenceNames)Delete Selected Sequence in the synapse configurationvoiddeleteSequence(String sequenceName)Deletes the sequence with the given name from SynapseConfigurationvoiddeleteSequenceForTenant(String sequenceName, String tenantDomain)Set the tenant domain when a publisher deletes custom sequences in MT mode.StringdisableStatistics(String sequenceName)StringdisableTracing(String sequenceName)StringenableStatistics(String sequenceName)StringenableTracing(String sequenceName)protected org.apache.axis2.engine.AxisConfigurationgetAxisConfig()Override the AbstarctAdmin.java's getAxisConfig() to create the CarbonContext from ThreadLoaclContext.protected org.apache.axis2.context.ConfigurationContextgetConfigContext()org.wso2.carbon.sequences.common.to.ConfigurationObject[]getDependents(String sequence)org.apache.axiom.om.OMElementgetDynamicSequence(String key)intgetDynamicSequenceCount()org.wso2.carbon.sequences.common.to.SequenceInfo[]getDynamicSequences(int pageNumber, int sequencePerPage)StringgetEntryNamesString()org.apache.axiom.om.OMElementgetSequence(String sequenceName)Returns the OMelement representation of the sequence given by sequence nameorg.apache.axiom.om.OMElementgetSequenceForTenant(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)intgetSequencesCount()org.wso2.carbon.sequences.common.to.SequenceInfo[]getSequencesSearch(String searchText)booleanisExistingSequence(String sequenceName)booleanisExistingSequenceForTenant(String sequenceName, String tenantDomain)voidsaveDynamicSequence(String key, org.apache.axiom.om.OMElement sequence)voidsaveSequence(org.apache.axiom.om.OMElement sequenceElement)Saves the sequence described with the sequence stringvoidupdateDynamicSequence(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.SequenceEditorExceptionDelete 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.SequenceEditorExceptionAdd 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.SequenceEditorExceptionSet 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.SequenceEditorExceptionSaves 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:
getAxisConfigin classorg.wso2.carbon.core.AbstractAdmin
-
getConfigContext
protected org.apache.axis2.context.ConfigurationContext getConfigContext()
- Overrides:
getConfigContextin 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
-
-