Package com.datasift.client.push

Examples of com.datasift.client.push.PushSubscription


        assertTrue(validation.isSuccessful());
    }

    @Test
    public void testIfUserCanCreateSubscription() {
        PushSubscription create = datasift.push().create(s3, stream, name).sync();
        assertTrue(create.isSuccessful());

        assertEquals(create.getId(), id);
        assertEquals(create.getOutputType().value(), output_type);
        assertEquals(create.name(), name);
        assertEquals(create.getCreatedAt(), created_at);
        assertEquals(create.getUserId(), user_id);
        assertEquals(create.hash(), hash);
        assertEquals(create.getHashType(), hash_type);
        assertEquals(create.getLastRequest(), last_request);
        assertEquals(create.getLastSuccess(), last_success);
        assertEquals(create.getRemainingBytes(), remaining_bytes);
        assertEquals(create.isLostData(), lost_data);
        assertEquals(create.getStart(), start);
        assertEquals(create.getEnd(), end);
    }
View Full Code Here


        assertEquals(create.getEnd(), end);
    }

    @Test
    public void testIfUserCanPauseSubscriprion() {
        PushSubscription pause = datasift.push().pause(id).sync();
        assertTrue(pause.isSuccessful());

        assertEquals(pause.getId(), id);
        assertEquals(pause.getOutputType().value(), output_type);
        assertEquals(pause.name(), name);
        assertEquals(pause.getCreatedAt(), created_at);
        assertEquals(pause.getUserId(), user_id);
        assertEquals(pause.hash(), hash);
        assertEquals(pause.getHashType(), hash_type);
        assertEquals(pause.getLastRequest(), last_request);
        assertEquals(pause.getLastSuccess(), last_success);
        assertEquals(pause.getRemainingBytes(), remaining_bytes);
        assertEquals(pause.isLostData(), lost_data);
        assertEquals(pause.getStart(), start);
        assertEquals(pause.getEnd(), end);
    }
View Full Code Here

        assertEquals(pause.getEnd(), end);
    }

    @Test
    public void testIfUserCanResumeSubscription() {
        PushSubscription resume = datasift.push().resume(id).sync();
        assertTrue(resume.isSuccessful());
        assertEquals(resume.getId(), id);
        assertEquals(resume.getOutputType().value(), output_type);
        assertEquals(resume.name(), name);
        assertEquals(resume.getCreatedAt(), created_at);
        assertEquals(resume.getUserId(), user_id);
        assertEquals(resume.hash(), hash);
        assertEquals(resume.getHashType(), hash_type);
        assertEquals(resume.getLastRequest(), last_request);
        assertEquals(resume.getLastSuccess(), last_success);
        assertEquals(resume.getRemainingBytes(), remaining_bytes);
        assertEquals(resume.isLostData(), lost_data);
        assertEquals(resume.getStart(), start);
        assertEquals(resume.getEnd(), end);
    }
View Full Code Here

        assertEquals(resume.getEnd(), end);
    }

    @Test
    public void testIfUserCanUpdateSubscription() {
        PushSubscription update = datasift.push().update(id, s3).sync();
        assertTrue(update.isSuccessful());
        assertEquals(update.getId(), id);
        assertEquals(update.getOutputType().value(), output_type);
        assertEquals(update.name(), name);
        assertEquals(update.getCreatedAt(), created_at);
        assertEquals(update.getUserId(), user_id);
        assertEquals(update.hash(), hash);
        assertEquals(update.getHashType(), hash_type);
        assertEquals(update.getLastRequest(), last_request);
        assertEquals(update.getLastSuccess(), last_success);
        assertEquals(update.getRemainingBytes(), remaining_bytes);
        assertEquals(update.isLostData(), lost_data);
        assertEquals(update.getStart(), start);
        assertEquals(update.getEnd(), end);
    }
View Full Code Here

        assertEquals(update.getEnd(), end);
    }

    @Test
    public void testIfUserCanStopSubscription() {
        PushSubscription stop = datasift.push().stop(id).sync();
        assertTrue(stop.isSuccessful());
        assertEquals(stop.getId(), id);
        assertEquals(stop.getOutputType().value(), output_type);
        assertEquals(stop.name(), name);
        assertEquals(stop.getCreatedAt(), created_at);
        assertEquals(stop.getUserId(), user_id);
        assertEquals(stop.hash(), hash);
        assertEquals(stop.getHashType(), hash_type);
        assertEquals(stop.getLastRequest(), last_request);
        assertEquals(stop.getLastSuccess(), last_success);
        assertEquals(stop.getRemainingBytes(), remaining_bytes);
        assertEquals(stop.isLostData(), lost_data);
        assertEquals(stop.getStart(), start);
        assertEquals(stop.getEnd(), end);
    }
View Full Code Here

        assertEquals(log_details.getCount(), count);
    }

    @Test
    public void testIfUserCanGetSubscriptionDetails() {
        PushSubscription get_details = datasift.push().get(id).sync();
        assertTrue(get_details.isSuccessful());
        assertEquals(get_details.getId(), id);
        assertEquals(get_details.getOutputType().value(), output_type);
        assertEquals(get_details.name(), name);
        assertEquals(get_details.getCreatedAt(), created_at);
        assertEquals(get_details.getUserId(), user_id);
        assertEquals(get_details.hash(), hash);
        assertEquals(get_details.getHashType(), hash_type);
        assertEquals(get_details.getLastRequest(), last_request);
        assertEquals(get_details.getLastSuccess(), last_success);
        assertEquals(get_details.getRemainingBytes(), remaining_bytes);
        assertEquals(get_details.isLostData(), lost_data);
        assertEquals(get_details.getStart(), start);
        assertEquals(get_details.getEnd(), end);
    }
View Full Code Here

        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PreparedHistoricsQuery historic = datasift.historics().prepare(stream.hash(), DateTime.now().minusHours(5),
                DateTime.now().minusHours(4), "Historics pull test").sync();

        PushSubscription historicsSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, historic, "pull test " + DateTime.now()).sync();

        //don't forget to start it, AFTER creating the pull subscription
        datasift.historics().start(historic).sync();
View Full Code Here

                .maxSize(10485760)
                .filePrefix("DataSiftJava-");
        PushValidation pv = datasift.push().validate(s3).sync();
        successful(pv);
        String name = "Java push name", updatedName = name += " updated";
        PushSubscription subscription =
                stream != null ? datasift.push().create(s3, stream, name).sync()
                        : datasift.push().create(s3, query, name).sync();
        successful(subscription);
        Assert.assertTrue(subscription.status().isActive());
        //test update
        PushSubscription updatedSubscription = datasift.push().update(subscription.getId(), s3, updatedName).sync();
        successful(updatedSubscription);
        assertEquals(updatedName, updatedSubscription.name());
        return subscription;
    }
View Full Code Here

        new Date();
        DataSiftConfig config = new DataSiftConfig("zcourts", "acbf4788f875db9fdf6bbd2131b10752");
        final DataSiftClient datasift = new DataSiftClient(config);
        Stream stream = Stream.fromString("13e9347e7da32f19fcdb08e297019d2e");

        PushSubscription streamSubscription = datasift.push()
                .createPull(PullJsonType.JSON_NEW_LINE, stream, "pull test").sync();

        PulledInteractions streamSubscriptions = datasift.push().pull(streamSubscription).sync();

        Interaction interaction;
View Full Code Here

TOP

Related Classes of com.datasift.client.push.PushSubscription

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.