Package org.eurekastreams.commons.server

Examples of org.eurekastreams.commons.server.UserActionRequest


        Long entityId = insertMapper.execute(new PersistenceRequest<FeaturedStream>(entity));

        // kick off the action to rebuild the Discover Page cache - but don't delete the key now, because it takes
        // seconds to rebuild
        inActionContext.getUserActionRequests().add(
                new UserActionRequest("regenerateStreamDiscoverListsAction", null, null));

        return entityId;
    }
View Full Code Here


                    log.info("Found user AcctId: " + acctId + " (" + p.getDisplayName() + ") to be unlocked.");
                }

                // Queue action to refresh user info from AD - even if we're going to unlock the person, we should still
                // update the database from LDAP
                inActionContext.getUserActionRequests().add(new UserActionRequest(refreshPersonActionKey, null, p));

                if (queueLockAccounts)
                {
                    inActionContext.getUserActionRequests().add(
                            new UserActionRequest(lockPersonActionKey, null, new SetPersonLockedStatusRequest(acctId,
                                    false)));
                }
                toUnlock++;
            }
            else if (unLockedUserAccountIds.contains(acctId))
            {
                log.debug("Queuing up a refresh of person: " + acctId);

                // Queue action to refresh user info from AD
                inActionContext.getUserActionRequests().add(new UserActionRequest(refreshPersonActionKey, null, p));

                // remove from unlocked list, when done looping remaining ids will be locked.
                unLockedUserAccountIds.remove(acctId);
            }
            else
            {
                if (log.isInfoEnabled())
                {
                    log.info("Found user id: " + acctId + " (" + p.getDisplayName() + ") to be created.");
                }
                if (queueCreatePerson)
                {
                    inActionContext.getUserActionRequests().add(
                            new UserActionRequest(createPersonActionKey, null, new CreatePersonRequest(p,
                                    shouldSendEmail)));
                }
                toCreate++;
            }
        }

        // Everyone that hasn't been removed from the unLockedUserAccountIds collection by this point needs to be
        // locked.
        toLock = unLockedUserAccountIds.size();
        log.info("Determined there are " + unLockedUserAccountIds.size() + " user accounts to lock.");
        for (String id : unLockedUserAccountIds)
        {
            if (log.isInfoEnabled())
            {
                log.info("Found user AcctId: " + id + " to be locked.");
            }
            if (queueLockAccounts)
            {
                inActionContext.getUserActionRequests().add(
                        new UserActionRequest(lockPersonActionKey, null, new SetPersonLockedStatusRequest(id, true)));
            }
        }

        log.info("Summary: Lock: " + toLock + " unlock: " + toUnlock + " Create: " + toCreate
                + ". LOCK-UNLOCK ENABLED: " + queueLockAccounts + " CREATE ENABLED: " + queueCreatePerson);
View Full Code Here

    {
        for (String key : keys)
        {
            // Put an action on the queue to delete the activities from the appropriate lists
            inActionContext.getUserActionRequests().add(
                    new UserActionRequest("deleteIdsFromLists", null, new DeleteIdsFromListsRequest(Collections
                            .singletonList(key), values)));
        }
    }
View Full Code Here

            final TaskHandlerActionContext<ActionContext> inActionContext)
    {
        // Put an action on the queue to delete the activities from search index
        inActionContext.getUserActionRequests()
                .add(
                        new UserActionRequest("deleteFromSearchIndexAction", null, new DeleteFromSearchIndexRequest(
                                clazz, ids)));
    }
View Full Code Here

     */
    private void generateSingleDeleteKeyFromCacheTask(final Set<String> keys,
            final TaskHandlerActionContext<ActionContext> inActionContext)
    {
        inActionContext.getUserActionRequests().add(
                new UserActionRequest("deleteCacheKeysAction", null, (Serializable) keys));
    }
View Full Code Here

    {
        Iterator<String> it = keys.iterator();
        while (it.hasNext())
        {
            inActionContext.getUserActionRequests().add(
                    new UserActionRequest("deleteCacheKeysAction", null, new HashSet<String>(Collections
                            .singletonList(it.next()))));
        }
    }
View Full Code Here

        cache.delete(CacheKeys.SYSTEM_ADMINISTRATOR_IDS);
        cacheKeysToClear.add(CacheKeys.SYSTEM_ADMINISTRATOR_IDS);

        // put the cache keys deletes on the task queue to avoid the (yeah, i know... tiny) race condition
        inActionContext.getUserActionRequests().add(
                new UserActionRequest("deleteCacheKeysAction", null, (Serializable) cacheKeysToClear));

        return systemSettings;
    }
View Full Code Here

        deleteMapper.execute((Long) inActionContext.getActionContext().getParams());

        // kick off the action to rebuild the Discover Page cache - but don't delete the key now, because it takes
        // seconds to rebuild
        inActionContext.getUserActionRequests().add(
                new UserActionRequest("regenerateStreamDiscoverListsAction", null, null));

        return true;
    }
View Full Code Here

    @Override
    public Serializable execute(final TaskHandlerActionContext<PrincipalActionContext> inActionContext)
            throws ExecutionException
    {
        List<UserActionRequest> userActionRequests = new ArrayList<UserActionRequest>();
        userActionRequests.add(new UserActionRequest("refreshMembershipAction", null, null));
        inActionContext.getUserActionRequests().addAll(userActionRequests);
        return null;
    }
View Full Code Here

        logger.trace("Registering metric for user: " + principal.getAccountId() + " StreamView:" + umdto.isStreamView()
                + " PageView:" + umdto.isPageView() + " MetricDetails: " + umdto.getMetricDetails());

        inActionContext.getUserActionRequests().add(
                new UserActionRequest("persistUserMetricAsyncAction", null, new PersistenceRequest<UsageMetric>(um)));
        return null;
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.commons.server.UserActionRequest

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.