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 * Adds a failover location for the repository.
73 * @param location The location that should be used as failover.
74 * @throws UnsupportedURIException if the URI scheme is not supported by the repository type.
76 void addFailoverLocation(URI location) throws UnsupportedURIException;
79 * Removes a failover location from the set.
81 * @param location the location uri to remove
83 void removeFailoverLocation(URI location);
86 * Clears the failover location set.
88 void clearFailoverLocations();
91 * Sets the flag for scanning the repository. If true, the repository will be scanned.
92 * You have to set the scheduling times, if you set this to true.
94 * @param scanned if true, the repository is scanned regulary.
96 void setScanned(boolean scanned);
99 * Sets the scheduling definition, that defines the times, when the regular repository
100 * jobs are started. The <code>cronExpression</code> must be a valid
101 * quartz cron definition.
103 * @See http://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html
105 * @param cronExpression the cron expression.
106 * @throws IllegalArgumentException if the cron expression is not valid.
108 void setSchedulingDefinition(String cronExpression) throws IllegalArgumentException;
111 * Set true, if the repository has indexes stored.
112 * @param hasIndex true, if the repository has indexes, otherwise false.
114 void setIndex(boolean hasIndex);
117 * Sets the layout string.
120 void setLayout(String layout);