1 package org.apache.archiva.repository;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 import java.util.Locale;
26 * This is the editable part of a repository.
27 * Normally a repository should also implement this interface but it is not
30 * Capabilities and features are a integral part of the implementation and not
31 * provided here by the interface.
32 * Feature setting methods are provided by the features itself.
35 public interface EditableRepository extends Repository
39 * Returns the primary locale used for setting the default values for
40 * name and description.
42 * @return The locale used for name and description when they are not set
44 Locale getPrimaryLocale();
47 * Sets the name for the given locale
49 * @param locale the locale for which the name is set
50 * @param name The name value in the language that matches the locale
52 void setName( Locale locale, String name);
55 * Sets the description for the given locale
57 * @param locale the locale for which the description is set
58 * @param description The description in the language that matches the locale.
60 void setDescription(Locale locale, String description);
63 * Sets the location of the repository. May be a URI that is suitable for the
64 * repository implementation. Not all implementations will accept the same URI schemes.
65 * @param location the location URI
66 * @throws UnsupportedURIException if the URI scheme is not supported by the repository type.
68 void setLocation(URI location) throws UnsupportedURIException;
71 * Sets the base uri for relative location uris.
75 void setBaseUri(URI baseUri);
78 * Adds a failover location for the repository.
80 * @param location The location that should be used as failover.
81 * @throws UnsupportedURIException if the URI scheme is not supported by the repository type.
83 void addFailoverLocation(URI location) throws UnsupportedURIException;
86 * Removes a failover location from the set.
88 * @param location the location uri to remove
90 void removeFailoverLocation(URI location);
93 * Clears the failover location set.
95 void clearFailoverLocations();
98 * Sets the flag for scanning the repository. If true, the repository will be scanned.
99 * You have to set the scheduling times, if you set this to true.
101 * @param scanned if true, the repository is scanned regulary.
103 void setScanned(boolean scanned);
106 * Sets the scheduling definition, that defines the times, when the regular repository
107 * jobs are started. The <code>cronExpression</code> must be a valid
108 * quartz cron definition.
110 * @See http://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html
112 * @param cronExpression the cron expression.
113 * @throws IllegalArgumentException if the cron expression is not valid.
115 void setSchedulingDefinition(String cronExpression) throws IllegalArgumentException;
118 * Sets the layout string.
121 void setLayout(String layout);