This project has retired. For details please refer to its Attic page.
Source code
001package org.apache.archiva.repository;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *  http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.archiva.indexer.ArchivaIndexingContext;
023
024import java.net.URI;
025import java.util.Locale;
026
027/**
028 * This is the editable part of a repository.
029 * Normally a repository should also implement this interface but it is not
030 * required.
031 *
032 * Capabilities and features are a integral part of the implementation and not
033 * provided here by the interface.
034 * Feature setting methods are provided by the features itself.
035 *
036 */
037public interface EditableRepository extends Repository
038{
039
040    /**
041     * Returns the primary locale used for setting the default values for
042     * name and description.
043     *
044     * @return The locale used for name and description when they are not set
045     */
046    Locale getPrimaryLocale();
047
048    /**
049     * Sets the name for the given locale
050     *
051     * @param locale the locale for which the name is set
052     * @param name The name value in the language that matches the locale
053     */
054    void setName( Locale locale, String name);
055
056    /**
057     * Sets the description for the given locale
058     *
059     * @param locale the locale for which the description is set
060     * @param description The description in the language that matches the locale.
061     */
062    void setDescription(Locale locale, String description);
063
064    /**
065     * Sets the location of the repository. May be a URI that is suitable for the
066     * repository implementation. Not all implementations will accept the same URI schemes.
067     * @param location the location URI
068     * @throws UnsupportedURIException if the URI scheme is not supported by the repository type.
069     */
070    void setLocation(URI location) throws UnsupportedURIException;
071
072    /**
073     * Sets the base uri for relative location uris.
074     *
075     * @param baseUri
076     */
077    void setBaseUri(URI baseUri);
078
079    /**
080     * Adds a failover location for the repository.
081     *
082     * @param location The location that should be used as failover.
083     * @throws UnsupportedURIException if the URI scheme is not supported by the repository type.
084     */
085    void addFailoverLocation(URI location) throws UnsupportedURIException;
086
087    /**
088     * Removes a failover location from the set.
089     *
090     * @param location the location uri to remove
091     */
092    void removeFailoverLocation(URI location);
093
094    /**
095     * Clears the failover location set.
096     */
097    void clearFailoverLocations();
098
099    /**
100     * Sets the flag for scanning the repository. If true, the repository will be scanned.
101     * You have to set the scheduling times, if you set this to true.
102     *
103     * @param scanned if true, the repository is scanned regulary.
104     */
105    void setScanned(boolean scanned);
106
107    /**
108     * Sets the scheduling definition, that defines the times, when the regular repository
109     * jobs are started. The <code>cronExpression</code> must be a valid
110     * quartz cron definition.
111     *
112     * @See http://www.quartz-scheduler.org/api/2.2.1/org/quartz/CronExpression.html
113     *
114     * @param cronExpression the cron expression.
115     * @throws IllegalArgumentException if the cron expression is not valid.
116     */
117    void setSchedulingDefinition(String cronExpression) throws IllegalArgumentException;
118
119    /**
120     * Sets the layout string.
121     * @param layout
122     */
123    void setLayout(String layout);
124
125    /**
126     * Sets the indexing context reference.
127     * @param context
128     */
129    void setIndexingContext(ArchivaIndexingContext context);
130
131
132}