Search in sources :

Example 1 with ActionSendException

use of com.cognifide.actions.api.ActionSendException in project CQ-Actions by Cognifide.

the class Resender method run.

@Override
public void run() {
    ResourceResolver resolver = null;
    try {
        resolver = resolverFactory.getAdministrativeResourceResolver(null);
        final Resource parent = resolver.getResource(MessagePersistenceService.SERIALIZED_ACTIONS);
        if (parent == null) {
            return;
        }
        for (final Resource child : parent.getChildren()) {
            resend(child);
        }
        resolver.commit();
    } catch (LoginException | PersistenceException e) {
        LOG.error("Can't resend", e);
    } catch (ActionSendException e) {
        LOG.error("Can't resend", e);
    } finally {
        if (resolver != null) {
            resolver.close();
        }
    }
}
Also used : ActionSendException(com.cognifide.actions.api.ActionSendException) ResourceResolver(org.apache.sling.api.resource.ResourceResolver) Resource(org.apache.sling.api.resource.Resource) PersistenceException(org.apache.sling.api.resource.PersistenceException) LoginException(org.apache.sling.api.resource.LoginException)

Aggregations

ActionSendException (com.cognifide.actions.api.ActionSendException)1 LoginException (org.apache.sling.api.resource.LoginException)1 PersistenceException (org.apache.sling.api.resource.PersistenceException)1 Resource (org.apache.sling.api.resource.Resource)1 ResourceResolver (org.apache.sling.api.resource.ResourceResolver)1