Package org.apache.synapse.config

Examples of org.apache.synapse.config.SynapseConfiguration


    public AddressEndpointData getAddressEndpoint(String endpointName) throws EndpointAdminException {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (synapseConfiguration.getEndpoint(endpointName) != null) {
                AddressEndpoint add = (AddressEndpoint) synapseConfiguration.getEndpoint(endpointName);

                AddressEndpointData data = new AddressEndpointData();
                data.setEpName(add.getName());
                data.setAddress(add.getDefinition().getAddress());
                data.setEpType(ADDRESS_EP);
View Full Code Here


        }
        return null;
    }

    public DefaultEndpointData getDefaultEndpoint(String endpointName) throws EndpointAdminException {
                SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
        final Lock lock = getLock();
        try {
            lock.lock();
            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (synapseConfiguration.getEndpoint(endpointName) != null) {
                DefaultEndpoint add = (DefaultEndpoint) synapseConfiguration.getEndpoint(endpointName);

                DefaultEndpointData data = new DefaultEndpointData();
                data.setEpName(add.getName());
                data.setEpType(DEFAULT_EP);
                //data.setFormat(add.getDefinition().getFormat());
View Full Code Here

    public WSDLEndpointData getdlEndpoint(String endpointName) throws EndpointAdminException {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (synapseConfiguration.getEndpoint(endpointName) != null) {
                WSDLEndpoint wsdlEp = (WSDLEndpoint) synapseConfiguration.getEndpoint(endpointName);

                WSDLEndpointData data = new WSDLEndpointData();
                data.setEpName(wsdlEp.getName());
                data.setEpUri(wsdlEp.getWsdlURI());
                data.setEpServ(wsdlEp.getServiceName());
View Full Code Here

    public LoadBalanceEndpointData getLoadBalanceData(String endpointName) throws EndpointAdminException {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (synapseConfiguration.getEndpoint(endpointName) != null) {
                Endpoint ep = synapseConfiguration.getEndpoint(endpointName);

                if (ep instanceof SALoadbalanceEndpoint) {
                    LoadBalanceEndpointData epData = new LoadBalanceEndpointData();
                    SALoadbalanceEndpoint lb = (SALoadbalanceEndpoint) ep;
                    Dispatcher dispatcher = lb.getDispatcher();
View Full Code Here

    public TemplateEndpointData getTemplateEndpoint(String endpointName) throws EndpointAdminException{
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (synapseConfiguration.getEndpoint(endpointName) != null) {
                TemplateEndpoint add = (TemplateEndpoint) synapseConfiguration.getEndpoint(endpointName);
                TemplateEndpointData data = new TemplateEndpointData();
                data.setTargetTemplate(add.getTemplate());
                data.setParametersAsColonSepArray((getParametersAsColonSepArray(add.getParameters())));
                data.setEpType(TEMPLATE_EP);
                return data;
View Full Code Here

            assertNameNotEmpty(endpointName);
            endpointName = endpointName.trim();
            if (log.isDebugEnabled()) {
                log.debug("Deleting endpoint : " + endpointName + " from the configuration");
            }
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            Endpoint endpoint = synapseConfiguration.getDefinedEndpoints().get(endpointName);
            synapseConfiguration.removeEndpoint(endpointName);
            MediationPersistenceManager pm = getMediationPersistenceManager();
            String fileName = null;
            if (endpoint instanceof AbstractEndpoint) {
                fileName = endpoint.getFileName();
            }
View Full Code Here

    public String getDynamicEndpoint(String key) throws Exception {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleFault("No resource is available by the key '" + key + "'", null);
                }
            } else {
                handleFault("Unable to access the registry instance for the ESB", null);
            }
            OMElement e = null;
            if (registry != null) {
                e = (OMElement) registry.getResource(new Entry(key), synConfig.getProperties());
            }
            if (e != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Found dynamic endpoint " + key);
                }
View Full Code Here

    public OMElement getTemplate(String templateName) throws AxisFault {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synapseConfiguration = getSynapseConfiguration();
            Template template = synapseConfiguration.getEndpointTemplate(templateName);
            if (template != null) {
                OMElement parentElement = null;
//                String dummyParentEl = "<" + "parent xmlns=\"" + SynapseConstants.SYNAPSE_NAMESPACE + "\"" + "/" + ">";
//                parentElement = AXIOMUtil.stringToOM(dummyParentEl);
//                return new TemplateSerializer().serializeEndpointTemplate(template, parentElement).getFirstElement();
View Full Code Here

    public void deleteEndpointTemplate(String templateName) throws AxisFault {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synCfg = getSynapseConfiguration();
            Template sequence = synCfg.getEndpointTemplates().get(templateName);
            if (sequence != null) {
                synCfg.removeEndpointTemplate(templateName);
                MediationPersistenceManager pm = getMediationPersistenceManager();
                pm.deleteItem(templateName, sequence.getFileName(),
                              ServiceBusConstants.ITEM_TYPE_TEMPLATE_ENDPOINTS);
            } else {
                handleException("No defined endpoint template with name " + templateName
View Full Code Here

            lock.unlock();
        }
    }

    public void deleteDynamicEndpointTemplate(String key) throws AxisFault {
        SynapseConfiguration synConfig = getSynapseConfiguration();
        Registry registry = synConfig.getRegistry();
        if (registry != null) {
            if (registry.getRegistryEntry(key).getType() == null) {
                handleException("The key '" + key +
                        "' cannot be found within the configuration");
            } else {
View Full Code Here

TOP

Related Classes of org.apache.synapse.config.SynapseConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.