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 * DisableProxyConnectorAction
30 @Controller( "disableProxyConnectorAction" )
32 public class DisableProxyConnectorAction
33 extends AbstractProxyConnectorAction
35 private String source;
37 private String target;
39 private ProxyConnectorConfiguration proxyConfig;
41 public String confirmDisable()
43 this.proxyConfig = findProxyConnector( source, target );
45 // Not set? Then there is nothing to delete.
46 if ( this.proxyConfig == null )
49 "Unable to disable proxy configuration, configuration with source [" + source + "], and target ["
50 + target + "] does not exist." );
57 public String disable()
59 this.proxyConfig = findProxyConnector( source, target );
61 // Not set? Then there is nothing to delete.
62 if ( this.proxyConfig == null )
65 "Unable to disable proxy configuration, configuration with source [" + source + "], and target ["
66 + target + "] does not exist." );
70 if ( hasActionErrors() )
75 proxyConfig.setDisabled( true );
77 addActionMessage( "Successfully disabled proxy connector [" + source + " , " + target + " ]" );
82 return saveConfiguration();
85 public String getSource()
90 public void setSource( String source )
95 public String getTarget()
100 public void setTarget( String target )
102 this.target = target;