001    package org.apache.archiva.admin.model.beans;
002    /*
003     * Licensed to the Apache Software Foundation (ASF) under one
004     * or more contributor license agreements.  See the NOTICE file
005     * distributed with this work for additional information
006     * regarding copyright ownership.  The ASF licenses this file
007     * to you under the Apache License, Version 2.0 (the
008     * "License"); you may not use this file except in compliance
009     * with the License.  You may obtain a copy of the License at
010     *
011     *   http://www.apache.org/licenses/LICENSE-2.0
012     *
013     * Unless required by applicable law or agreed to in writing,
014     * software distributed under the License is distributed on an
015     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016     * KIND, either express or implied.  See the License for the
017     * specific language governing permissions and limitations
018     * under the License.
019     */
020    
021    import org.apache.archiva.admin.model.AbstractRepositoryConnector;
022    
023    import javax.xml.bind.annotation.XmlRootElement;
024    import java.io.Serializable;
025    
026    /**
027     * @author Olivier Lamy
028     * @since 1.4-M1
029     */
030    @XmlRootElement( name = "proxyConnector" )
031    public class ProxyConnector
032        extends AbstractRepositoryConnector
033        implements Serializable
034    {
035        /**
036         * The order id for UNORDERED
037         */
038        public static final int UNORDERED = 0;
039    
040        /**
041         * The policy key {@link #getPolicies()} for error handling.
042         * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
043         * for details on potential values to this policy key.
044         */
045        public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
046    
047        /**
048         * The policy key {@link #getPolicies()} for error handling when an artifact is present.
049         * See {@link org.apache.archiva.policies.DownloadErrorPolicy}
050         * for details on potential values to this policy key.
051         */
052        public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
053    
054        /**
055         * The policy key {@link #getPolicies()} for snapshot handling.
056         * See {@link org.apache.archiva.policies.SnapshotsPolicy}
057         * for details on potential values to this policy key.
058         */
059        public static final String POLICY_SNAPSHOTS = "snapshots";
060    
061        /**
062         * The policy key {@link #getPolicies()} for releases handling.
063         * See {@link org.apache.archiva.policies.ReleasesPolicy}
064         * for details on potential values to this policy key.
065         */
066        public static final String POLICY_RELEASES = "releases";
067    
068        /**
069         * The policy key {@link #getPolicies()} for checksum handling.
070         * See {@link org.apache.archiva.policies.ChecksumPolicy}
071         * for details on potential values to this policy key.
072         */
073        public static final String POLICY_CHECKSUM = "checksum";
074    
075        /**
076         * The policy key {@link #getPolicies()} for cache-failures handling.
077         * See {@link org.apache.archiva.policies.CachedFailuresPolicy}
078         * for details on potential values to this policy key.
079         */
080        public static final String POLICY_CACHE_FAILURES = "cache-failures";
081    
082        /**
083         *
084         * The order of the proxy connectors. (0 means no order specified)
085         *           .
086         */
087        private int order = 0;
088    
089        /**
090         * Get the order of the proxy connectors. (0 means no order specified)
091         * @return int
092         */
093        public int getOrder()
094        {
095            return this.order;
096        }
097    
098    
099        /**
100         * Set the order of the proxy connectors. (0 means no order specified)
101         * @param order
102         */
103        public void setOrder( int order )
104        {
105            this.order = order;
106        }
107    
108        @Override
109        public String toString()
110        {
111            final StringBuilder sb = new StringBuilder();
112            sb.append( "ProxyConnector" );
113            sb.append( "{order=" ).append( order );
114            sb.append( '}' );
115            sb.append( super.toString() );
116            return sb.toString();
117        }
118    }