Class SequenceAdmin


  • public class SequenceAdmin
    extends org.wso2.carbon.mediation.initializer.AbstractServiceBusAdmin
    Takes care of all the administration activities related to Sequences in the initialized synapse environment

    The administration activities include;

    • Adding sequences
    • Editing sequences
    • Saving sequence
    • Deleting sequences
    • Enabling/disabling statistics/tracing of sequences
    • Editing of dynamic sequences
    • and so on...
    • Constructor Detail

      • SequenceAdmin

        public SequenceAdmin()
    • 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 class org.wso2.carbon.core.AbstractAdmin
      • getConfigContext

        protected org.apache.axis2.context.ConfigurationContext getConfigContext()
        Overrides:
        getConfigContext in class org.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