Examples of Subscription


Examples of org.uddi.sub_v3.Subscription

    deleteSubscription(authInfo, SUBSCRIPTION_KEY);
  }
 
  public void saveSubscription(String authInfo, String subscriptionXML, String subscriptionKey) {
    try {
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(subscriptionXML, "org.uddi.sub_v3");
      List<Subscription> subscriptionList = new ArrayList<Subscription>();
      subscriptionList.add(subIn);
      Holder<List<Subscription>> subscriptionHolder = new Holder<List<Subscription>>();
      subscriptionHolder.value = subscriptionList;
     
      subscription.saveSubscription(authInfo, subscriptionHolder);
     
      Subscription subDirectOut = subscriptionHolder.value.get(0);
      assertEquals(subIn.getSubscriptionKey(), subDirectOut.getSubscriptionKey());
     
      List<Subscription> outSubscriptionList = subscription.getSubscriptions(authInfo);
      Assert.assertNotNull(outSubscriptionList);
      Subscription subOut = outSubscriptionList.get(0);
     
      assertEquals(subIn.getSubscriptionKey(), subOut.getSubscriptionKey());
      assertEquals(subDirectOut.getExpiresAfter().getMonth(), subOut.getExpiresAfter().getMonth());
      assertEquals(subDirectOut.getExpiresAfter().getDay(), subOut.getExpiresAfter().getDay());
      assertEquals(subDirectOut.getExpiresAfter().getYear(), subOut.getExpiresAfter().getYear());
     
      //assertEquals(subIn.getSubscriptionFilter().getFindService().getName().get(0).getValue(),
      //       subOut.getSubscriptionFilter().getFindService().getName().get(0).getValue());
     
    } catch (Exception e) {
View Full Code Here

Examples of org.wso2.carbon.account.mgt.stub.services.beans.xsd.Subscription

        return true;
    }

    public String getUsagePlanName(String tenantName) throws Exception{
        Customer customer;
        Subscription subscription;
        try {
            customer = stub.getCustomerWithName(tenantName);
            if(customer!=null){
                subscription=stub.getActiveSubscriptionOfCustomer(customer.getId());
                if(subscription!=null){
                    return subscription.getSubscriptionPlan();
                }else{
                    return new String("");
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.wso2.carbon.billing.core.dataobjects.Subscription

            endDate = new Date();
        }

        Iterator iterator = subscriptions.iterator();
        while(iterator.hasNext()){
            Subscription subscription = (Subscription) iterator.next();
            if(!subscription.isActive() && subscription.getActiveUntil().after(endDate)){
                iterator.remove();
            }
        }

        // prepare the handler context
        log.debug("Adding subscriptions to the handler context: " + subscriptions.size());
        handlerContext.setSubscriptions(subscriptions);

        // resetting the single customer back from the fed data
        if (customer != null && subscriptions != null && subscriptions.size() != 0) {
            Subscription subscription = subscriptions.get(0);
            handlerContext.setCustomer(subscription.getCustomer());
        }
    }
View Full Code Here

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

            if (userRegistry.resourceExists(this.indexStoragePath)) {
                Resource topicIndexResource = userRegistry.get(this.indexStoragePath);
                Properties savedSubscriptions = topicIndexResource.getProperties();

                Resource subscriptionResource = null;
                Subscription subscription = null;
                String subscriptionID = null;
                String topicName = null;
                for (Enumeration e = savedSubscriptions.propertyNames(); e.hasMoreElements();) {
                    subscriptionID = (String) e.nextElement();
                    // when the registry is remotely mount to antoher registry. then registry automatically added
                    // some propertiest stary with registry we need to skip them.
                    if (!subscriptionID.startsWith("registry")) {
                        topicName = topicIndexResource.getProperty(subscriptionID);
                        subscriptionResource = userRegistry.get(getResourcePath(subscriptionID, topicName));
                        subscription = JavaUtil.getSubscription(subscriptionResource);
                        subscription.setId(subscriptionID);
                        subscription.setTopicName(topicName);
                        subscription.setTenantId(EventBrokerHolder.getInstance().getTenantId());
                        subscriptions.add(subscription);
                    }
                }
            }
View Full Code Here

Examples of org.wso2.event.Subscription

    public Subscription toSubscription(SOAPEnvelope envelope) throws InvalidMessageException {
        if (envelope == null) {
            log.error("No SOAP envelope was provided.");
            throw new BuilderException("No SOAP envelope was provided.");
        }
        Subscription subscription = new Subscription();
        OMElement elem = null;
        if (envelope.getHeader() != null) {
            elem = envelope.getHeader().getFirstChildWithName(IDENTIFIER);
        }
        if (elem == null) {
            log.error(
                    "Subscription Identifier is required as a header of the subscription message.");
            throw new InvalidMessageException(
                    "Subscription Identifier is required as a header of the subscription message.");
        }
        String id = elem.getText().trim();
        subscription.setId(id);

        return subscription;
    }
View Full Code Here

Examples of org.wso2.eventing.Subscription

     * @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

Examples of org.wso2.eventing.Subscription

            // 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

Examples of rx.Subscription

            @Override
            public void onNext(Object t) {

            }
        };
        sub.add(new Subscription() {
            volatile boolean subscribed = true;

            @Override
            public void unsubscribe() {
                subscribed = false;
View Full Code Here

Examples of talkfeed.data.Subscription

  public boolean removeUserSubscription(long id) {

    DataManager dm = DataManagerFactory.getInstance();
    PersistenceManager pm = dm.newPersistenceManager();

    Subscription s = pm.getObjectById(Subscription.class, new Long(id));
    pm.currentTransaction().begin();
    pm.deletePersistent(s);
    pm.currentTransaction().commit();
    pm.flush();
View Full Code Here

Examples of talkfeed.data.Subscription

      TalkService.sendMessage(user.getId(),"blog not found ! :(");
      return;
    }
   
    //check subscription
    Subscription sub = dataManager.getSubscription(pm , user, blog);
   
    //create new subscription
    if (sub == null){
      sub = new Subscription();
      sub.setBlogKey(blog.getKey());
      sub.setPriority(0);
      sub.setUserKey(user.getKey());
      sub.setLastProcessDate(new Date());
      sub.setLatestEntryNotifiedDate(new Date());
     
      pm.currentTransaction().begin();
      pm.makePersistent(sub);
      pm.currentTransaction().commit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.