/** * Copyright (c) 2008-2011 Sonatype, Inc. * All rights reserved. Includes the third-party code listed at http://www.sonatype.com/products/nexus/attributions. * * This program is free software: you can redistribute it and/or modify it only under the terms of the GNU Affero General * Public License Version 3 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License Version 3 * for more details. * * You should have received a copy of the GNU Affero General Public License Version 3 along with this program. If not, see * http://www.gnu.org/licenses. * * Sonatype Nexus (TM) Open Source Version is available from Sonatype, Inc. Sonatype and Sonatype Nexus are trademarks of * Sonatype, Inc. Apache Maven is a trademark of the Apache Foundation. M2Eclipse is a trademark of the Eclipse Foundation. * All other trademarks are the property of their respective owners. */ package org.sonatype.nexus.tasks.descriptors; import java.util.ArrayList; import java.util.List; import org.codehaus.plexus.component.annotations.Component; import org.sonatype.nexus.formfields.FormField; import org.sonatype.nexus.formfields.RepoOrGroupComboFormField; import org.sonatype.nexus.formfields.StringTextFormField; @Component( role = ScheduledTaskDescriptor.class, hint = "ExpireCache", description = "Expire Repository Caches" ) public class ExpireCacheTaskDescriptor extends AbstractScheduledTaskDescriptor { public static final String ID = "ExpireCacheTask"; public static final String REPO_OR_GROUP_FIELD_ID = "repositoryId"; public static final String RESOURCE_STORE_PATH_FIELD_ID = "resourceStorePath"; private final RepoOrGroupComboFormField repoField = new RepoOrGroupComboFormField( REPO_OR_GROUP_FIELD_ID, RepoOrGroupComboFormField.DEFAULT_LABEL, "Type in the repository path from which to expire caches recursively (ie. \"/\" for root or \"/org/apache\")", FormField.MANDATORY ); private final StringTextFormField resourceStorePathField = new StringTextFormField( RESOURCE_STORE_PATH_FIELD_ID, "Repository path", "Enter a repository path to run the task in recursively (ie. \"/\" for root or \"/org/apache\")", FormField.OPTIONAL ); public String getId() { return ID; } public String getName() { return "Expire Repository Caches"; } public List<FormField> formFields() { List<FormField> fields = new ArrayList<FormField>(); fields.add( repoField ); fields.add( resourceStorePathField ); return fields; } }