1 package org.apache.maven.archiva.web.action.admin.connectors.proxy;
3 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
4 import org.springframework.context.annotation.Scope;
5 import org.springframework.stereotype.Controller;
8 * Licensed to the Apache Software Foundation (ASF) under one
9 * or more contributor license agreements. See the NOTICE file
10 * distributed with this work for additional information
11 * regarding copyright ownership. The ASF licenses this file
12 * to you under the Apache License, Version 2.0 (the
13 * "License"); you may not use this file except in compliance
14 * with the License. You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing,
19 * software distributed under the License is distributed on an
20 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 * KIND, either express or implied. See the License for the
22 * specific language governing permissions and limitations
27 * EnableProxyConnectorAction
29 @Controller( "enableProxyConnectorAction" )
31 public class EnableProxyConnectorAction
32 extends AbstractProxyConnectorAction
34 private String source;
36 private String target;
38 private ProxyConnectorConfiguration proxyConfig;
40 public String confirmEnable()
42 this.proxyConfig = findProxyConnector( source, target );
44 // Not set? Then there is nothing to delete.
45 if ( this.proxyConfig == null )
48 "Unable to enable proxy configuration, configuration with source [" + source + "], and target ["
49 + target + "] does not exist." );
56 public String enable()
58 this.proxyConfig = findProxyConnector( source, target );
60 // Not set? Then there is nothing to delete.
61 if ( this.proxyConfig == null )
64 "Unable to enabled proxy configuration, configuration with source [" + source + "], and target ["
65 + target + "] does not exist." );
69 if ( hasActionErrors() )
74 proxyConfig.setDisabled( false );
76 addActionMessage( "Successfully enabled proxy connector [" + source + " , " + target + " ]" );
81 return saveConfiguration();
84 public String getSource()
89 public void setSource( String source )
94 public String getTarget()
99 public void setTarget( String target )
101 this.target = target;