Package org.eurekastreams.server.persistence.mappers.cache

Examples of org.eurekastreams.server.persistence.mappers.cache.Cache


    public void testExecute()
    {
        final Transformer<ActionContext, Serializable> parameterSupplier = context.mock(Transformer.class,
                "parameterSupplier");
        final DomainMapper<Serializable, Serializable> domainMapper = context.mock(DomainMapper.class, "domainMapper");
        final Cache cache = context.mock(Cache.class);
        final Transformer<ActionContext, Serializable> cacheKeyParameterSupplier = context.mock(Transformer.class,
                "cacheKeyParameterSupplier");
        final Serializable params = context.mock(Serializable.class, "params");
        final Serializable extractedParams = context.mock(Serializable.class, "extractedParams");
        final Serializable result = context.mock(Serializable.class, "result");
View Full Code Here


        // delete comment from DB.
        getEntityManager().createQuery("DELETE FROM Comment WHERE id = :commentId").setParameter("commentId",
                inCommentId).executeUpdate();

        Cache cache = getCache();

        // delete commentDTO from cache.
        cache.delete(CacheKeys.COMMENT_BY_ID + inCommentId);

        // if present, update commentId list for activity in cache.
        String commentsByActivityKey = CacheKeys.COMMENT_IDS_BY_ACTIVITY_ID + activityId;
        cache.removeFromList(commentsByActivityKey, inCommentId);

        // if present, update ActivityDTO in cache
        String activityByIdKey = CacheKeys.ACTIVITY_BY_ID + activityId;
        ActivityDTO activityDTO = (ActivityDTO) cache.get(activityByIdKey);
        if (activityDTO != null)
        {
            List<Long> commentIds = cache.getList(commentsByActivityKey);
            updateActivityDTO(activityDTO, inCommentId, commentIds);
            getCache().set(activityByIdKey, activityDTO);
        }

        // update activity in search index
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.persistence.mappers.cache.Cache

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.