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;
25 * DeleteProxyConnectorAction
29 * @plexus.component role="com.opensymphony.xwork2.Action" role-hint="deleteProxyConnectorAction"
31 public class DeleteProxyConnectorAction
32 extends AbstractProxyConnectorAction
34 private String source;
36 private String target;
38 private ProxyConnectorConfiguration proxyConfig;
40 public String confirmDelete()
42 this.proxyConfig = findProxyConnector( source, target );
44 // Not set? Then there is nothing to delete.
45 if ( this.proxyConfig == null )
47 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
48 + "], and target [" + target + "] does not exist." );
55 public String delete()
57 this.proxyConfig = findProxyConnector( source, target );
59 // Not set? Then there is nothing to delete.
60 if ( this.proxyConfig == null )
62 addActionError( "Unable to delete proxy configuration, configuration with source [" + source
63 + "], and target [" + target + "] does not exist." );
67 if ( hasActionErrors() )
72 removeProxyConnector( proxyConfig );
73 addActionMessage( "Successfully removed proxy connector [" + source + " , " + target + " ]" );
78 return saveConfiguration();
81 public String getSource()
86 public void setSource( String id )
91 public String getTarget()
96 public void setTarget( String id )
101 public ProxyConnectorConfiguration getProxyConfig()