1 package org.apache.maven.archiva.web.action.admin.connectors.proxy;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
23 import org.springframework.context.annotation.Scope;
24 import org.springframework.stereotype.Controller;
27 * DeleteProxyConnectorAction
32 @Controller( "deleteProxyConnectorAction" )
34 public class DeleteProxyConnectorAction
35 extends AbstractProxyConnectorAction
37 private String source;
39 private String target;
41 private ProxyConnectorConfiguration proxyConfig;
43 public String confirmDelete()
45 this.proxyConfig = findProxyConnector( source, target );
47 // Not set? Then there is nothing to delete.
48 if ( this.proxyConfig == null )
50 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
51 + "], and target [" + target + "] does not exist." );
58 public String delete()
60 this.proxyConfig = findProxyConnector( source, target );
62 // Not set? Then there is nothing to delete.
63 if ( this.proxyConfig == null )
65 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
66 + "], and target [" + target + "] does not exist." );
70 if ( hasActionErrors() )
75 removeProxyConnector( proxyConfig );
76 addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" );
81 return saveConfiguration();
84 public String getSource()
89 public void setSource( String id )
94 public String getTarget()
99 public void setTarget( String id )
104 public ProxyConnectorConfiguration getProxyConfig()