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
31 * plexus.component role="com.opensymphony.xwork2.Action" role-hint="deleteProxyConnectorAction" instantiation-strategy="per-lookup"
33 @Controller( "deleteProxyConnectorAction" )
35 public class DeleteProxyConnectorAction
36 extends AbstractProxyConnectorAction
38 private String source;
40 private String target;
42 private ProxyConnectorConfiguration proxyConfig;
44 public String confirmDelete()
46 this.proxyConfig = findProxyConnector( source, target );
48 // Not set? Then there is nothing to delete.
49 if ( this.proxyConfig == null )
51 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
52 + "], and target [" + target + "] does not exist." );
59 public String delete()
61 this.proxyConfig = findProxyConnector( source, target );
63 // Not set? Then there is nothing to delete.
64 if ( this.proxyConfig == null )
66 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
67 + "], and target [" + target + "] does not exist." );
71 if ( hasActionErrors() )
76 removeProxyConnector( proxyConfig );
77 addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" );
82 return saveConfiguration();
85 public String getSource()
90 public void setSource( String id )
95 public String getTarget()
100 public void setTarget( String id )
105 public ProxyConnectorConfiguration getProxyConfig()