You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/11/20 15:39:57 UTC
svn commit: r882578 - in
/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings:
building/ crypto/
Author: bentmann
Date: Fri Nov 20 14:39:57 2009
New Revision: 882578
URL: http://svn.apache.org/viewvc?rev=882578&view=rev
Log:
o Introduced Maven API to decrypt settings
Added:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/ (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java (with props)
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java (with props)
Modified:
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/SettingsBuildingResult.java
Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java?rev=882578&r1=882577&r2=882578&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsBuildingResult.java Fri Nov 20 14:39:57 2009
@@ -19,6 +19,7 @@
* under the License.
*/
+import java.util.ArrayList;
import java.util.List;
import org.apache.maven.settings.Settings;
@@ -39,7 +40,7 @@
public DefaultSettingsBuildingResult( Settings effectiveSettings, List<SettingsProblem> problems )
{
this.effectiveSettings = effectiveSettings;
- this.problems = problems;
+ this.problems = ( problems != null ) ? problems : new ArrayList<SettingsProblem>();
}
public Settings getEffectiveSettings()
Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java?rev=882578&r1=882577&r2=882578&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/DefaultSettingsProblem.java Fri Nov 20 14:39:57 2009
@@ -26,7 +26,7 @@
*
* @author Benjamin Bentmann
*/
-class DefaultSettingsProblem
+public class DefaultSettingsProblem
implements SettingsProblem
{
Modified: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/SettingsBuildingResult.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/SettingsBuildingResult.java?rev=882578&r1=882577&r2=882578&view=diff
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/SettingsBuildingResult.java (original)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/building/SettingsBuildingResult.java Fri Nov 20 14:39:57 2009
@@ -43,7 +43,7 @@
* {@link SettingsProblem.Severity#WARNING} and below are reported here. Problems with a higher severity level cause
* the settings builder to fail with a {@link SettingsBuildingException}.
*
- * @return The problems that were encountered during the model building, can be empty but never {@code null}.
+ * @return The problems that were encountered during the settings building, can be empty but never {@code null}.
*/
List<SettingsProblem> getProblems();
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/
------------------------------------------------------------------------------
bugtraq:label = Enter issue ID:
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/
------------------------------------------------------------------------------
bugtraq:message = Issue id: %BUGID%
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/
------------------------------------------------------------------------------
bugtraq:number = false
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/
------------------------------------------------------------------------------
bugtraq:url = http://jira.codehaus.org/browse/%BUGID%
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,109 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.building.DefaultSettingsProblem;
+import org.apache.maven.settings.building.SettingsProblem;
+import org.apache.maven.settings.building.SettingsProblem.Severity;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
+import org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException;
+
+/**
+ * Decrypts passwords in the settings.
+ *
+ * @author Benjamin Bentmann
+ */
+@Component( role = SettingsDecrypter.class )
+public class DefaultSettingsDecrypter
+ implements SettingsDecrypter
+{
+
+ @Requirement( hint = "maven" )
+ private SecDispatcher securityDispatcher;
+
+ public SettingsDecryptionResult decrypt( SettingsDecryptionRequest request )
+ {
+ List<SettingsProblem> problems = new ArrayList<SettingsProblem>();
+
+ List<Server> servers = new ArrayList<Server>();
+
+ for ( Server server : request.getServers() )
+ {
+ server = server.clone();
+
+ servers.add( server );
+
+ try
+ {
+ server.setPassword( decrypt( server.getPassword() ) );
+ }
+ catch ( SecDispatcherException e )
+ {
+ problems.add( new DefaultSettingsProblem( "Failed to decrypt password for server " + server.getId()
+ + ": " + e.getMessage(), Severity.ERROR, "server: " + server.getId(), -1, -1, e ) );
+ }
+
+ try
+ {
+ server.setPassphrase( decrypt( server.getPassphrase() ) );
+ }
+ catch ( SecDispatcherException e )
+ {
+ problems.add( new DefaultSettingsProblem( "Failed to decrypt passphrase for server " + server.getId()
+ + ": " + e.getMessage(), Severity.ERROR, "server: " + server.getId(), -1, -1, e ) );
+ }
+ }
+
+ List<Proxy> proxies = new ArrayList<Proxy>();
+
+ for ( Proxy proxy : request.getProxies() )
+ {
+ proxy = proxy.clone();
+
+ proxies.add( proxy );
+
+ try
+ {
+ proxy.setPassword( decrypt( proxy.getPassword() ) );
+ }
+ catch ( SecDispatcherException e )
+ {
+ problems.add( new DefaultSettingsProblem( "Failed to decrypt password for proxy " + proxy.getId()
+ + ": " + e.getMessage(), Severity.ERROR, "proxy: " + proxy.getId(), -1, -1, e ) );
+ }
+ }
+
+ return new DefaultSettingsDecryptionResult( servers, proxies, problems );
+ }
+
+ private String decrypt( String str )
+ throws SecDispatcherException
+ {
+ return ( str == null ) ? null : securityDispatcher.decrypt( str );
+ }
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecrypter.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,116 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.Settings;
+
+/**
+ * Collects parameters that control the decryption of settings.
+ *
+ * @author Benjamin Bentmann
+ */
+public class DefaultSettingsDecryptionRequest
+ implements SettingsDecryptionRequest
+{
+
+ private List<Server> servers;
+
+ private List<Proxy> proxies;
+
+ /**
+ * Creates an empty request.
+ */
+ public DefaultSettingsDecryptionRequest()
+ {
+ // does nothing
+ }
+
+ /**
+ * Creates a new request to decrypt the specified settings.
+ *
+ * @param settings The settings to decrypt, must not be {@code null}.
+ */
+ public DefaultSettingsDecryptionRequest( Settings settings )
+ {
+ setServers( settings.getServers() );
+ setProxies( settings.getProxies() );
+ }
+
+ /**
+ * Creates a new request to decrypt the specified server.
+ *
+ * @param server The server to decrypt, must not be {@code null}.
+ */
+ public DefaultSettingsDecryptionRequest( Server server )
+ {
+ this.servers = new ArrayList<Server>( Arrays.asList( server ) );
+ }
+
+ /**
+ * Creates a new request to decrypt the specified proxy.
+ *
+ * @param proxy The proxy to decrypt, must not be {@code null}.
+ */
+ public DefaultSettingsDecryptionRequest( Proxy proxy )
+ {
+ this.proxies = new ArrayList<Proxy>( Arrays.asList( proxy ) );
+ }
+
+ public List<Server> getServers()
+ {
+ if ( servers == null )
+ {
+ servers = new ArrayList<Server>();
+ }
+
+ return servers;
+ }
+
+ public DefaultSettingsDecryptionRequest setServers( List<Server> servers )
+ {
+ this.servers = servers;
+
+ return this;
+ }
+
+ public List<Proxy> getProxies()
+ {
+ if ( proxies == null )
+ {
+ proxies = new ArrayList<Proxy>();
+ }
+
+ return proxies;
+ }
+
+ public DefaultSettingsDecryptionRequest setProxies( List<Proxy> proxies )
+ {
+ this.proxies = proxies;
+
+ return this;
+ }
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionRequest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,76 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.building.SettingsProblem;
+
+/**
+ * Collects the output of the settings decrypter.
+ *
+ * @author Benjamin Bentmann
+ */
+class DefaultSettingsDecryptionResult
+ implements SettingsDecryptionResult
+{
+
+ private List<Server> servers;
+
+ private List<Proxy> proxies;
+
+ private List<SettingsProblem> problems;
+
+ public DefaultSettingsDecryptionResult( List<Server> servers, List<Proxy> proxies, List<SettingsProblem> problems )
+ {
+ this.servers = ( servers != null ) ? servers : new ArrayList<Server>();
+ this.proxies = ( proxies != null ) ? proxies : new ArrayList<Proxy>();
+ this.problems = ( problems != null ) ? problems : new ArrayList<SettingsProblem>();
+ }
+
+ public Server getServer()
+ {
+ return servers.isEmpty() ? null : servers.get( 0 );
+ }
+
+ public List<Server> getServers()
+ {
+ return servers;
+ }
+
+ public Proxy getProxy()
+ {
+ return proxies.isEmpty() ? null : proxies.get( 0 );
+ }
+
+ public List<Proxy> getProxies()
+ {
+ return proxies;
+ }
+
+ public List<SettingsProblem> getProblems()
+ {
+ return problems;
+ }
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/DefaultSettingsDecryptionResult.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,38 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Decrypts passwords in the settings.
+ *
+ * @author Benjamin Bentmann
+ */
+public interface SettingsDecrypter
+{
+
+ /**
+ * Decrypts passwords in the settings.
+ *
+ * @param request The settings decryption request that holds the parameters, must not be {@code null}.
+ * @return The result of the settings decryption, never {@code null}.
+ */
+ SettingsDecryptionResult decrypt( SettingsDecryptionRequest request );
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecrypter.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,65 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+
+/**
+ * Collects parameters that control the decryption of settings.
+ *
+ * @author Benjamin Bentmann
+ */
+public interface SettingsDecryptionRequest
+{
+
+ /**
+ * Gets the servers whose passwords should be decrypted.
+ *
+ * @return The servers to decrypt, never {@code null}.
+ */
+ List<Server> getServers();
+
+ /**
+ * Sets the servers whose passwords should be decrypted.
+ *
+ * @param servers The servers to decrypt, may be {@code null}.
+ * @return This request, never {@code null}.
+ */
+ SettingsDecryptionRequest setServers( List<Server> servers );
+
+ /**
+ * Gets the proxies whose passwords should be decrypted.
+ *
+ * @return The proxies to decrypt, never {@code null}.
+ */
+ List<Proxy> getProxies();
+
+ /**
+ * Sets the proxies whose passwords should be decrypted.
+ *
+ * @param proxies The proxies to decrypt, may be {@code null}.
+ * @return This request, never {@code null}.
+ */
+ SettingsDecryptionRequest setProxies( List<Proxy> proxies );
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionRequest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java
URL: http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java?rev=882578&view=auto
==============================================================================
--- maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java (added)
+++ maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java Fri Nov 20 14:39:57 2009
@@ -0,0 +1,71 @@
+package org.apache.maven.settings.crypto;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Server;
+import org.apache.maven.settings.building.SettingsProblem;
+
+/**
+ * Collects the output of the settings decrypter.
+ *
+ * @author Benjamin Bentmann
+ */
+public interface SettingsDecryptionResult
+{
+
+ /**
+ * Gets the decrypted server. This is a convenience method to retrieve the first element from {@link #getServer()}.
+ *
+ * @return The decrypted server or {@code null}.
+ */
+ Server getServer();
+
+ /**
+ * Gets the decrypted servers.
+ *
+ * @return The decrypted server, can be empty but never {@code null}.
+ */
+ List<Server> getServers();
+
+ /**
+ * Gets the decrypted proxy. This is a convenience method to retrieve the first element from {@link #getProxy()}.
+ *
+ * @return The decrypted proxy or {@code null}.
+ */
+ Proxy getProxy();
+
+ /**
+ * Gets the decrypted proxies.
+ *
+ * @return The decrypted proxy, can be empty but never {@code null}.
+ */
+ List<Proxy> getProxies();
+
+ /**
+ * Gets the problems that were encountered during the settings decryption.
+ *
+ * @return The problems that were encountered during the decryption, can be empty but never {@code null}.
+ */
+ List<SettingsProblem> getProblems();
+
+}
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/settings/crypto/SettingsDecryptionResult.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision