Examples of ICNSAttributesPersistence


Examples of com.comcast.cns.persistence.ICNSAttributesPersistence

     */
    public void doRetry() {
       
        try {
           
            ICNSAttributesPersistence attributePers = PersistenceFactory.getCNSAttributePersistence();
            CNSSubscriptionAttributes subAttr = attributePers.getSubscriptionAttributes(subArn);
           
            if (subAttr == null) {
                throw new CMBException(CMBErrorCodes.InternalError, "Could not get subscription delivery policy for subscripiton " + subArn);
            }
           
View Full Code Here

Examples of com.comcast.cns.persistence.ICNSAttributesPersistence

     */
    public void doRetry(IEndpointPublisher pub, CnsSubscriptionProtocol protocol, String endpoint, String subArn, boolean rawDelivery) {
       
        try {
           
            ICNSAttributesPersistence attributePers = PersistenceFactory.getCNSAttributePersistence();
            CNSSubscriptionAttributes subAttr = attributePers.getSubscriptionAttributes(subArn);
           
            if (subAttr == null) {
                throw new CMBException(CMBErrorCodes.InternalError, "Could not get subscription delivery policy for subscripiton " + subArn);
            }
           
View Full Code Here

Examples of com.comcast.cns.persistence.ICNSAttributesPersistence

  @Test
  public void testSubscribeListUnsubsribeTopic() {

    ICNSTopicPersistence topicHandler = new CNSTopicCassandraPersistence();
    ICNSAttributesPersistence attributeHandler = PersistenceFactory.getCNSAttributePersistence();
   
    String topicArn = null;

    try {

      String topicName = "T" + rand.nextLong();

      String userId1 = user1.getUserId();
      String userId2 = user2.getUserId();

      CNSTopic t = topicHandler.createTopic(topicName, topicName, userId2);
      topicArn = t.getArn();
     
      try {
                topicHandler.deleteTopic(topicArn); //delete any pre-existing state
            } catch (Exception e) { }
           
            t = topicHandler.createTopic(topicName, topicName, userId2);
            topicArn = t.getArn();

      ICNSSubscriptionPersistence subscriptionHandler = new CNSSubscriptionCassandraPersistence();
      long beforeSubscribeCount = subscriptionHandler.getCountSubscription(t.getArn(), "subscriptionPending");

      CNSSubscription s = subscriptionHandler.subscribe(CMBTestingConstants.HTTP_ENDPOINT_BASE_URL + "recv/1234", CnsSubscriptionProtocol.http, t.getArn(), userId1);

      long afterSubscribeCount = subscriptionHandler.getCountSubscription(t.getArn(), "subscriptionPending");
     
      // check default delivery policy on topic1
     
      CNSSubscriptionAttributes attributes = attributeHandler.getSubscriptionAttributes(s.getArn());
     
      assertTrue("Expected 3 retries in healthy policy, instead found " + attributes.getEffectiveDeliveryPolicy().getHealthyRetryPolicy().getNumRetries(), attributes.getEffectiveDeliveryPolicy().getHealthyRetryPolicy().getNumRetries() == 3);
     
      List<CNSSubscription> l = subscriptionHandler.listSubscriptions(null, null, userId1);
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.