Examples of StreamPopularHashTagsReportDTO


Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

        GroupStreamDTO groupFilter = new GroupStreamDTO(1L, "", "shortName", false);
        filters.add(groupFilter);
        groupResponse.setStreamFilters(filters);

        final List<StreamPopularHashTagsReportDTO> responses = new ArrayList<StreamPopularHashTagsReportDTO>();
        final StreamPopularHashTagsReportDTO response1 = context.mock(StreamPopularHashTagsReportDTO.class, "r1");
        final StreamPopularHashTagsReportDTO response2 = context.mock(StreamPopularHashTagsReportDTO.class, "r2");
        responses.add(response1);
        responses.add(response2);

        sut = new GetAllPopularHashTagsFromGroupsJoinedExecution(popularHashTagsMapper, getGroups);
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

    {
        final DomainMapper<StreamPopularHashTagsRequest, StreamPopularHashTagsReportDTO> popularHashTagsMapper = context
                .mock(DomainMapper.class);

        final StreamPopularHashTagsRequest request = new StreamPopularHashTagsRequest();
        final StreamPopularHashTagsReportDTO response = new StreamPopularHashTagsReportDTO(null, null);
        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);

        GetStreamPopularHashTagsExecution sut = new GetStreamPopularHashTagsExecution(popularHashTagsMapper);

        context.checking(new Expectations()
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

    {
        final DomainMapper<StreamPopularHashTagsRequest, StreamPopularHashTagsReportDTO> popularHashTagsMapper = context
                .mock(DomainMapper.class);

        final StreamPopularHashTagsRequest request = new StreamPopularHashTagsRequest();
        final StreamPopularHashTagsReportDTO response = new StreamPopularHashTagsReportDTO(null, null);
        final PrincipalActionContext actionContext = context.mock(PrincipalActionContext.class);
        final ArrayList<String> hashTags = new ArrayList<String>();
        hashTags.add("#foo");
        hashTags.add("#bar");
        response.setPopularHashTags(hashTags);

        GetStreamPopularHashTagsExecution sut = new GetStreamPopularHashTagsExecution(popularHashTagsMapper);

        context.checking(new Expectations()
        {
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

        final StreamPopularHashTagsRequest request = new StreamPopularHashTagsRequest(ScopeType.PERSON, "foobar");
        ArrayList<String> hashTags = new ArrayList<String>();
        hashTags.add("#foo");
        hashTags.add("#bar");
        Calendar cal = Calendar.getInstance();
        final StreamPopularHashTagsReportDTO response = new StreamPopularHashTagsReportDTO(hashTags, cal.getTime());

        context.checking(new Expectations()
        {
            {
                oneOf(popularHashTagsMapper).execute(request);
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

        final StreamPopularHashTagsRequest request = new StreamPopularHashTagsRequest(ScopeType.PERSON, "foobar");
        ArrayList<String> hashTags = new ArrayList<String>();
        Calendar cal = Calendar.getInstance();
        final int twentyDaysAgo = -480;
        cal.add(Calendar.HOUR, twentyDaysAgo);
        final StreamPopularHashTagsReportDTO response = new StreamPopularHashTagsReportDTO(hashTags, cal.getTime());

        context.checking(new Expectations()
        {
            {
                oneOf(popularHashTagsMapper).execute(request);
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

     * @return null if not found or found and generated too long ago
     */
    @Override
    public StreamPopularHashTagsReportDTO execute(final StreamPopularHashTagsRequest inRequest)
    {
        StreamPopularHashTagsReportDTO hashTagReport = popularHashTagsMapper.execute(inRequest);
        if (hashTagReport != null)
        {
            // found the report - see if it's too old
            Calendar earliestValidReportDate = Calendar.getInstance();
            earliestValidReportDate.add(Calendar.MINUTE, 0 - popularHashTagsExpirationInMinutes);

            if (hashTagReport.getReportGenerationDate().before(earliestValidReportDate.getTime()))
            {
                // this report is expired - regenerate
                if (log.isInfoEnabled())
                {
                    log.info("Popular HashTag report for stream " + inRequest.getStreamEntityScopeType() + " #"
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

                    + " stream with id " + inRequest.getStreamEntityUniqueKey() + " and activity date >= "
                    + minActivityTime.toString());
        }

        Calendar now = Calendar.getInstance();
        return new StreamPopularHashTagsReportDTO(hashTags, now.getTime());
    }
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

                "activityDate", Calendar.getInstance().getTime()).executeUpdate();

        StreamPopularHashTagsDbMapper sut = new StreamPopularHashTagsDbMapper(9, 9);
        sut.setEntityManager(getEntityManager());

        StreamPopularHashTagsReportDTO tagsReport = sut.execute(new StreamPopularHashTagsRequest(ScopeType.PERSON,
                "smithers"));
        List<String> tags = tagsReport.getPopularHashTags();
        assertEquals(2, tags.size());

        // Smithers has tags #soda(5), one of #foo(1)
        assertEquals("#soda", tags.get(0));
        assertEquals("#foo", tags.get(1));
View Full Code Here

Examples of org.eurekastreams.server.persistence.mappers.stream.StreamPopularHashTagsReportDTO

    @Override
    public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException
    {
        log.debug("Entering");
        StreamPopularHashTagsRequest request = (StreamPopularHashTagsRequest) inActionContext.getParams();
        StreamPopularHashTagsReportDTO response = popularHashTagsMapper.execute(request);

        List<String> hashTags = response.getPopularHashTags();
       
        ArrayList<String> result = new ArrayList<String>();
       
        if (hashTags != null)
        {
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.