All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.acs.commons.workflow.bulk.removal.WorkflowRemovalConfig Maven / Gradle / Ivy

There is a newer version: 6.6.0
Show newest version
/*
 * #%L
 * ACS AEM Commons Bundle
 * %%
 * Copyright (C) 2015 Adobe
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

package com.adobe.acs.commons.workflow.bulk.removal;

import java.util.Calendar;
import java.util.Collection;
import java.util.regex.Pattern;

public final class WorkflowRemovalConfig {

    private final Collection modelIds;
    private final Collection statuses;
    private final Collection payloads;
    private final Calendar olderThan;
    private final long olderThanMillis;
    private int batchSize = 1000;
    private int maxDurationInMins = 0;

    /**
     * Config for workflow removal instances that match the parameter criteria.
     *
     * @param modelIds WF Models to remove
     * @param statuses WF Statuses to remove
     * @param payloads Regexes; WF Payloads to remove
     * @param olderThan UTC time in milliseconds; only delete WF's started after this time
     * @param olderThanMillis Milliseconds; only delete WF's started after this milliseconds ago
     */
    public WorkflowRemovalConfig(Collection modelIds, Collection statuses, Collection payloads, Calendar olderThan, long olderThanMillis) {
        this.modelIds = modelIds;
        this.statuses = statuses;
        this.payloads = payloads;
        this.olderThan = olderThan;
        this.olderThanMillis = olderThanMillis;
    }

    public final Collection getModelIds() {
        return modelIds;
    }

    public final Collection getStatuses() {
        return statuses;
    }

    public final Collection getPayloads() {
        return payloads;
    }

    public final Calendar getOlderThan() {
        return olderThan;
    }

    public final long getOlderThanMillis() {
        return olderThanMillis;
    }

    public final int getBatchSize() {
        return batchSize;
    }

    public final int getMaxDurationInMins() {
        return maxDurationInMins;
    }

    public final void setBatchSize(int batchSize) {
        this.batchSize = batchSize;
    }

    public final void setMaxDurationInMins(int maxDurationInMins) {
        this.maxDurationInMins = maxDurationInMins;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy