Package org.wso2.carbon.event.core.subscription

Examples of org.wso2.carbon.event.core.subscription.Subscription


        try {
            if (username != null || remoteURL != null) {
               throw new UnsupportedOperationException("This method is no longer supported");
            } else {
                Subscription subscription = getSubscription(subscriptionId);
                Map<String, String> subscriptionData = subscription.getProperties();
                subscriptionData.remove(RegistryEventingConstants.NOT_VERIFIED);
                subscription.setProperties(subscriptionData);
                // The updated subscription should be directly done at the subMgr to avoid
                // generating another verification request
                subscription.setId(subscriptionId);
                Utils.getRegistryEventBrokerService().renewSubscription(subscription);
            }
            return email;
        } catch (Exception e) {
            log.error("Unable to verify e-mail address", e);
View Full Code Here


                String mediationServerURL = serverConfiguration.getFirstProperty(BAM_SERVER_URL);

                if (mediationServerURL != null) {
                    EventBroker eventBroker = PublisherUtils.getEventBroker();

                    Subscription subscription = new Subscription();
/*
                    EventFilter eventFilter = new EventFilter(null, null); //
                    subscription.setEventFilter(eventFilter);*/

                    subscription.setEventSinkURL(mediationServerURL + MDPublisherConstants.BMA_MEDIATION_STAT_RECEIVER_SERVICE);
                    subscription.setTopicName("carbon/bam/data/publishers/mediation_stats");

/*                    EventFilterDesc eventFilterDesc = new EventFilterDesc();
                    eventFilterDesc.setFilterValue("carbon/bam/data/publishers/mediation_stats");
                    subscription.setFilterDesc(eventFilterDesc);*/
                    try {
View Full Code Here

    public void testSOAP11EnvelopeToSubscription() throws Exception {
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP11Envelope();
        GetStatusCommandBuilder builder = new GetStatusCommandBuilder(mc);

        Subscription subscription = builder.toSubscription(
                CommandBuilderTestUtils.payloadToSOAP11Envelope(REQUEST_PAYLOAD_SOAP11));

        assertNotNull("The subscription object is null", subscription);
        assertEquals("Invalid subscription id", "uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa",
                subscription.getId());
    }
View Full Code Here

        assertEquals("Invalid subscription id", "uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa",
                subscription.getId());
    }

    public void testSubscriptionToSOAP12Envelope() throws Exception {
        Subscription subscription = new Subscription();
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
        GetStatusCommandBuilder builder = new  GetStatusCommandBuilder(mc);

        OMElement payload = builder.fromSubscription(subscription);
View Full Code Here

        assertEquals("Invalid response for the get status request", RESPONSE_PAYLOAD_SOAP12,
                payload.toString());
    }

    public void testSubscriptionToSOAP11Envelope() throws Exception {
        Subscription subscription = new Subscription();
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP11Envelope();
        GetStatusCommandBuilder builder = new  GetStatusCommandBuilder(mc);

        OMElement payload = builder.fromSubscription(subscription);
View Full Code Here

        assertEquals("Invalid response for the get status request", RESPONSE_PAYLOAD_SOAP11,
                payload.toString());
    }

    public void testSubscriptionToSOAP12EnvelopeWithTimeStamp() throws Exception {
        Subscription subscription = new Subscription();
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(12345678);
        subscription.setExpires(calendar);
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
        GetStatusCommandBuilder builder = new  GetStatusCommandBuilder(mc);

        OMElement payload = builder.fromSubscription(subscription);
View Full Code Here

        assertEquals("Invalid response for the get status request", RESPONSE_PAYLOAD_SOAP12_WITH_TIMESTAMP,
                payload.toString());
    }

    public void testSubscriptionToSOAP11EnvelopeWithTimeStamp() throws Exception {
        Subscription subscription = new Subscription();
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(12345678);
        subscription.setExpires(calendar);
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP11Envelope();
        GetStatusCommandBuilder builder = new  GetStatusCommandBuilder(mc);

        OMElement payload = builder.fromSubscription(subscription);
View Full Code Here

    public void testSOAP12EnvelopeToSubscription() throws Exception {
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
        UnSubscribeCommandBuilder builder = new UnSubscribeCommandBuilder(mc);

        Subscription subscription = builder.toSubscription(
                CommandBuilderTestUtils.payloadToSOAP12Envelope(REQUEST_PAYLOAD_SOAP12));

        assertNotNull("The subscription object is null", subscription);
        assertEquals("Invalid subscription id", "uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa",
                subscription.getId());
    }
View Full Code Here

    public void testSOAP11EnvelopeToSubscription() throws Exception {
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP11Envelope();
        UnSubscribeCommandBuilder builder = new UnSubscribeCommandBuilder(mc);

        Subscription subscription = builder.toSubscription(
                CommandBuilderTestUtils.payloadToSOAP11Envelope(REQUEST_PAYLOAD_SOAP11));

        assertNotNull("The subscription object is null", subscription);
        assertEquals("Invalid subscription id", "uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa",
                subscription.getId());
    }
View Full Code Here

        assertEquals("Invalid subscription id", "uuid:22e8a584-0d18-4228-b2a8-3716fa2097fa",
                subscription.getId());
    }

    public void testSubscriptionToSOAP12Envelope() throws Exception {
        Subscription subscription = new Subscription();
        MessageContext mc = CommandBuilderTestUtils.getMCWithSOAP12Envelope();
        UnSubscribeCommandBuilder builder = new  UnSubscribeCommandBuilder(mc);

        OMElement payload = builder.fromSubscription(subscription);
        System.out.println("[TODO] The UnSubscribe Response is not compatible with the WS-Eventing " +
View Full Code Here

TOP

Related Classes of org.wso2.carbon.event.core.subscription.Subscription

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.