Package org.wso2.carbon.endpoint.common.to

Examples of org.wso2.carbon.endpoint.common.to.DefaultEndpointData


    }

    public static DefaultEndpointData getDefaultEpFromSynEp(DefaultEndpoint def,
                                                            HttpSession session,
                                                            boolean isAnonymos) {
        DefaultEndpointData data = new DefaultEndpointData();
        // assigns no name if epMode is anon
        String epMode;
        if (isAnonymos) {
            data.setEpName("");
        } else {
            data.setEpName(def.getName());
        }
        data.setDescription(def.getDescription());
        data.setEpType(0);
        //data.setFormat(def.getDefinition().getFormat());
        data.setSoap11(def.getDefinition().isForceSOAP11());
        data.setSoap12(def.getDefinition().isForceSOAP12());
        data.setGet(def.getDefinition().isForceGET());
        data.setRest(def.getDefinition().isForceREST());
        data.setPox(def.getDefinition().isForcePOX());
        data.setSwa(def.getDefinition().isUseSwa());
        data.setMtom(def.getDefinition().isUseMTOM());
        data.setSuspendDurationOnFailure(def.getDefinition().getInitialSuspendDuration());
        data.setTimeoutAct(def.getDefinition().getTimeoutAction());
        data.setTimeoutActionDur(def.getDefinition().getTimeoutDuration());
        data.setWsadd(def.getDefinition().isAddressingOn());
        data.setSepList(def.getDefinition().isUseSeparateListener());
        data.setWssec(def.getDefinition().isSecurityOn());
        data.setWsrm(def.getDefinition().isReliableMessagingOn());
        data.setRmPolKey(def.getDefinition().getWsRMPolicyKey());
        data.setSecPolKey(def.getDefinition().getWsSecPolicyKey());
        data.setMaxSusDuration(def.getDefinition().getSuspendMaximumDuration());
        data.setSusProgFactor(def.getDefinition().getSuspendProgressionFactor());
        data.setErrorCodes(errorCodeListBuilder(def.getDefinition().getSuspendErrorCodes()).trim());
        data.setTimdedOutErrorCodes(errorCodeListBuilder(def.getDefinition().getTimeoutErrorCodes()));
        data.setRetryTimeout(def.getDefinition().getRetryDurationOnTimeout());
        data.setRetryDelay(def.getDefinition().getRetriesOnTimeoutBeforeSuspend());
        return data;
    }
View Full Code Here


        }
        return data;
    }

    public static DefaultEndpointData getDefaultEndpoint(Template template) throws Exception{
        DefaultEndpointData data = new DefaultEndpointData();
        data.setEpName(template.getName()+"_endpoint");
        data.setEpType(1);
        return data;
    }
View Full Code Here

     * @param epName endpoint name
     * @return address endpoint data of the endpoint
     * @throws Exception incase of an error
     */
    public DefaultEndpointData getDefaultEndpoint(String epName) throws Exception {
        DefaultEndpointData data = new DefaultEndpointData();
        try {
            org.wso2.carbon.endpoint.stub.types.common.to.DefaultEndpointData tempData
                    = stub.getDefaultEndpoint(epName);
            data.setEpName(tempData.getEpName());
            data.setEpType(tempData.getEpType());
            data.setErrorCodes(tempData.getErrorCodes());
            data.setFormat(tempData.getErrorCodes());
            data.setMaxSusDuration(tempData.getMaxSusDuration());
            data.setMtom(tempData.getMtom());
            data.setPox(tempData.getPox());
            data.setRest(tempData.getRest());
            data.setGet(tempData.getGet());
            data.setRetryDelay(tempData.getRetryDelay());
            data.setRetryTimeout(tempData.getRetryTimeout());
            data.setRmPolKey(tempData.getRmPolKey());
            data.setSecPolKey(tempData.getSecPolKey());
            data.setSepList(tempData.getSepList());
            data.setSoap11(tempData.getSoap11());
            data.setSoap12(tempData.getSoap12());
            data.setSuspendDurationOnFailure(tempData.getSuspendDurationOnFailure());
            data.setSusProgFactor(tempData.getSusProgFactor());
            data.setSwa(tempData.getSwa());
            data.setTimdedOutErrorCodes(tempData.getTimdedOutErrorCodes());
            data.setTimeoutAct(tempData.getTimeoutAct());
            data.setTimeoutActionDur(tempData.getTimeoutActionDur());
            data.setWsadd(tempData.getWsadd());
            data.setWsrm(tempData.getWsrm());
            data.setWssec(tempData.getWssec());
            data.setRetryDisabledErrorCodes(tempData.getRetryDisabledErrorCodes());
            data.setDescription(tempData.getDescription());
            data.setProperties(tempData.getProperties());
        } catch (Exception e) {
            handleFault(e);
        }
        return data;
    }
View Full Code Here

        epData.setDescription(ep.getDescription());
        return epData;
    }

    public static DefaultEndpointData populateDefaultEndpointData(DefaultEndpoint ep) {
        DefaultEndpointData epData = new DefaultEndpointData();
        epData.setEpName((ep.getName().equals("anonymous") ? "" : ep.getName()));
        epData.setEpType(DEFAULT_EP);
        epData.setSoap11(ep.getDefinition().isForceSOAP11());
        epData.setSoap12(ep.getDefinition().isForceSOAP12());
        epData.setRest(ep.getDefinition().isForceGET());
        epData.setPox(ep.getDefinition().isForcePOX());
        epData.setSwa(ep.getDefinition().isUseSwa());
        epData.setMtom(ep.getDefinition().isUseMTOM());
        epData.setSuspendDurationOnFailure(ep.getDefinition().getInitialSuspendDuration());
        epData.setTimeoutAct(ep.getDefinition().getTimeoutAction());
        epData.setTimeoutActionDur(ep.getDefinition().getTimeoutDuration());
        epData.setWsadd(ep.getDefinition().isAddressingOn());
        epData.setSepList(ep.getDefinition().isUseSeparateListener());
        epData.setWssec(ep.getDefinition().isSecurityOn());
        epData.setWsrm(ep.getDefinition().isReliableMessagingOn());
        epData.setRmPolKey(ep.getDefinition().getWsRMPolicyKey());
        epData.setSecPolKey(ep.getDefinition().getWsSecPolicyKey());
        epData.setMaxSusDuration(ep.getDefinition().getSuspendMaximumDuration());
        epData.setSusProgFactor(ep.getDefinition().getSuspendProgressionFactor());
        epData.setErrorCodes(errorCodeListBuilder(ep.getDefinition().getSuspendErrorCodes()).trim());
        epData.setTimdedOutErrorCodes(errorCodeListBuilder(ep.getDefinition().getTimeoutErrorCodes()));
        epData.setRetryTimeout(ep.getDefinition().getRetriesOnTimeoutBeforeSuspend());
        epData.setRetryDelay(ep.getDefinition().getRetryDurationOnTimeout());
        epData.setProperties(buildPropertyString(ep));
        epData.setDescription(ep.getDescription());
        return epData;
    }
View Full Code Here

        OMElement endpointEl = template.getElement();
        if (endpointEl != null) {
            Endpoint endpoint = EndpointFactory.getEndpointFromElement(endpointEl, factory, false, new Properties());
            if(endpoint!=null && endpoint instanceof DefaultEndpoint){
                DefaultEndpoint add = (DefaultEndpoint) endpoint;
                DefaultEndpointData data = new DefaultEndpointData();
                data.setEpName(add.getName());
                data.setEpType(DEFAULT_EP);
                //data.setFormat(add.getDefinition().getFormat());
                data.setSoap11(add.getDefinition().isForceSOAP11());
                data.setSoap12(add.getDefinition().isForceSOAP12());
                data.setRest(add.getDefinition().isForceGET());
                data.setPox(add.getDefinition().isForcePOX());
                data.setSwa(add.getDefinition().isUseSwa());
                data.setMtom(add.getDefinition().isUseMTOM());
                data.setSuspendDurationOnFailure(add.getDefinition().getInitialSuspendDuration());
                data.setTimeoutAct(add.getDefinition().getTimeoutAction());
                data.setTimeoutActionDur(add.getDefinition().getTimeoutDuration());
                data.setWsadd(add.getDefinition().isAddressingOn());
                data.setSepList(add.getDefinition().isUseSeparateListener());
                data.setWssec(add.getDefinition().isSecurityOn());
                data.setWsrm(add.getDefinition().isReliableMessagingOn());
                data.setRmPolKey(add.getDefinition().getWsRMPolicyKey());
                data.setSecPolKey(add.getDefinition().getWsSecPolicyKey());
                data.setMaxSusDuration(add.getDefinition().getSuspendMaximumDuration());
                data.setSusProgFactor(add.getDefinition().getSuspendProgressionFactor());
                data.setErrorCodes(errorCodeListBuilder(add.getDefinition().getSuspendErrorCodes()).trim());
                data.setRetryDisabledErrorCodes(errorCodeListBuilder(add.getDefinition().
                        getRetryDisabledErrorCodes()).trim());
                data.setTimdedOutErrorCodes(errorCodeListBuilder(add.getDefinition().getTimeoutErrorCodes()));
                data.setRetryTimeout(add.getDefinition().getRetryDurationOnTimeout());
                data.setRetryDelay(add.getDefinition().getRetriesOnTimeoutBeforeSuspend());

                return data;

            }
        }
View Full Code Here

        }

        public void run() {
            try {
                MessageContext msgCtx = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
                Event<MessageContext> event = new Event(msgCtx);
                subscriptions = subscriptionManager.getMatchingSubscriptions(event);
            } catch (EventException e) {
                handleException("Matching subscriptions fetching error", e);
            }
View Full Code Here

     * @throws EventException event
     */
    private void processGetStatusRequest(MessageContext mc,
                                         ResponseMessageBuilder messageBuilder)
            throws AxisFault, EventException {
        Subscription subscription =
                SubscriptionMessageBuilder.createGetStatusMessage(mc);
        if (log.isDebugEnabled()) {
            log.debug("GetStatus request recived for SynapseSubscription ID : " +
                    subscription.getId());
        }
        subscription = subscriptionManager.getSubscription(subscription.getId());
        if (subscription != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for SynapseSubscription ID : " +
                        subscription.getId());
            }
            //send the responce
            SOAPEnvelope soapEnvelope = messageBuilder.genGetStatusResponse(subscription);
            dispatchResponse(soapEnvelope, EventingConstants.WSE_GET_STATUS_RESPONSE,
                    mc, false);
View Full Code Here

            // Adding static subscriptions
            List<Subscription> staticSubscriptionList =
                    eventSource.getSubscriptionManager().getStaticSubscriptions();
            for (Iterator<Subscription> iterator = staticSubscriptionList.iterator();
                 iterator.hasNext();) {
                Subscription staticSubscription = iterator.next();
                OMElement staticSubElem =
                        fac.createOMElement("subscription", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                staticSubElem.addAttribute(
                        fac.createOMAttribute("id", nullNS, staticSubscription.getId()));
                OMElement filterElem =
                        fac.createOMElement("filter", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                filterElem.addAttribute(fac.createOMAttribute("source", nullNS,
                        (String) staticSubscription.getFilterValue()));
                filterElem.addAttribute(fac.createOMAttribute("dialect", nullNS,
                        (String) staticSubscription.getFilterDialect()));
                staticSubElem.addChild(filterElem);
                OMElement endpointElem =
                        fac.createOMElement("endpoint", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                OMElement addressElem =
                        fac.createOMElement("address", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                addressElem.addAttribute(
                        fac.createOMAttribute("uri", nullNS, staticSubscription.getEndpointUrl()));
                endpointElem.addChild(addressElem);
                staticSubElem.addChild(endpointElem);
                if (staticSubscription.getExpires() != null) {
                    OMElement expiresElem =
                            fac.createOMElement("expires", XMLConfigConstants.SYNAPSE_OMNAMESPACE);
                    fac.createOMText(expiresElem,
                            ConverterUtil.convertToString(staticSubscription.getExpires()));
                    staticSubElem.addChild(expiresElem);
                }
                evenSourceElem.addChild(staticSubElem);
            }
View Full Code Here


    public SynapseSubscription() {
        this.setId(UIDGenerator.generateURNString());
        this.setDeliveryMode(EventingConstants.WSE_DEFAULT_DELIVERY_MODE);
        SubscriptionData subscriptionData = new SubscriptionData();
        subscriptionData.setProperty(SynapseEventingConstants.STATIC_ENTRY, "false");
        this.setSubscriptionData(subscriptionData);
    }
View Full Code Here

                    .getAttribute(new QName(XMLConfigConstants.NULL_NAMESPACE, "class"));
            if (clazz != null) {
                String className = clazz.getAttributeValue();
                try {
                    Class subscriptionManagerClass = Class.forName(className);
                    SubscriptionManager manager =
                            (SubscriptionManager) subscriptionManagerClass.newInstance();
                    Iterator itr = subscriptionManagerElem.getChildrenWithName(PROPERTIES_QNAME);
                    while (itr.hasNext()) {
                        OMElement propElem = (OMElement) itr.next();
                        String propName =
                                propElem.getAttribute(new QName("name")).getAttributeValue();
                        String propValue =
                                propElem.getAttribute(new QName("value")).getAttributeValue();
                        if (propName != null && !"".equals(propName.trim()) &&
                                propValue != null && !"".equals(propValue.trim())) {

                            propName = propName.trim();
                            propValue = propValue.trim();

                            PasswordManager passwordManager =
                                    PasswordManager.getInstance();
                            String key = eventSource.getName() + "." + propName;

                            if (passwordManager.isInitialized()
                                    && passwordManager.isTokenProtected(key)) {
                                eventSource.putConfigurationProperty(propName, propValue);
                                propValue = passwordManager.resolve(propValue);
                            }

                            manager.addProperty(propName, propValue);
                        }
                    }
                    eventSource.setSubscriptionManager(manager);
                    eventSource.getSubscriptionManager()
                            .init(); // Initialise before doing further processing, required for static subscriptions
View Full Code Here

TOP

Related Classes of org.wso2.carbon.endpoint.common.to.DefaultEndpointData

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.