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 * plexus.component role="com.opensymphony.xwork2.Action" role-hint="enableProxyConnectorAction" instantiation-strategy="per-lookup"
31 @Controller( "enableProxyConnectorAction" )
33 public class EnableProxyConnectorAction
34 extends AbstractProxyConnectorAction
36 private String source;
38 private String target;
40 private ProxyConnectorConfiguration proxyConfig;
42 public String confirmEnable()
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()
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 addActionMessage( "Successfully enabled proxy connector [" + source + " , " + target + " ]" );
83 return saveConfiguration();
86 public String getSource()
91 public void setSource( String source )
96 public String getTarget()
101 public void setTarget( String target )
103 this.target = target;