1 package org.apache.archiva.web.action.admin.connectors.proxy;
3 import org.apache.archiva.admin.model.RepositoryAdminException;
4 import org.apache.archiva.admin.model.beans.ProxyConnector;
5 import org.springframework.context.annotation.Scope;
6 import org.springframework.stereotype.Controller;
9 * Licensed to the Apache Software Foundation (ASF) under one
10 * or more contributor license agreements. See the NOTICE file
11 * distributed with this work for additional information
12 * regarding copyright ownership. The ASF licenses this file
13 * to you under the Apache License, Version 2.0 (the
14 * "License"); you may not use this file except in compliance
15 * with the License. You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing,
20 * software distributed under the License is distributed on an
21 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22 * KIND, either express or implied. See the License for the
23 * specific language governing permissions and limitations
28 * DisableProxyConnectorAction
30 @Controller( "disableProxyConnectorAction" )
32 public class DisableProxyConnectorAction
33 extends AbstractProxyConnectorAction
35 private String source;
37 private String target;
39 private ProxyConnector proxyConfig;
41 public String confirmDisable()
42 throws RepositoryAdminException
44 this.proxyConfig = findProxyConnector( source, target );
46 // Not set? Then there is nothing to delete.
47 if ( this.proxyConfig == null )
50 "Unable to disable proxy configuration, configuration with source [" + source + "], and target ["
51 + target + "] does not exist." );
58 public String disable()
59 throws RepositoryAdminException
61 this.proxyConfig = findProxyConnector( source, target );
63 // Not set? Then there is nothing to delete.
64 if ( this.proxyConfig == null )
67 "Unable to disable proxy configuration, configuration with source [" + source + "], and target ["
68 + target + "] does not exist." );
72 if ( hasActionErrors() )
77 proxyConfig.setDisabled( true );
79 addActionMessage( "Successfully disabled proxy connector [" + source + " , " + target + " ]" );
84 getProxyConnectorAdmin().updateProxyConnector( proxyConfig, getAuditInformation() );
88 public String getSource()
93 public void setSource( String source )
98 public String getTarget()
103 public void setTarget( String target )
105 this.target = target;