1 package org.apache.archiva.web.action.admin.connectors.proxy;
3 import org.apache.archiva.admin.model.RepositoryAdminException;
4 import org.apache.archiva.admin.model.beans.ProxyConnector;
5 import org.springframework.context.annotation.Scope;
6 import org.springframework.stereotype.Controller;
9 * Licensed to the Apache Software Foundation (ASF) under one
10 * or more contributor license agreements. See the NOTICE file
11 * distributed with this work for additional information
12 * regarding copyright ownership. The ASF licenses this file
13 * to you under the Apache License, Version 2.0 (the
14 * "License"); you may not use this file except in compliance
15 * with the License. You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing,
20 * software distributed under the License is distributed on an
21 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22 * KIND, either express or implied. See the License for the
23 * specific language governing permissions and limitations
28 * EnableProxyConnectorAction
30 @Controller( "enableProxyConnectorAction" )
32 public class EnableProxyConnectorAction
33 extends AbstractProxyConnectorAction
35 private String source;
37 private String target;
39 private ProxyConnector proxyConfig;
41 public String confirmEnable()
42 throws RepositoryAdminException
44 this.proxyConfig = findProxyConnector( source, target );
46 // Not set? Then there is nothing to delete.
47 if ( this.proxyConfig == null )
50 "Unable to enable proxy configuration, configuration with source [" + source + "], and target ["
51 + target + "] does not exist." );
58 public String enable() throws RepositoryAdminException
60 this.proxyConfig = findProxyConnector( source, target );
62 // Not set? Then there is nothing to delete.
63 if ( this.proxyConfig == null )
66 "Unable to enabled proxy configuration, configuration with source [" + source + "], and target ["
67 + target + "] does not exist." );
71 if ( hasActionErrors() )
76 proxyConfig.setDisabled( false );
78 getProxyConnectorAdmin().updateProxyConnector( proxyConfig, getAuditInformation() );
80 addActionMessage( "Successfully enabled proxy connector [" + source + " , " + target + " ]" );
88 public String getSource()
93 public void setSource( String source )
98 public String getTarget()
103 public void setTarget( String target )
105 this.target = target;