Package org.apache.savan.eventing.subscribers

Examples of org.apache.savan.eventing.subscribers.EventingSubscriber


    protected void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    private Subscriber getSubscriber(Resource resource) throws Exception {
        EventingSubscriber subscriber = null;
        String content = null;
        OMElement payload = null;

        subscriber = new EventingSubscriber();

        if (config != null) {
            subscriber.setConfigurationContext(config.getConfigurationContext());
        }

        content = new String((byte[]) resource.getContent());
        payload = AXIOMUtil.stringToOM(content);

        subscriber.setEndToEPr(getEndToEpr(payload));
        subscriber.setDelivery(getDelivery(payload));
        subscriber.setFilter(getFilter(payload));
        subscriber.setId(getId(payload));
        subscriber.setSubscriptionEndingTime(getSubscriptionEndingTime(payload));

        return subscriber;
    }
View Full Code Here


        }
        return filter;
    }

    private Resource getResource(Subscriber subscriber, Registry registry) throws Exception {
        EventingSubscriber eventingSub = null;
        Resource resource = null;
        OMFactory factory = OMAbstractFactory.getOMFactory();
        OMElement payload = factory.createOMElement(SUBSCRIPTION, null);

        if (subscriber instanceof EventingSubscriber) {
            eventingSub = (EventingSubscriber) subscriber;
            addId(payload, eventingSub.getId());
            addSubscriptionEndingTime(payload, eventingSub.getSubscriptionEndingTime());
            if (eventingSub.getDelivery() != null) {
                addDelivery(payload, eventingSub.getDelivery());
            }
            if (eventingSub.getEndToEPr() != null) {
                addEndToEpr(payload, eventingSub.getEndToEPr());
            }
            if (eventingSub.getFilter() != null) {
                addFilter(payload, eventingSub.getFilter());
            }
            resource = registry.newResource();
            resource.setContent(payload.toString());
        }
View Full Code Here

    List<Subscription> subscriptions = null;

    subscriptions = new ArrayList<Subscription>();

    for (Iterator iter = retrieveAllSubscribers(); iter.hasNext();) {
      EventingSubscriber subscriber = (EventingSubscriber) iter.next();
      if (subscriber != null && subscriber.getId() != null) {
        subscriptions.add(getSubscription(subscriber));
      }
    }
    return subscriptions;
  }
View Full Code Here

TOP

Related Classes of org.apache.savan.eventing.subscribers.EventingSubscriber

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.