Browse Source

Deactivating code generation.

Moving generated code to src tree.
Adding licensing part to files
pull/51/head
Martin Stockhammer 5 years ago
parent
commit
790e38f5ec
28 changed files with 8837 additions and 42 deletions
  1. 0
    42
      archiva-modules/archiva-base/archiva-configuration/pom.xml
  2. 262
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConfiguration.java
  3. 359
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConnectorConfiguration.java
  4. 93
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaDefaultConfiguration.java
  5. 236
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaRuntimeConfiguration.java
  6. 141
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/CacheConfiguration.java
  7. 845
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/Configuration.java
  8. 91
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileLockConfiguration.java
  9. 146
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileType.java
  10. 384
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapConfiguration.java
  11. 116
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapGroupMapping.java
  12. 158
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LegacyArtifactPath.java
  13. 353
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ManagedRepositoryConfiguration.java
  14. 119
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkConfiguration.java
  15. 259
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkProxyConfiguration.java
  16. 118
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/OrganisationInformation.java
  17. 120
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorConfiguration.java
  18. 147
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorRuleConfiguration.java
  19. 341
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RedbackRuntimeConfiguration.java
  20. 452
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RemoteRepositoryConfiguration.java
  21. 96
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryCheckPath.java
  22. 198
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryGroupConfiguration.java
  23. 191
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryScanningConfiguration.java
  24. 95
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/SyncConnectorConfiguration.java
  25. 170
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/UserInterfaceOptions.java
  26. 68
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/WebappConfiguration.java
  27. 1944
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryReader.java
  28. 1335
    0
      archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryWriter.java

+ 0
- 42
archiva-modules/archiva-base/archiva-configuration/pom.xml View File

@@ -147,48 +147,6 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
<execution>
<id>archiva-registry-reader</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorId>registry-reader</generatorId>
</configuration>
</execution>
<execution>
<id>archiva-registry-writer</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatorId>registry-writer</generatorId>
</configuration>
</execution>
<execution>
<id>site-docs</id>
<phase>pre-site</phase>
<goals>
<goal>xdoc</goal>
</goals>
</execution>
</executions>
<configuration>
<version>3.0.0</version>
<models>
<model>src/main/mdo/configuration.mdo</model>
</models>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>

+ 262
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConfiguration.java View File

@@ -0,0 +1,262 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class AbstractRepositoryConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class AbstractRepositoryConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The repository identifier.
*
*/
private String id;

/**
*
* The repository type. Currently only MAVEN type
* is known.
*
*/
private String type = "MAVEN";

/**
*
* The descriptive name of the repository.
*
*/
private String name;

/**
*
* The layout of the repository. Valid values are
* "default" and "legacy".
*
*/
private String layout = "default";

/**
*
* The directory for the indexes of this
* repository.
*
*/
private String indexDir = "";

/**
*
* The directory for the packed indexes of this
* repository.
*
*/
private String packedIndexDir = "";

/**
*
* The description of this repository.
*
*/
private String description = "";


//-----------/
//- Methods -/
//-----------/

/**
* Get the description of this repository.
*
* @return String
*/
public String getDescription()
{
return this.description;
} //-- String getDescription()

/**
* Get the repository identifier.
*
* @return String
*/
public String getId()
{
return this.id;
} //-- String getId()

/**
* Get the directory for the indexes of this repository.
*
* @return String
*/
public String getIndexDir()
{
return this.indexDir;
} //-- String getIndexDir()

/**
* Get the layout of the repository. Valid values are "default"
* and "legacy".
*
* @return String
*/
public String getLayout()
{
return this.layout;
} //-- String getLayout()

/**
* Get the descriptive name of the repository.
*
* @return String
*/
public String getName()
{
return this.name;
} //-- String getName()

/**
* Get the directory for the packed indexes of this repository.
*
* @return String
*/
public String getPackedIndexDir()
{
return this.packedIndexDir;
} //-- String getPackedIndexDir()

/**
* Get the repository type. Currently only MAVEN type is known.
*
* @return String
*/
public String getType()
{
return this.type;
} //-- String getType()

/**
* Set the description of this repository.
*
* @param description
*/
public void setDescription( String description )
{
this.description = description;
} //-- void setDescription( String )

/**
* Set the repository identifier.
*
* @param id
*/
public void setId( String id )
{
this.id = id;
} //-- void setId( String )

/**
* Set the directory for the indexes of this repository.
*
* @param indexDir
*/
public void setIndexDir( String indexDir )
{
this.indexDir = indexDir;
} //-- void setIndexDir( String )

/**
* Set the layout of the repository. Valid values are "default"
* and "legacy".
*
* @param layout
*/
public void setLayout( String layout )
{
this.layout = layout;
} //-- void setLayout( String )

/**
* Set the descriptive name of the repository.
*
* @param name
*/
public void setName( String name )
{
this.name = name;
} //-- void setName( String )

/**
* Set the directory for the packed indexes of this repository.
*
* @param packedIndexDir
*/
public void setPackedIndexDir( String packedIndexDir )
{
this.packedIndexDir = packedIndexDir;
} //-- void setPackedIndexDir( String )

/**
* Set the repository type. Currently only MAVEN type is known.
*
* @param type
*/
public void setType( String type )
{
this.type = type;
} //-- void setType( String )

public int hashCode()
{
int result = 17;
result = 37 * result + ( id != null ? id.hashCode() : 0 );
return result;
}

public boolean equals( Object other )
{
if ( this == other )
{
return true;
}

if ( !( other instanceof AbstractRepositoryConfiguration ) )
{
return false;
}

AbstractRepositoryConfiguration that = (AbstractRepositoryConfiguration) other;
boolean result = true;
result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
return result;
}
}

+ 359
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/AbstractRepositoryConnectorConfiguration.java View File

@@ -0,0 +1,359 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class AbstractRepositoryConnectorConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class AbstractRepositoryConnectorConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The Repository Source for this connector.
*
*/
private String sourceRepoId;

/**
*
* The Repository Target for this connector.
*
*/
private String targetRepoId;

/**
*
* The network proxy ID to use for this connector.
*
*/
private String proxyId;

/**
* Field blackListPatterns.
*/
private java.util.List<String> blackListPatterns;

/**
* Field whiteListPatterns.
*/
private java.util.List<String> whiteListPatterns;

/**
* Field policies.
*/
private java.util.Map policies;

/**
* Field properties.
*/
private java.util.Map properties;

/**
*
* If the the repository proxy connector is
* disabled or not
* .
*/
private boolean disabled = false;


//-----------/
//- Methods -/
//-----------/

/**
* Method addBlackListPattern.
*
* @param string
*/
public void addBlackListPattern( String string )
{
getBlackListPatterns().add( string );
} //-- void addBlackListPattern( String )

/**
* Method addPolicy.
*
* @param key
* @param value
*/
public void addPolicy( Object key, String value )
{
getPolicies().put( key, value );
} //-- void addPolicy( Object, String )

/**
* Method addProperty.
*
* @param key
* @param value
*/
public void addProperty( Object key, String value )
{
getProperties().put( key, value );
} //-- void addProperty( Object, String )

/**
* Method addWhiteListPattern.
*
* @param string
*/
public void addWhiteListPattern( String string )
{
getWhiteListPatterns().add( string );
} //-- void addWhiteListPattern( String )

/**
* Method getBlackListPatterns.
*
* @return List
*/
public java.util.List<String> getBlackListPatterns()
{
if ( this.blackListPatterns == null )
{
this.blackListPatterns = new java.util.ArrayList<String>();
}

return this.blackListPatterns;
} //-- java.util.List<String> getBlackListPatterns()

/**
* Method getPolicies.
*
* @return Map
*/
public java.util.Map getPolicies()
{
if ( this.policies == null )
{
this.policies = new java.util.HashMap();
}

return this.policies;
} //-- java.util.Map getPolicies()

/**
* Method getProperties.
*
* @return Map
*/
public java.util.Map getProperties()
{
if ( this.properties == null )
{
this.properties = new java.util.HashMap();
}

return this.properties;
} //-- java.util.Map getProperties()

/**
* Get the network proxy ID to use for this connector.
*
* @return String
*/
public String getProxyId()
{
return this.proxyId;
} //-- String getProxyId()

/**
* Get the Repository Source for this connector.
*
* @return String
*/
public String getSourceRepoId()
{
return this.sourceRepoId;
} //-- String getSourceRepoId()

/**
* Get the Repository Target for this connector.
*
* @return String
*/
public String getTargetRepoId()
{
return this.targetRepoId;
} //-- String getTargetRepoId()

/**
* Method getWhiteListPatterns.
*
* @return List
*/
public java.util.List<String> getWhiteListPatterns()
{
if ( this.whiteListPatterns == null )
{
this.whiteListPatterns = new java.util.ArrayList<String>();
}

return this.whiteListPatterns;
} //-- java.util.List<String> getWhiteListPatterns()

/**
* Get if the the repository proxy connector is disabled or
* not.
*
* @return boolean
*/
public boolean isDisabled()
{
return this.disabled;
} //-- boolean isDisabled()

/**
* Method removeBlackListPattern.
*
* @param string
*/
public void removeBlackListPattern( String string )
{
getBlackListPatterns().remove( string );
} //-- void removeBlackListPattern( String )

/**
* Method removeWhiteListPattern.
*
* @param string
*/
public void removeWhiteListPattern( String string )
{
getWhiteListPatterns().remove( string );
} //-- void removeWhiteListPattern( String )

/**
* Set the list of blacklisted patterns for this connector.
*
* @param blackListPatterns
*/
public void setBlackListPatterns( java.util.List<String> blackListPatterns )
{
this.blackListPatterns = blackListPatterns;
} //-- void setBlackListPatterns( java.util.List )

/**
* Set if the the repository proxy connector is disabled or
* not.
*
* @param disabled
*/
public void setDisabled( boolean disabled )
{
this.disabled = disabled;
} //-- void setDisabled( boolean )

/**
* Set policy configuration for the connector.
*
* @param policies
*/
public void setPolicies( java.util.Map policies )
{
this.policies = policies;
} //-- void setPolicies( java.util.Map )

/**
* Set configuration for the connector.
*
* @param properties
*/
public void setProperties( java.util.Map properties )
{
this.properties = properties;
} //-- void setProperties( java.util.Map )

/**
* Set the network proxy ID to use for this connector.
*
* @param proxyId
*/
public void setProxyId( String proxyId )
{
this.proxyId = proxyId;
} //-- void setProxyId( String )

/**
* Set the Repository Source for this connector.
*
* @param sourceRepoId
*/
public void setSourceRepoId( String sourceRepoId )
{
this.sourceRepoId = sourceRepoId;
} //-- void setSourceRepoId( String )

/**
* Set the Repository Target for this connector.
*
* @param targetRepoId
*/
public void setTargetRepoId( String targetRepoId )
{
this.targetRepoId = targetRepoId;
} //-- void setTargetRepoId( String )

/**
* Set the list of whitelisted patterns for this connector.
*
* @param whiteListPatterns
*/
public void setWhiteListPatterns( java.util.List<String> whiteListPatterns )
{
this.whiteListPatterns = whiteListPatterns;
} //-- void setWhiteListPatterns( java.util.List )

/**
* Obtain a specific policy from the underlying connector.
*
* @param policyId the policy id to fetch.
* @param defaultValue the default value for the policy id.
* @return the configured policy value (or default value if not found).
*/
public String getPolicy( String policyId, String defaultValue )
{
if ( this.getPolicies() == null )
{
return null;
}

Object value = this.getPolicies().get( policyId );

if ( value == null )
{
return defaultValue;
}

return (String) value;
}
}

+ 93
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaDefaultConfiguration.java View File

@@ -0,0 +1,93 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* Archiva default settings.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class ArchivaDefaultConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* Field defaultCheckPaths.
*/
private java.util.List<RepositoryCheckPath> defaultCheckPaths;


//-----------/
//- Methods -/
//-----------/

/**
* Method addDefaultCheckPath.
*
* @param repositoryCheckPath
*/
public void addDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
{
getDefaultCheckPaths().add( repositoryCheckPath );
} //-- void addDefaultCheckPath( RepositoryCheckPath )

/**
* Method getDefaultCheckPaths.
*
* @return List
*/
public java.util.List<RepositoryCheckPath> getDefaultCheckPaths()
{
if ( this.defaultCheckPaths == null )
{
this.defaultCheckPaths = new java.util.ArrayList<RepositoryCheckPath>();
}

return this.defaultCheckPaths;
} //-- java.util.List<RepositoryCheckPath> getDefaultCheckPaths()

/**
* Method removeDefaultCheckPath.
*
* @param repositoryCheckPath
*/
public void removeDefaultCheckPath( RepositoryCheckPath repositoryCheckPath )
{
getDefaultCheckPaths().remove( repositoryCheckPath );
} //-- void removeDefaultCheckPath( RepositoryCheckPath )

/**
* Set the default check paths for certain remote repositories.
*
* @param defaultCheckPaths
*/
public void setDefaultCheckPaths( java.util.List<RepositoryCheckPath> defaultCheckPaths )
{
this.defaultCheckPaths = defaultCheckPaths;
} //-- void setDefaultCheckPaths( java.util.List )

}

+ 236
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ArchivaRuntimeConfiguration.java View File

@@ -0,0 +1,236 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The runtime configuration.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class ArchivaRuntimeConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* the url failure cache configuration.
*/
private CacheConfiguration urlFailureCacheConfiguration;

/**
* the FileLocking configuration.
*/
private FileLockConfiguration fileLockConfiguration;

/**
* The base directory where the archiva data is stored. If not
* set, the appserver.base is used.
*/
private String dataDirectory;

/**
* The base directory for local storage of repository data. If
* not set, it's ${dataDirectory}/repositories.
*/
private String repositoryBaseDirectory;

/**
* The base directory for local storage of remote repository
* data. If not set, it's ${dataDirectory}/remotes.
*/
private String remoteRepositoryBaseDirectory;

/**
* The default language used for setting internationalized
* strings.
*/
private String defaultLanguage = "en-US";

/**
* Comma separated list of language patterns. Sorted by
* priority descending. Used for display of internationalized
* strings.
*/
private String languageRange = "en,fr,de";


//-----------/
//- Methods -/
//-----------/

/**
* Get the base directory where the archiva data is stored. If
* not set, the appserver.base is used.
*
* @return String
*/
public String getDataDirectory()
{
return this.dataDirectory;
} //-- String getDataDirectory()

/**
* Get the default language used for setting internationalized
* strings.
*
* @return String
*/
public String getDefaultLanguage()
{
return this.defaultLanguage;
} //-- String getDefaultLanguage()

/**
* Get the FileLocking configuration.
*
* @return FileLockConfiguration
*/
public FileLockConfiguration getFileLockConfiguration()
{
return this.fileLockConfiguration;
} //-- FileLockConfiguration getFileLockConfiguration()

/**
* Get comma separated list of language patterns. Sorted by
* priority descending. Used for display of internationalized
* strings.
*
* @return String
*/
public String getLanguageRange()
{
return this.languageRange;
} //-- String getLanguageRange()

/**
* Get the base directory for local storage of remote
* repository data. If not set, it's ${dataDirectory}/remotes.
*
* @return String
*/
public String getRemoteRepositoryBaseDirectory()
{
return this.remoteRepositoryBaseDirectory;
} //-- String getRemoteRepositoryBaseDirectory()

/**
* Get the base directory for local storage of repository data.
* If not set, it's ${dataDirectory}/repositories.
*
* @return String
*/
public String getRepositoryBaseDirectory()
{
return this.repositoryBaseDirectory;
} //-- String getRepositoryBaseDirectory()

/**
* Get the url failure cache configuration.
*
* @return CacheConfiguration
*/
public CacheConfiguration getUrlFailureCacheConfiguration()
{
return this.urlFailureCacheConfiguration;
} //-- CacheConfiguration getUrlFailureCacheConfiguration()

/**
* Set the base directory where the archiva data is stored. If
* not set, the appserver.base is used.
*
* @param dataDirectory
*/
public void setDataDirectory( String dataDirectory )
{
this.dataDirectory = dataDirectory;
} //-- void setDataDirectory( String )

/**
* Set the default language used for setting internationalized
* strings.
*
* @param defaultLanguage
*/
public void setDefaultLanguage( String defaultLanguage )
{
this.defaultLanguage = defaultLanguage;
} //-- void setDefaultLanguage( String )

/**
* Set the FileLocking configuration.
*
* @param fileLockConfiguration
*/
public void setFileLockConfiguration( FileLockConfiguration fileLockConfiguration )
{
this.fileLockConfiguration = fileLockConfiguration;
} //-- void setFileLockConfiguration( FileLockConfiguration )

/**
* Set comma separated list of language patterns. Sorted by
* priority descending. Used for display of internationalized
* strings.
*
* @param languageRange
*/
public void setLanguageRange( String languageRange )
{
this.languageRange = languageRange;
} //-- void setLanguageRange( String )

/**
* Set the base directory for local storage of remote
* repository data. If not set, it's ${dataDirectory}/remotes.
*
* @param remoteRepositoryBaseDirectory
*/
public void setRemoteRepositoryBaseDirectory( String remoteRepositoryBaseDirectory )
{
this.remoteRepositoryBaseDirectory = remoteRepositoryBaseDirectory;
} //-- void setRemoteRepositoryBaseDirectory( String )

/**
* Set the base directory for local storage of repository data.
* If not set, it's ${dataDirectory}/repositories.
*
* @param repositoryBaseDirectory
*/
public void setRepositoryBaseDirectory( String repositoryBaseDirectory )
{
this.repositoryBaseDirectory = repositoryBaseDirectory;
} //-- void setRepositoryBaseDirectory( String )

/**
* Set the url failure cache configuration.
*
* @param urlFailureCacheConfiguration
*/
public void setUrlFailureCacheConfiguration( CacheConfiguration urlFailureCacheConfiguration )
{
this.urlFailureCacheConfiguration = urlFailureCacheConfiguration;
} //-- void setUrlFailureCacheConfiguration( CacheConfiguration )

}

+ 141
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/CacheConfiguration.java View File

@@ -0,0 +1,141 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Cache configuration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class CacheConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* TimeToIdleSeconds.
*/
private int timeToIdleSeconds = -1;

/**
* TimeToLiveSeconds.
*/
private int timeToLiveSeconds = -1;

/**
* max elements in memory.
*/
private int maxElementsInMemory = -1;

/**
* max elements on disk.
*/
private int maxElementsOnDisk = -1;


//-----------/
//- Methods -/
//-----------/

/**
* Get max elements in memory.
*
* @return int
*/
public int getMaxElementsInMemory()
{
return this.maxElementsInMemory;
} //-- int getMaxElementsInMemory()

/**
* Get max elements on disk.
*
* @return int
*/
public int getMaxElementsOnDisk()
{
return this.maxElementsOnDisk;
} //-- int getMaxElementsOnDisk()

/**
* Get timeToIdleSeconds.
*
* @return int
*/
public int getTimeToIdleSeconds()
{
return this.timeToIdleSeconds;
} //-- int getTimeToIdleSeconds()

/**
* Get timeToLiveSeconds.
*
* @return int
*/
public int getTimeToLiveSeconds()
{
return this.timeToLiveSeconds;
} //-- int getTimeToLiveSeconds()

/**
* Set max elements in memory.
*
* @param maxElementsInMemory
*/
public void setMaxElementsInMemory( int maxElementsInMemory )
{
this.maxElementsInMemory = maxElementsInMemory;
} //-- void setMaxElementsInMemory( int )

/**
* Set max elements on disk.
*
* @param maxElementsOnDisk
*/
public void setMaxElementsOnDisk( int maxElementsOnDisk )
{
this.maxElementsOnDisk = maxElementsOnDisk;
} //-- void setMaxElementsOnDisk( int )

/**
* Set timeToIdleSeconds.
*
* @param timeToIdleSeconds
*/
public void setTimeToIdleSeconds( int timeToIdleSeconds )
{
this.timeToIdleSeconds = timeToIdleSeconds;
} //-- void setTimeToIdleSeconds( int )

/**
* Set timeToLiveSeconds.
*
* @param timeToLiveSeconds
*/
public void setTimeToLiveSeconds( int timeToLiveSeconds )
{
this.timeToLiveSeconds = timeToLiveSeconds;
} //-- void setTimeToLiveSeconds( int )

}

+ 845
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/Configuration.java View File

@@ -0,0 +1,845 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class Configuration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class Configuration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* This is the version of the configuration format.
*/
private String version = "3.0.0";

/**
* The type of the metadata storage. Allowed values: jcr, file,
* cassandra.
*/
private String metadataStore = "jcr";

/**
* Field repositoryGroups.
*/
private java.util.List<RepositoryGroupConfiguration> repositoryGroups;

/**
* Field managedRepositories.
*/
private java.util.List<ManagedRepositoryConfiguration> managedRepositories;

/**
* Field remoteRepositories.
*/
private java.util.List<RemoteRepositoryConfiguration> remoteRepositories;

/**
* Field proxyConnectors.
*/
private java.util.List<ProxyConnectorConfiguration> proxyConnectors;

/**
* Field networkProxies.
*/
private java.util.List<NetworkProxyConfiguration> networkProxies;

/**
* Field legacyArtifactPaths.
*/
private java.util.List<LegacyArtifactPath> legacyArtifactPaths;

/**
*
* The repository scanning configuration.
*
*/
private RepositoryScanningConfiguration repositoryScanning;

/**
*
* The webapp configuration.
*
*/
private WebappConfiguration webapp;

/**
*
* The organisation info.
*
*/
private OrganisationInformation organisationInfo;

/**
*
* The NetworkConfiguration .
*
*/
private NetworkConfiguration networkConfiguration;

/**
* The RedbackRuntimeConfiguration.
*/
private RedbackRuntimeConfiguration redbackRuntimeConfiguration;

/**
* The ArchivaRuntimeConfiguration.
*/
private ArchivaRuntimeConfiguration archivaRuntimeConfiguration;

/**
* Field proxyConnectorRuleConfigurations.
*/
private java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations;

/**
* Archiva default settings.
*/
private ArchivaDefaultConfiguration archivaDefaultConfiguration;

/**
* Field modelEncoding.
*/
private String modelEncoding = "UTF-8";


//-----------/
//- Methods -/
//-----------/

/**
* Method addLegacyArtifactPath.
*
* @param legacyArtifactPath
*/
public void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
{
getLegacyArtifactPaths().add( legacyArtifactPath );
} //-- void addLegacyArtifactPath( LegacyArtifactPath )

/**
* Method addManagedRepository.
*
* @param managedRepositoryConfiguration
*/
public void addManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
{
getManagedRepositories().add( managedRepositoryConfiguration );
} //-- void addManagedRepository( ManagedRepositoryConfiguration )

/**
* Method addNetworkProxy.
*
* @param networkProxyConfiguration
*/
public void addNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
{
getNetworkProxies().add( networkProxyConfiguration );
} //-- void addNetworkProxy( NetworkProxyConfiguration )

/**
* Method addProxyConnector.
*
* @param proxyConnectorConfiguration
*/
public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
{
getProxyConnectors().add( proxyConnectorConfiguration );
} //-- void addProxyConnector( ProxyConnectorConfiguration )

/**
* Method addProxyConnectorRuleConfiguration.
*
* @param proxyConnectorRuleConfiguration
*/
public void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
{
getProxyConnectorRuleConfigurations().add( proxyConnectorRuleConfiguration );
} //-- void addProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )

/**
* Method addRemoteRepository.
*
* @param remoteRepositoryConfiguration
*/
public void addRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
{
getRemoteRepositories().add( remoteRepositoryConfiguration );
} //-- void addRemoteRepository( RemoteRepositoryConfiguration )

/**
* Method addRepositoryGroup.
*
* @param repositoryGroupConfiguration
*/
public void addRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
{
getRepositoryGroups().add( repositoryGroupConfiguration );
} //-- void addRepositoryGroup( RepositoryGroupConfiguration )

/**
* Get archiva default settings.
*
* @return ArchivaDefaultConfiguration
*/
public ArchivaDefaultConfiguration getArchivaDefaultConfiguration()
{
return this.archivaDefaultConfiguration;
} //-- ArchivaDefaultConfiguration getArchivaDefaultConfiguration()

/**
* Get the ArchivaRuntimeConfiguration.
*
* @return ArchivaRuntimeConfiguration
*/
public ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()
{
return this.archivaRuntimeConfiguration;
} //-- ArchivaRuntimeConfiguration getArchivaRuntimeConfiguration()

/**
* Method getLegacyArtifactPaths.
*
* @return List
*/
public java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()
{
if ( this.legacyArtifactPaths == null )
{
this.legacyArtifactPaths = new java.util.ArrayList<LegacyArtifactPath>();
}

return this.legacyArtifactPaths;
} //-- java.util.List<LegacyArtifactPath> getLegacyArtifactPaths()

/**
* Method getManagedRepositories.
*
* @return List
*/
public java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()
{
if ( this.managedRepositories == null )
{
this.managedRepositories = new java.util.ArrayList<ManagedRepositoryConfiguration>();
}

return this.managedRepositories;
} //-- java.util.List<ManagedRepositoryConfiguration> getManagedRepositories()

/**
* Get the type of the metadata storage. Allowed values: jcr,
* file, cassandra.
*
* @return String
*/
public String getMetadataStore()
{
return this.metadataStore;
} //-- String getMetadataStore()

/**
* Get the modelEncoding field.
*
* @return String
*/
public String getModelEncoding()
{
return this.modelEncoding;
} //-- String getModelEncoding()

/**
* Get the NetworkConfiguration .
*
* @return NetworkConfiguration
*/
public NetworkConfiguration getNetworkConfiguration()
{
return this.networkConfiguration;
} //-- NetworkConfiguration getNetworkConfiguration()

/**
* Method getNetworkProxies.
*
* @return List
*/
public java.util.List<NetworkProxyConfiguration> getNetworkProxies()
{
if ( this.networkProxies == null )
{
this.networkProxies = new java.util.ArrayList<NetworkProxyConfiguration>();
}

return this.networkProxies;
} //-- java.util.List<NetworkProxyConfiguration> getNetworkProxies()

/**
* Get the organisation info.
*
* @return OrganisationInformation
*/
public OrganisationInformation getOrganisationInfo()
{
return this.organisationInfo;
} //-- OrganisationInformation getOrganisationInfo()

/**
* Method getProxyConnectorRuleConfigurations.
*
* @return List
*/
public java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()
{
if ( this.proxyConnectorRuleConfigurations == null )
{
this.proxyConnectorRuleConfigurations = new java.util.ArrayList<ProxyConnectorRuleConfiguration>();
}

return this.proxyConnectorRuleConfigurations;
} //-- java.util.List<ProxyConnectorRuleConfiguration> getProxyConnectorRuleConfigurations()

/**
* Method getProxyConnectors.
*
* @return List
*/
public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
{
if ( this.proxyConnectors == null )
{
this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
}

return this.proxyConnectors;
} //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()

/**
* Get the RedbackRuntimeConfiguration.
*
* @return RedbackRuntimeConfiguration
*/
public RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()
{
return this.redbackRuntimeConfiguration;
} //-- RedbackRuntimeConfiguration getRedbackRuntimeConfiguration()

/**
* Method getRemoteRepositories.
*
* @return List
*/
public java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()
{
if ( this.remoteRepositories == null )
{
this.remoteRepositories = new java.util.ArrayList<RemoteRepositoryConfiguration>();
}

return this.remoteRepositories;
} //-- java.util.List<RemoteRepositoryConfiguration> getRemoteRepositories()

/**
* Method getRepositoryGroups.
*
* @return List
*/
public java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()
{
if ( this.repositoryGroups == null )
{
this.repositoryGroups = new java.util.ArrayList<RepositoryGroupConfiguration>();
}

return this.repositoryGroups;
} //-- java.util.List<RepositoryGroupConfiguration> getRepositoryGroups()

/**
* Get the repository scanning configuration.
*
* @return RepositoryScanningConfiguration
*/
public RepositoryScanningConfiguration getRepositoryScanning()
{
return this.repositoryScanning;
} //-- RepositoryScanningConfiguration getRepositoryScanning()

/**
* Get this is the version of the configuration format.
*
* @return String
*/
public String getVersion()
{
return this.version;
} //-- String getVersion()

/**
* Get the webapp configuration.
*
* @return WebappConfiguration
*/
public WebappConfiguration getWebapp()
{
return this.webapp;
} //-- WebappConfiguration getWebapp()

/**
* Method removeLegacyArtifactPath.
*
* @param legacyArtifactPath
*/
public void removeLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
{
getLegacyArtifactPaths().remove( legacyArtifactPath );
} //-- void removeLegacyArtifactPath( LegacyArtifactPath )

/**
* Method removeManagedRepository.
*
* @param managedRepositoryConfiguration
*/
public void removeManagedRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration )
{
getManagedRepositories().remove( managedRepositoryConfiguration );
} //-- void removeManagedRepository( ManagedRepositoryConfiguration )

/**
* Method removeNetworkProxy.
*
* @param networkProxyConfiguration
*/
public void removeNetworkProxy( NetworkProxyConfiguration networkProxyConfiguration )
{
getNetworkProxies().remove( networkProxyConfiguration );
} //-- void removeNetworkProxy( NetworkProxyConfiguration )

/**
* Method removeProxyConnector.
*
* @param proxyConnectorConfiguration
*/
public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
{
getProxyConnectors().remove( proxyConnectorConfiguration );
} //-- void removeProxyConnector( ProxyConnectorConfiguration )

/**
* Method removeProxyConnectorRuleConfiguration.
*
* @param proxyConnectorRuleConfiguration
*/
public void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration proxyConnectorRuleConfiguration )
{
getProxyConnectorRuleConfigurations().remove( proxyConnectorRuleConfiguration );
} //-- void removeProxyConnectorRuleConfiguration( ProxyConnectorRuleConfiguration )

/**
* Method removeRemoteRepository.
*
* @param remoteRepositoryConfiguration
*/
public void removeRemoteRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration )
{
getRemoteRepositories().remove( remoteRepositoryConfiguration );
} //-- void removeRemoteRepository( RemoteRepositoryConfiguration )

/**
* Method removeRepositoryGroup.
*
* @param repositoryGroupConfiguration
*/
public void removeRepositoryGroup( RepositoryGroupConfiguration repositoryGroupConfiguration )
{
getRepositoryGroups().remove( repositoryGroupConfiguration );
} //-- void removeRepositoryGroup( RepositoryGroupConfiguration )

/**
* Set archiva default settings.
*
* @param archivaDefaultConfiguration
*/
public void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration archivaDefaultConfiguration )
{
this.archivaDefaultConfiguration = archivaDefaultConfiguration;
} //-- void setArchivaDefaultConfiguration( ArchivaDefaultConfiguration )

/**
* Set the ArchivaRuntimeConfiguration.
*
* @param archivaRuntimeConfiguration
*/
public void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration archivaRuntimeConfiguration )
{
this.archivaRuntimeConfiguration = archivaRuntimeConfiguration;
} //-- void setArchivaRuntimeConfiguration( ArchivaRuntimeConfiguration )

/**
* Set the list of custom legacy path to artifact.
*
* @param legacyArtifactPaths
*/
public void setLegacyArtifactPaths( java.util.List<LegacyArtifactPath> legacyArtifactPaths )
{
this.legacyArtifactPaths = legacyArtifactPaths;
} //-- void setLegacyArtifactPaths( java.util.List )

/**
* Set the list of repositories that this archiva instance
* uses.
*
* @param managedRepositories
*/
public void setManagedRepositories( java.util.List<ManagedRepositoryConfiguration> managedRepositories )
{
this.managedRepositories = managedRepositories;
} //-- void setManagedRepositories( java.util.List )

/**
* Set the type of the metadata storage. Allowed values: jcr,
* file, cassandra.
*
* @param metadataStore
*/
public void setMetadataStore( String metadataStore )
{
this.metadataStore = metadataStore;
} //-- void setMetadataStore( String )

/**
* Set the modelEncoding field.
*
* @param modelEncoding
*/
public void setModelEncoding( String modelEncoding )
{
this.modelEncoding = modelEncoding;
} //-- void setModelEncoding( String )

/**
* Set the NetworkConfiguration .
*
* @param networkConfiguration
*/
public void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
{
this.networkConfiguration = networkConfiguration;
} //-- void setNetworkConfiguration( NetworkConfiguration )

/**
* Set the list of network proxies to use for outgoing
* requests.
*
* @param networkProxies
*/
public void setNetworkProxies( java.util.List<NetworkProxyConfiguration> networkProxies )
{
this.networkProxies = networkProxies;
} //-- void setNetworkProxies( java.util.List )

/**
* Set the organisation info.
*
* @param organisationInfo
*/
public void setOrganisationInfo( OrganisationInformation organisationInfo )
{
this.organisationInfo = organisationInfo;
} //-- void setOrganisationInfo( OrganisationInformation )

/**
* Set the list of ProxyConnectorRuleConfigurations.
*
* @param proxyConnectorRuleConfigurations
*/
public void setProxyConnectorRuleConfigurations( java.util.List<ProxyConnectorRuleConfiguration> proxyConnectorRuleConfigurations )
{
this.proxyConnectorRuleConfigurations = proxyConnectorRuleConfigurations;
} //-- void setProxyConnectorRuleConfigurations( java.util.List )

/**
* Set the list of proxy connectors for this archiva instance.
*
* @param proxyConnectors
*/
public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
{
this.proxyConnectors = proxyConnectors;
} //-- void setProxyConnectors( java.util.List )

/**
* Set the RedbackRuntimeConfiguration.
*
* @param redbackRuntimeConfiguration
*/
public void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration redbackRuntimeConfiguration )
{
this.redbackRuntimeConfiguration = redbackRuntimeConfiguration;
} //-- void setRedbackRuntimeConfiguration( RedbackRuntimeConfiguration )

/**
* Set the list of repositories that this archiva can retrieve
* from or publish to.
*
* @param remoteRepositories
*/
public void setRemoteRepositories( java.util.List<RemoteRepositoryConfiguration> remoteRepositories )
{
this.remoteRepositories = remoteRepositories;
} //-- void setRemoteRepositories( java.util.List )

/**
* Set the list of repository groups.
*
* @param repositoryGroups
*/
public void setRepositoryGroups( java.util.List<RepositoryGroupConfiguration> repositoryGroups )
{
this.repositoryGroups = repositoryGroups;
} //-- void setRepositoryGroups( java.util.List )

/**
* Set the repository scanning configuration.
*
* @param repositoryScanning
*/
public void setRepositoryScanning( RepositoryScanningConfiguration repositoryScanning )
{
this.repositoryScanning = repositoryScanning;
} //-- void setRepositoryScanning( RepositoryScanningConfiguration )

/**
* Set this is the version of the configuration format.
*
* @param version
*/
public void setVersion( String version )
{
this.version = version;
} //-- void setVersion( String )

/**
* Set the webapp configuration.
*
* @param webapp
*/
public void setWebapp( WebappConfiguration webapp )
{
this.webapp = webapp;
} //-- void setWebapp( WebappConfiguration )

private java.util.Map<String, java.util.List<String>> repositoryToGroupMap;
public java.util.Map<String, java.util.List<String>> getRepositoryToGroupMap()
{
if ( repositoryGroups != null )
{
java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
{
for ( String repositoryId : (java.util.List<String>) group.getRepositories() )
{
java.util.List<String> groups = map.get( repositoryId );
if ( groups == null )
{
groups = new java.util.ArrayList<String>();
map.put( repositoryId, groups );
}
groups.add( group.getId() );
}
}
repositoryToGroupMap = map;
}
return repositoryToGroupMap;
}
public java.util.Map<String, RepositoryGroupConfiguration> getRepositoryGroupsAsMap()
{
java.util.Map<String, RepositoryGroupConfiguration> map = new java.util.HashMap<String, RepositoryGroupConfiguration>();
if ( repositoryGroups != null )
{
for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
{
map.put( group.getId(), group );
}
}
return map;
}
public RepositoryGroupConfiguration findRepositoryGroupById( String id )
{
if ( repositoryGroups != null )
{
for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
{
if ( group.getId().equals( id ) )
{
return group;
}
}
}
return null;
}

private java.util.Map<String, java.util.List<String>> groupToRepositoryMap;

public java.util.Map<String, java.util.List<String>> getGroupToRepositoryMap()
{
if ( repositoryGroups != null && managedRepositories != null )
{
java.util.Map<String, java.util.List<String>> map = new java.util.HashMap<String, java.util.List<String>>();
for ( ManagedRepositoryConfiguration repo : (java.util.List<ManagedRepositoryConfiguration>) managedRepositories )
{
for ( RepositoryGroupConfiguration group : (java.util.List<RepositoryGroupConfiguration>) repositoryGroups )
{
if ( !group.getRepositories().contains( repo.getId() ) )
{
String groupId = group.getId();
java.util.List<String> repos = map.get( groupId );
if ( repos == null )
{
repos = new java.util.ArrayList<String>();
map.put( groupId, repos );
}
repos.add( repo.getId() );
}
}
}
groupToRepositoryMap = map;
}
return groupToRepositoryMap;
}
public java.util.Map<String, NetworkProxyConfiguration> getNetworkProxiesAsMap()
{
java.util.Map<String, NetworkProxyConfiguration> map = new java.util.HashMap<String, NetworkProxyConfiguration>();
if ( networkProxies != null )
{
for ( java.util.Iterator<NetworkProxyConfiguration> i = networkProxies.iterator(); i.hasNext(); )
{
NetworkProxyConfiguration proxy = i.next();
map.put( proxy.getId(), proxy );
}
}
return map;
}

public java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> getProxyConnectorAsMap()
{
java.util.Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap =
new java.util.HashMap<String, java.util.List<ProxyConnectorConfiguration>>();

if( proxyConnectors != null )
{
java.util.Iterator<ProxyConnectorConfiguration> it = proxyConnectors.iterator();
while ( it.hasNext() )
{
ProxyConnectorConfiguration proxyConfig = it.next();
String key = proxyConfig.getSourceRepoId();

java.util.List<ProxyConnectorConfiguration> connectors = proxyConnectorMap.get( key );
if ( connectors == null )
{
connectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
proxyConnectorMap.put( key, connectors );
}

connectors.add( proxyConfig );
java.util.Collections.sort( connectors,
org.apache.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator.getInstance() );
}
}

return proxyConnectorMap;
}

public java.util.Map<String, RemoteRepositoryConfiguration> getRemoteRepositoriesAsMap()
{
java.util.Map<String, RemoteRepositoryConfiguration> map = new java.util.HashMap<String, RemoteRepositoryConfiguration>();
if ( remoteRepositories != null )
{
for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
{
RemoteRepositoryConfiguration repo = i.next();
map.put( repo.getId(), repo );
}
}
return map;
}

public RemoteRepositoryConfiguration findRemoteRepositoryById( String id )
{
if ( remoteRepositories != null )
{
for ( java.util.Iterator<RemoteRepositoryConfiguration> i = remoteRepositories.iterator(); i.hasNext(); )
{
RemoteRepositoryConfiguration repo = i.next();
if ( repo.getId().equals( id ) )
{
return repo;
}
}
}
return null;
}

public java.util.Map<String, ManagedRepositoryConfiguration> getManagedRepositoriesAsMap()
{
java.util.Map<String, ManagedRepositoryConfiguration> map = new java.util.HashMap<String, ManagedRepositoryConfiguration>();
if ( managedRepositories != null )
{
for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
{
ManagedRepositoryConfiguration repo = i.next();
map.put( repo.getId(), repo );
}
}
return map;
}

public ManagedRepositoryConfiguration findManagedRepositoryById( String id )
{
if ( managedRepositories != null )
{
for ( java.util.Iterator<ManagedRepositoryConfiguration> i = managedRepositories.iterator(); i.hasNext(); )
{
ManagedRepositoryConfiguration repo = i.next();
if ( repo.getId().equals( id ) )
{
return repo;
}
}
}
return null;
}
}

+ 91
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileLockConfiguration.java View File

@@ -0,0 +1,91 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* File Locking configuration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class FileLockConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* skipping the locking mechanism.
*/
private boolean skipLocking = true;

/**
* maximum time to wait to get the file lock (0 infinite).
*/
private int lockingTimeout = 0;


//-----------/
//- Methods -/
//-----------/

/**
* Get maximum time to wait to get the file lock (0 infinite).
*
* @return int
*/
public int getLockingTimeout()
{
return this.lockingTimeout;
} //-- int getLockingTimeout()

/**
* Get skipping the locking mechanism.
*
* @return boolean
*/
public boolean isSkipLocking()
{
return this.skipLocking;
} //-- boolean isSkipLocking()

/**
* Set maximum time to wait to get the file lock (0 infinite).
*
* @param lockingTimeout
*/
public void setLockingTimeout( int lockingTimeout )
{
this.lockingTimeout = lockingTimeout;
} //-- void setLockingTimeout( int )

/**
* Set skipping the locking mechanism.
*
* @param skipLocking
*/
public void setSkipLocking( boolean skipLocking )
{
this.skipLocking = skipLocking;
} //-- void setSkipLocking( boolean )

}

+ 146
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/FileType.java View File

@@ -0,0 +1,146 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* The FileType object.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class FileType
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* Field id.
*/
private String id;

/**
* Field patterns.
*/
private java.util.List<String> patterns;


//-----------/
//- Methods -/
//-----------/

/**
* Method addPattern.
*
* @param string
*/
public void addPattern( String string )
{
getPatterns().add( string );
} //-- void addPattern( String )

/**
* Get the id field.
*
* @return String
*/
public String getId()
{
return this.id;
} //-- String getId()

/**
* Method getPatterns.
*
* @return List
*/
public java.util.List<String> getPatterns()
{
if ( this.patterns == null )
{
this.patterns = new java.util.ArrayList<String>();
}

return this.patterns;
} //-- java.util.List<String> getPatterns()

/**
* Method removePattern.
*
* @param string
*/
public void removePattern( String string )
{
getPatterns().remove( string );
} //-- void removePattern( String )

/**
* Set the id field.
*
* @param id
*/
public void setId( String id )
{
this.id = id;
} //-- void setId( String )

/**
* Set the patterns field.
*
* @param patterns
*/
public void setPatterns( java.util.List<String> patterns )
{
this.patterns = patterns;
} //-- void setPatterns( java.util.List )


@Override
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( o == null || getClass() != o.getClass() )
{
return false;
}

FileType fileType = (FileType) o;

if ( id != null ? !id.equals( fileType.id ) : fileType.id != null )
{
return false;
}

return true;
}

@Override
public int hashCode()
{
return id != null ? 37 + id.hashCode() : 0;
}
}

+ 384
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapConfiguration.java View File

@@ -0,0 +1,384 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The LDAP configuration.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class LdapConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* The LDAP host.
*/
private String hostName;

/**
* The LDAP port.
*/
private int port = 0;

/**
* ssl LDAP connection.
*/
private boolean ssl = false;

/**
* The LDAP base dn.
*/
private String baseDn;

/**
* The LDAP base dn for groups (if empty baseDn is used).
*/
private String baseGroupsDn;

/**
* contextFactory to use.
*/
private String contextFactory;

/**
* The LDAP bind dn.
*/
private String bindDn;

/**
* The LDAP password.
*/
private String password;

/**
* The LDAP authenticationMethod.
*/
private String authenticationMethod;

/**
* The LDAP authenticator enabled.
*/
private boolean bindAuthenticatorEnabled = false;

/**
* LDAP writable.
*/
private boolean writable = false;

/**
* Will use role name as LDAP group.
*/
private boolean useRoleNameAsGroup = false;

/**
* Field extraProperties.
*/
private java.util.Map extraProperties;


//-----------/
//- Methods -/
//-----------/

/**
* Method addExtraProperty.
*
* @param key
* @param value
*/
public void addExtraProperty( Object key, String value )
{
getExtraProperties().put( key, value );
} //-- void addExtraProperty( Object, String )

/**
* Get the LDAP authenticationMethod.
*
* @return String
*/
public String getAuthenticationMethod()
{
return this.authenticationMethod;
} //-- String getAuthenticationMethod()

/**
* Get the LDAP base dn.
*
* @return String
*/
public String getBaseDn()
{
return this.baseDn;
} //-- String getBaseDn()

/**
* Get the LDAP base dn for groups (if empty baseDn is used).
*
* @return String
*/
public String getBaseGroupsDn()
{
return this.baseGroupsDn;
} //-- String getBaseGroupsDn()

/**
* Get the LDAP bind dn.
*
* @return String
*/
public String getBindDn()
{
return this.bindDn;
} //-- String getBindDn()

/**
* Get contextFactory to use.
*
* @return String
*/
public String getContextFactory()
{
return this.contextFactory;
} //-- String getContextFactory()

/**
* Method getExtraProperties.
*
* @return Map
*/
public java.util.Map getExtraProperties()
{
if ( this.extraProperties == null )
{
this.extraProperties = new java.util.HashMap();
}

return this.extraProperties;
} //-- java.util.Map getExtraProperties()

/**
* Get the LDAP host.
*
* @return String
*/
public String getHostName()
{
return this.hostName;
} //-- String getHostName()

/**
* Get the LDAP password.
*
* @return String
*/
public String getPassword()
{
return this.password;
} //-- String getPassword()

/**
* Get the LDAP port.
*
* @return int
*/
public int getPort()
{
return this.port;
} //-- int getPort()

/**
* Get the LDAP authenticator enabled.
*
* @return boolean
*/
public boolean isBindAuthenticatorEnabled()
{
return this.bindAuthenticatorEnabled;
} //-- boolean isBindAuthenticatorEnabled()

/**
* Get ssl LDAP connection.
*
* @return boolean
*/
public boolean isSsl()
{
return this.ssl;
} //-- boolean isSsl()

/**
* Get will use role name as LDAP group.
*
* @return boolean
*/
public boolean isUseRoleNameAsGroup()
{
return this.useRoleNameAsGroup;
} //-- boolean isUseRoleNameAsGroup()

/**
* Get lDAP writable.
*
* @return boolean
*/
public boolean isWritable()
{
return this.writable;
} //-- boolean isWritable()

/**
* Set the LDAP authenticationMethod.
*
* @param authenticationMethod
*/
public void setAuthenticationMethod( String authenticationMethod )
{
this.authenticationMethod = authenticationMethod;
} //-- void setAuthenticationMethod( String )

/**
* Set the LDAP base dn.
*
* @param baseDn
*/
public void setBaseDn( String baseDn )
{
this.baseDn = baseDn;
} //-- void setBaseDn( String )

/**
* Set the LDAP base dn for groups (if empty baseDn is used).
*
* @param baseGroupsDn
*/
public void setBaseGroupsDn( String baseGroupsDn )
{
this.baseGroupsDn = baseGroupsDn;
} //-- void setBaseGroupsDn( String )

/**
* Set the LDAP authenticator enabled.
*
* @param bindAuthenticatorEnabled
*/
public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
{
this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
} //-- void setBindAuthenticatorEnabled( boolean )

/**
* Set the LDAP bind dn.
*
* @param bindDn
*/
public void setBindDn( String bindDn )
{
this.bindDn = bindDn;
} //-- void setBindDn( String )

/**
* Set contextFactory to use.
*
* @param contextFactory
*/
public void setContextFactory( String contextFactory )
{
this.contextFactory = contextFactory;
} //-- void setContextFactory( String )

/**
* Set additional properties to use for ldap connection.
*
* @param extraProperties
*/
public void setExtraProperties( java.util.Map extraProperties )
{
this.extraProperties = extraProperties;
} //-- void setExtraProperties( java.util.Map )

/**
* Set the LDAP host.
*
* @param hostName
*/
public void setHostName( String hostName )
{
this.hostName = hostName;
} //-- void setHostName( String )

/**
* Set the LDAP password.
*
* @param password
*/
public void setPassword( String password )
{
this.password = password;
} //-- void setPassword( String )

/**
* Set the LDAP port.
*
* @param port
*/
public void setPort( int port )
{
this.port = port;
} //-- void setPort( int )

/**
* Set ssl LDAP connection.
*
* @param ssl
*/
public void setSsl( boolean ssl )
{
this.ssl = ssl;
} //-- void setSsl( boolean )

/**
* Set will use role name as LDAP group.
*
* @param useRoleNameAsGroup
*/
public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup )
{
this.useRoleNameAsGroup = useRoleNameAsGroup;
} //-- void setUseRoleNameAsGroup( boolean )

/**
* Set lDAP writable.
*
* @param writable
*/
public void setWritable( boolean writable )
{
this.writable = writable;
} //-- void setWritable( boolean )

}

+ 116
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LdapGroupMapping.java View File

@@ -0,0 +1,116 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* configuration of a LDAP group to Archiva roles.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class LdapGroupMapping
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* LDAP Group.
*/
private String group;

/**
* Field roleNames.
*/
private java.util.List<String> roleNames;


//-----------/
//- Methods -/
//-----------/

/**
* Method addRoleName.
*
* @param string
*/
public void addRoleName( String string )
{
getRoleNames().add( string );
} //-- void addRoleName( String )

/**
* Get lDAP Group.
*
* @return String
*/
public String getGroup()
{
return this.group;
} //-- String getGroup()

/**
* Method getRoleNames.
*
* @return List
*/
public java.util.List<String> getRoleNames()
{
if ( this.roleNames == null )
{
this.roleNames = new java.util.ArrayList<String>();
}

return this.roleNames;
} //-- java.util.List<String> getRoleNames()

/**
* Method removeRoleName.
*
* @param string
*/
public void removeRoleName( String string )
{
getRoleNames().remove( string );
} //-- void removeRoleName( String )

/**
* Set lDAP Group.
*
* @param group
*/
public void setGroup( String group )
{
this.group = group;
} //-- void setGroup( String )

/**
* Set archiva roles.
*
* @param roleNames
*/
public void setRoleNames( java.util.List<String> roleNames )
{
this.roleNames = roleNames;
} //-- void setRoleNames( java.util.List )

}

+ 158
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/LegacyArtifactPath.java View File

@@ -0,0 +1,158 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class LegacyArtifactPath.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class LegacyArtifactPath
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The legacy path.
*
*/
private String path;

/**
*
* The artifact reference, as " [groupId] :
* [artifactId] : [version] : [classifier] : [type] ".
*
*/
private String artifact;


//-----------/
//- Methods -/
//-----------/

/**
* Get the artifact reference, as " [groupId] : [artifactId] :
* [version] : [classifier] : [type] ".
*
* @return String
*/
public String getArtifact()
{
return this.artifact;
} //-- String getArtifact()

/**
* Get the legacy path.
*
* @return String
*/
public String getPath()
{
return this.path;
} //-- String getPath()

/**
* Set the artifact reference, as " [groupId] : [artifactId] :
* [version] : [classifier] : [type] ".
*
* @param artifact
*/
public void setArtifact( String artifact )
{
this.artifact = artifact;
} //-- void setArtifact( String )

/**
* Set the legacy path.
*
* @param path
*/
public void setPath( String path )
{
this.path = path;
} //-- void setPath( String )

public boolean match( String path )
{
return path.equals( this.path );
}

public String getGroupId()
{
return artifact.split( ":" )[0];
}

public String getArtifactId()
{
return artifact.split( ":" )[1];
}
public String getVersion()
{
return artifact.split( ":" )[2];
}
public String getClassifier()
{
String classifier = artifact.split( ":" )[3];
return classifier.length() > 0 ? classifier : null;
}
public String getType()
{
return artifact.split( ":" )[4];
}

@Override
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( o == null || getClass() != o.getClass() )
{
return false;
}

LegacyArtifactPath that = (LegacyArtifactPath) o;

if ( path != null ? !path.equals( that.path ) : that.path != null )
{
return false;
}

return true;
}

@Override
public int hashCode()
{
return path != null ? 37 + path.hashCode() : 0;
}
}

+ 353
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ManagedRepositoryConfiguration.java View File

@@ -0,0 +1,353 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class ManagedRepositoryConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class ManagedRepositoryConfiguration
extends AbstractRepositoryConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The file system location for this repository.
*
*/
private String location;

/**
* True if this repository contains release versioned artifacts.
*/
private boolean releases = true;

/**
* True if re-deployment of artifacts already in the repository
* will be blocked.
*/
private boolean blockRedeployments = false;

/**
* True if this repository contains snapshot versioned artifacts
*/
private boolean snapshots = false;

/**
* True if this repository should be scanned and processed.
*/
private boolean scanned = true;

/**
*
* When to run the refresh task.
* Default is every hour
* .
*/
private String refreshCronExpression = "0 0 * * * ?";

/**
*
* The total count of the artifact to be retained
* for each snapshot.
*
*/
private int retentionCount = 2;

/**
*
* The number of days after which snapshots will be
* removed.
*
*/
private int retentionPeriod = 100;

/**
*
* True if the released snapshots are to be removed
* from the repo during repository purge.
*
*/
private boolean deleteReleasedSnapshots = false;

/**
*
* True to not generate packed index (note you
* won't be able to export your index.
*
*/
private boolean skipPackedIndexCreation = false;

/**
*
* Need a staging repository
* .
*/
private boolean stageRepoNeeded = false;


//-----------/
//- Methods -/
//-----------/

/**
* Get the file system location for this repository.
*
* @return String
*/
public String getLocation()
{
return this.location;
} //-- String getLocation()

/**
* Get when to run the refresh task.
* Default is every hour.
*
* @return String
*/
public String getRefreshCronExpression()
{
return this.refreshCronExpression;
} //-- String getRefreshCronExpression()

/**
* Get the total count of the artifact to be retained for each
* snapshot.
*
* @return int
*/
public int getRetentionCount()
{
return this.retentionCount;
} //-- int getRetentionCount()

/**
* Get the number of days after which snapshots will be
* removed.
*
* @return int
*/
public int getRetentionPeriod()
{
return this.retentionPeriod;
} //-- int getRetentionPeriod()

/**
* Get true if re-deployment of artifacts already in the
* repository will be blocked.
*
* @return boolean
*/
public boolean isBlockRedeployments()
{
return this.blockRedeployments;
} //-- boolean isBlockRedeployments()

/**
* Get true if the released snapshots are to be removed from
* the repo during repository purge.
*
* @return boolean
*/
public boolean isDeleteReleasedSnapshots()
{
return this.deleteReleasedSnapshots;
} //-- boolean isDeleteReleasedSnapshots()

/**
* Get true if this repository contains release versioned
* artifacts.
*
* @return boolean
*/
public boolean isReleases()
{
return this.releases;
} //-- boolean isReleases()

/**
* Get true if this repository should be scanned and processed.
*
* @return boolean
*/
public boolean isScanned()
{
return this.scanned;
} //-- boolean isScanned()

/**
* Get true to not generate packed index (note you won't be
* able to export your index.
*
* @return boolean
*/
public boolean isSkipPackedIndexCreation()
{
return this.skipPackedIndexCreation;
} //-- boolean isSkipPackedIndexCreation()

/**
* Get true if this repository contains snapshot versioned
* artifacts.
*
* @return boolean
*/
public boolean isSnapshots()
{
return this.snapshots;
} //-- boolean isSnapshots()

/**
* Get need a staging repository.
*
* @return boolean
*/
public boolean isStageRepoNeeded()
{
return this.stageRepoNeeded;
} //-- boolean isStageRepoNeeded()

/**
* Set true if re-deployment of artifacts already in the
* repository will be blocked.
*
* @param blockRedeployments
*/
public void setBlockRedeployments( boolean blockRedeployments )
{
this.blockRedeployments = blockRedeployments;
} //-- void setBlockRedeployments( boolean )

/**
* Set true if the released snapshots are to be removed from
* the repo during repository purge.
*
* @param deleteReleasedSnapshots
*/
public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
{
this.deleteReleasedSnapshots = deleteReleasedSnapshots;
} //-- void setDeleteReleasedSnapshots( boolean )

/**
* Set the file system location for this repository.
*
* @param location
*/
public void setLocation( String location )
{
this.location = location;
} //-- void setLocation( String )

/**
* Set when to run the refresh task.
* Default is every hour.
*
* @param refreshCronExpression
*/
public void setRefreshCronExpression( String refreshCronExpression )
{
this.refreshCronExpression = refreshCronExpression;
} //-- void setRefreshCronExpression( String )

/**
* Set true if this repository contains release versioned
* artifacts.
*
* @param releases
*/
public void setReleases( boolean releases )
{
this.releases = releases;
} //-- void setReleases( boolean )

/**
* Set the total count of the artifact to be retained for each
* snapshot.
*
* @param retentionCount
*/
public void setRetentionCount( int retentionCount )
{
this.retentionCount = retentionCount;
} //-- void setRetentionCount( int )

/**
* Set the number of days after which snapshots will be
* removed.
*
* @param retentionPeriod
*/
public void setRetentionPeriod( int retentionPeriod )
{
this.retentionPeriod = retentionPeriod;
} //-- void setRetentionPeriod( int )

/**
* Set true if this repository should be scanned and processed.
*
* @param scanned
*/
public void setScanned( boolean scanned )
{
this.scanned = scanned;
} //-- void setScanned( boolean )

/**
* Set true to not generate packed index (note you won't be
* able to export your index.
*
* @param skipPackedIndexCreation
*/
public void setSkipPackedIndexCreation( boolean skipPackedIndexCreation )
{
this.skipPackedIndexCreation = skipPackedIndexCreation;
} //-- void setSkipPackedIndexCreation( boolean )

/**
* Set true if this repository contains snapshot versioned
* artifacts.
*
* @param snapshots
*/
public void setSnapshots( boolean snapshots )
{
this.snapshots = snapshots;
} //-- void setSnapshots( boolean )

/**
* Set need a staging repository.
*
* @param stageRepoNeeded
*/
public void setStageRepoNeeded( boolean stageRepoNeeded )
{
this.stageRepoNeeded = stageRepoNeeded;
} //-- void setStageRepoNeeded( boolean )

}

+ 119
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkConfiguration.java View File

@@ -0,0 +1,119 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The network configuration for external http request to
* repositories.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class NetworkConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* maximum total external http connections.
*/
private int maxTotal = 30;

/**
* maximum total external http connections per host.
*/
private int maxTotalPerHost = 30;

/**
* use or not http connection pooling default true.
*/
private boolean usePooling = true;


//-----------/
//- Methods -/
//-----------/

/**
* Get maximum total external http connections.
*
* @return int
*/
public int getMaxTotal()
{
return this.maxTotal;
} //-- int getMaxTotal()

/**
* Get maximum total external http connections per host.
*
* @return int
*/
public int getMaxTotalPerHost()
{
return this.maxTotalPerHost;
} //-- int getMaxTotalPerHost()

/**
* Get use or not http connection pooling default true.
*
* @return boolean
*/
public boolean isUsePooling()
{
return this.usePooling;
} //-- boolean isUsePooling()

/**
* Set maximum total external http connections.
*
* @param maxTotal
*/
public void setMaxTotal( int maxTotal )
{
this.maxTotal = maxTotal;
} //-- void setMaxTotal( int )

/**
* Set maximum total external http connections per host.
*
* @param maxTotalPerHost
*/
public void setMaxTotalPerHost( int maxTotalPerHost )
{
this.maxTotalPerHost = maxTotalPerHost;
} //-- void setMaxTotalPerHost( int )

/**
* Set use or not http connection pooling default true.
*
* @param usePooling
*/
public void setUsePooling( boolean usePooling )
{
this.usePooling = usePooling;
} //-- void setUsePooling( boolean )

}

+ 259
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/NetworkProxyConfiguration.java View File

@@ -0,0 +1,259 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class NetworkProxyConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class NetworkProxyConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The ID for this proxy.
*
*/
private String id;

/**
*
* The network protocol to use with this proxy:
* "http", "socks-4"
* .
*/
private String protocol = "http";

/**
*
* The proxy host.
*
*/
private String host;

/**
*
* The proxy port.
*
*/
private int port = 8080;

/**
*
* The proxy user.
*
*/
private String username;

/**
*
* The proxy password.
*
*/
private String password;

/**
*
* Use ntlm authentification.
*
*/
private boolean useNtlm = false;


//-----------/
//- Methods -/
//-----------/

/**
* Get the proxy host.
*
* @return String
*/
public String getHost()
{
return this.host;
} //-- String getHost()

/**
* Get the ID for this proxy.
*
* @return String
*/
public String getId()
{
return this.id;
} //-- String getId()

/**
* Get the proxy password.
*
* @return String
*/
public String getPassword()
{
return this.password;
} //-- String getPassword()

/**
* Get the proxy port.
*
* @return int
*/
public int getPort()
{
return this.port;
} //-- int getPort()

/**
* Get the network protocol to use with this proxy: "http",
* "socks-4".
*
* @return String
*/
public String getProtocol()
{
return this.protocol;
} //-- String getProtocol()

/**
* Get the proxy user.
*
* @return String
*/
public String getUsername()
{
return this.username;
} //-- String getUsername()

/**
* Get use ntlm authentification.
*
* @return boolean
*/
public boolean isUseNtlm()
{
return this.useNtlm;
} //-- boolean isUseNtlm()

/**
* Set the proxy host.
*
* @param host
*/
public void setHost( String host )
{
this.host = host;
} //-- void setHost( String )

/**
* Set the ID for this proxy.
*
* @param id
*/
public void setId( String id )
{
this.id = id;
} //-- void setId( String )

/**
* Set the proxy password.
*
* @param password
*/
public void setPassword( String password )
{
this.password = password;
} //-- void setPassword( String )

/**
* Set the proxy port.
*
* @param port
*/
public void setPort( int port )
{
this.port = port;
} //-- void setPort( int )

/**
* Set the network protocol to use with this proxy: "http",
* "socks-4".
*
* @param protocol
*/
public void setProtocol( String protocol )
{
this.protocol = protocol;
} //-- void setProtocol( String )

/**
* Set use ntlm authentification.
*
* @param useNtlm
*/
public void setUseNtlm( boolean useNtlm )
{
this.useNtlm = useNtlm;
} //-- void setUseNtlm( boolean )

/**
* Set the proxy user.
*
* @param username
*/
public void setUsername( String username )
{
this.username = username;
} //-- void setUsername( String )

public int hashCode()
{
int result = 17;
result = 37 * result + ( id != null ? id.hashCode() : 0 );
return result;
}

public boolean equals( Object other )
{
if ( this == other )
{
return true;
}

if ( !( other instanceof NetworkProxyConfiguration ) )
{
return false;
}

NetworkProxyConfiguration that = (NetworkProxyConfiguration) other;
boolean result = true;
result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
return result;
}
}

+ 118
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/OrganisationInformation.java View File

@@ -0,0 +1,118 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The organisation information settings.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class OrganisationInformation
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* name of the organisation.
*/
private String name;

/**
* name of the organisation.
*/
private String url;

/**
* name of the organisation.
*/
private String logoLocation;


//-----------/
//- Methods -/
//-----------/

/**
* Get name of the organisation.
*
* @return String
*/
public String getLogoLocation()
{
return this.logoLocation;
} //-- String getLogoLocation()

/**
* Get name of the organisation.
*
* @return String
*/
public String getName()
{
return this.name;
} //-- String getName()

/**
* Get name of the organisation.
*
* @return String
*/
public String getUrl()
{
return this.url;
} //-- String getUrl()

/**
* Set name of the organisation.
*
* @param logoLocation
*/
public void setLogoLocation( String logoLocation )
{
this.logoLocation = logoLocation;
} //-- void setLogoLocation( String )

/**
* Set name of the organisation.
*
* @param name
*/
public void setName( String name )
{
this.name = name;
} //-- void setName( String )

/**
* Set name of the organisation.
*
* @param url
*/
public void setUrl( String url )
{
this.url = url;
} //-- void setUrl( String )

}

+ 120
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorConfiguration.java View File

@@ -0,0 +1,120 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class ProxyConnectorConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class ProxyConnectorConfiguration
extends AbstractRepositoryConnectorConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The order of the proxy connectors. (0 means no
* order specified)
* .
*/
private int order = 0;


//-----------/
//- Methods -/
//-----------/

/**
* Get the order of the proxy connectors. (0 means no order
* specified).
*
* @return int
*/
public int getOrder()
{
return this.order;
} //-- int getOrder()

/**
* Set the order of the proxy connectors. (0 means no order
* specified).
*
* @param order
*/
public void setOrder( int order )
{
this.order = order;
} //-- void setOrder( int )

/**
* The order id for UNORDERED
*/
public static final int UNORDERED = 0;

/**
* The policy key {@link #getPolicies()} for error handling.
* See {@link org.apache.archiva.policies.DownloadErrorPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";

/**
* The policy key {@link #getPolicies()} for error handling when an artifact is present.
* See {@link org.apache.archiva.policies.DownloadErrorPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";

/**
* The policy key {@link #getPolicies()} for snapshot handling.
* See {@link org.apache.archiva.policies.SnapshotsPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_SNAPSHOTS = "snapshots";

/**
* The policy key {@link #getPolicies()} for releases handling.
* See {@link org.apache.archiva.policies.ReleasesPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_RELEASES = "releases";

/**
* The policy key {@link #getPolicies()} for checksum handling.
* See {@link org.apache.archiva.policies.ChecksumPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_CHECKSUM = "checksum";

/**
* The policy key {@link #getPolicies()} for cache-failures handling.
* See {@link org.apache.archiva.policies.CachedFailuresPolicy}
* for details on potential values to this policy key.
*/
public static final String POLICY_CACHE_FAILURES = "cache-failures";
}

+ 147
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/ProxyConnectorRuleConfiguration.java View File

@@ -0,0 +1,147 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class ProxyConnectorRuleConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class ProxyConnectorRuleConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The type if this rule: whiteList, blackList
* etc..
*
*/
private String ruleType;

/**
*
* The pattern for this rule: whiteList, blackList
* etc..
*
*/
private String pattern;

/**
* Field proxyConnectors.
*/
private java.util.List<ProxyConnectorConfiguration> proxyConnectors;


//-----------/
//- Methods -/
//-----------/

/**
* Method addProxyConnector.
*
* @param proxyConnectorConfiguration
*/
public void addProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
{
getProxyConnectors().add( proxyConnectorConfiguration );
} //-- void addProxyConnector( ProxyConnectorConfiguration )

/**
* Get the pattern for this rule: whiteList, blackList etc..
*
* @return String
*/
public String getPattern()
{
return this.pattern;
} //-- String getPattern()

/**
* Method getProxyConnectors.
*
* @return List
*/
public java.util.List<ProxyConnectorConfiguration> getProxyConnectors()
{
if ( this.proxyConnectors == null )
{
this.proxyConnectors = new java.util.ArrayList<ProxyConnectorConfiguration>();
}

return this.proxyConnectors;
} //-- java.util.List<ProxyConnectorConfiguration> getProxyConnectors()

/**
* Get the type if this rule: whiteList, blackList etc..
*
* @return String
*/
public String getRuleType()
{
return this.ruleType;
} //-- String getRuleType()

/**
* Method removeProxyConnector.
*
* @param proxyConnectorConfiguration
*/
public void removeProxyConnector( ProxyConnectorConfiguration proxyConnectorConfiguration )
{
getProxyConnectors().remove( proxyConnectorConfiguration );
} //-- void removeProxyConnector( ProxyConnectorConfiguration )

/**
* Set the pattern for this rule: whiteList, blackList etc..
*
* @param pattern
*/
public void setPattern( String pattern )
{
this.pattern = pattern;
} //-- void setPattern( String )

/**
* Set associated proxyConnectors configuration.
*
* @param proxyConnectors
*/
public void setProxyConnectors( java.util.List<ProxyConnectorConfiguration> proxyConnectors )
{
this.proxyConnectors = proxyConnectors;
} //-- void setProxyConnectors( java.util.List )

/**
* Set the type if this rule: whiteList, blackList etc..
*
* @param ruleType
*/
public void setRuleType( String ruleType )
{
this.ruleType = ruleType;
} //-- void setRuleType( String )

}

+ 341
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RedbackRuntimeConfiguration.java View File

@@ -0,0 +1,341 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The redback runtime configuration.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class RedbackRuntimeConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* flag to know if redback configuration has been
* checked/migrated.
*/
private boolean migratedFromRedbackConfiguration = false;

/**
* Field userManagerImpls.
*/
private java.util.List<String> userManagerImpls;

/**
* Field rbacManagerImpls.
*/
private java.util.List<String> rbacManagerImpls;

/**
* the ldap configuration.
*/
private LdapConfiguration ldapConfiguration;

/**
* Field ldapGroupMappings.
*/
private java.util.List<LdapGroupMapping> ldapGroupMappings;

/**
* Field configurationProperties.
*/
private java.util.Map configurationProperties;

/**
* flag to know if redback will use a cache to prevent
* searching users already found.
*/
private boolean useUsersCache = true;

/**
* the users cache configuration.
*/
private CacheConfiguration usersCacheConfiguration;


//-----------/
//- Methods -/
//-----------/

/**
* Method addConfigurationProperty.
*
* @param key
* @param value
*/
public void addConfigurationProperty( Object key, String value )
{
getConfigurationProperties().put( key, value );
} //-- void addConfigurationProperty( Object, String )

/**
* Method addLdapGroupMapping.
*
* @param ldapGroupMapping
*/
public void addLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
{
getLdapGroupMappings().add( ldapGroupMapping );
} //-- void addLdapGroupMapping( LdapGroupMapping )

/**
* Method addRbacManagerImpl.
*
* @param string
*/
public void addRbacManagerImpl( String string )
{
getRbacManagerImpls().add( string );
} //-- void addRbacManagerImpl( String )

/**
* Method addUserManagerImpl.
*
* @param string
*/
public void addUserManagerImpl( String string )
{
getUserManagerImpls().add( string );
} //-- void addUserManagerImpl( String )

/**
* Method getConfigurationProperties.
*
* @return Map
*/
public java.util.Map getConfigurationProperties()
{
if ( this.configurationProperties == null )
{
this.configurationProperties = new java.util.HashMap();
}

return this.configurationProperties;
} //-- java.util.Map getConfigurationProperties()

/**
* Get the ldap configuration.
*
* @return LdapConfiguration
*/
public LdapConfiguration getLdapConfiguration()
{
return this.ldapConfiguration;
} //-- LdapConfiguration getLdapConfiguration()

/**
* Method getLdapGroupMappings.
*
* @return List
*/
public java.util.List<LdapGroupMapping> getLdapGroupMappings()
{
if ( this.ldapGroupMappings == null )
{
this.ldapGroupMappings = new java.util.ArrayList<LdapGroupMapping>();
}

return this.ldapGroupMappings;
} //-- java.util.List<LdapGroupMapping> getLdapGroupMappings()

/**
* Method getRbacManagerImpls.
*
* @return List
*/
public java.util.List<String> getRbacManagerImpls()
{
if ( this.rbacManagerImpls == null )
{
this.rbacManagerImpls = new java.util.ArrayList<String>();
}

return this.rbacManagerImpls;
} //-- java.util.List<String> getRbacManagerImpls()

/**
* Method getUserManagerImpls.
*
* @return List
*/
public java.util.List<String> getUserManagerImpls()
{
if ( this.userManagerImpls == null )
{
this.userManagerImpls = new java.util.ArrayList<String>();
}

return this.userManagerImpls;
} //-- java.util.List<String> getUserManagerImpls()

/**
* Get the users cache configuration.
*
* @return CacheConfiguration
*/
public CacheConfiguration getUsersCacheConfiguration()
{
return this.usersCacheConfiguration;
} //-- CacheConfiguration getUsersCacheConfiguration()

/**
* Get flag to know if redback configuration has been
* checked/migrated.
*
* @return boolean
*/
public boolean isMigratedFromRedbackConfiguration()
{
return this.migratedFromRedbackConfiguration;
} //-- boolean isMigratedFromRedbackConfiguration()

/**
* Get flag to know if redback will use a cache to prevent
* searching users already found.
*
* @return boolean
*/
public boolean isUseUsersCache()
{
return this.useUsersCache;
} //-- boolean isUseUsersCache()

/**
* Method removeLdapGroupMapping.
*
* @param ldapGroupMapping
*/
public void removeLdapGroupMapping( LdapGroupMapping ldapGroupMapping )
{
getLdapGroupMappings().remove( ldapGroupMapping );
} //-- void removeLdapGroupMapping( LdapGroupMapping )

/**
* Method removeRbacManagerImpl.
*
* @param string
*/
public void removeRbacManagerImpl( String string )
{
getRbacManagerImpls().remove( string );
} //-- void removeRbacManagerImpl( String )

/**
* Method removeUserManagerImpl.
*
* @param string
*/
public void removeUserManagerImpl( String string )
{
getUserManagerImpls().remove( string );
} //-- void removeUserManagerImpl( String )

/**
* Set extra properties for redback configuration.
* String/String.
*
* @param configurationProperties
*/
public void setConfigurationProperties( java.util.Map configurationProperties )
{
this.configurationProperties = configurationProperties;
} //-- void setConfigurationProperties( java.util.Map )

/**
* Set the ldap configuration.
*
* @param ldapConfiguration
*/
public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
{
this.ldapConfiguration = ldapConfiguration;
} //-- void setLdapConfiguration( LdapConfiguration )

/**
* Set ldapGroupMappings.
*
* @param ldapGroupMappings
*/
public void setLdapGroupMappings( java.util.List<LdapGroupMapping> ldapGroupMappings )
{
this.ldapGroupMappings = ldapGroupMappings;
} //-- void setLdapGroupMappings( java.util.List )

/**
* Set flag to know if redback configuration has been
* checked/migrated.
*
* @param migratedFromRedbackConfiguration
*/
public void setMigratedFromRedbackConfiguration( boolean migratedFromRedbackConfiguration )
{
this.migratedFromRedbackConfiguration = migratedFromRedbackConfiguration;
} //-- void setMigratedFromRedbackConfiguration( boolean )

/**
* Set the RBAC Manager impls to use.
*
* @param rbacManagerImpls
*/
public void setRbacManagerImpls( java.util.List<String> rbacManagerImpls )
{
this.rbacManagerImpls = rbacManagerImpls;
} //-- void setRbacManagerImpls( java.util.List )

/**
* Set flag to know if redback will use a cache to prevent
* searching users already found.
*
* @param useUsersCache
*/
public void setUseUsersCache( boolean useUsersCache )
{
this.useUsersCache = useUsersCache;
} //-- void setUseUsersCache( boolean )

/**
* Set the user manager impls to use.
*
* @param userManagerImpls
*/
public void setUserManagerImpls( java.util.List<String> userManagerImpls )
{
this.userManagerImpls = userManagerImpls;
} //-- void setUserManagerImpls( java.util.List )

/**
* Set the users cache configuration.
*
* @param usersCacheConfiguration
*/
public void setUsersCacheConfiguration( CacheConfiguration usersCacheConfiguration )
{
this.usersCacheConfiguration = usersCacheConfiguration;
} //-- void setUsersCacheConfiguration( CacheConfiguration )

}

+ 452
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RemoteRepositoryConfiguration.java View File

@@ -0,0 +1,452 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class RemoteRepositoryConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class RemoteRepositoryConfiguration
extends AbstractRepositoryConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The URL for this repository.
*
*/
private String url;

/**
*
* The Username for this repository.
*
*/
private String username;

/**
*
* The Password for this repository.
*
*/
private String password;

/**
*
* Timeout in seconds for connections to this
* repository
* .
*/
private int timeout = 60;

/**
*
* When to run the refresh task.
* Default is every sunday at 8H00.
*
*/
private String refreshCronExpression = "0 0 08 ? * SUN";

/**
*
* Activate download of remote index if
* remoteIndexUrl is set too.
*
*/
private boolean downloadRemoteIndex = false;

/**
*
* Remote Index Url : if not starting with http
* will be relative to the remote repository url.
*
*/
private String remoteIndexUrl;

/**
*
* Id of the networkProxy to use when downloading
* remote index.
*
*/
private String remoteDownloadNetworkProxyId;

/**
*
* Timeout in seconds for download remote index.
* Default is more long than artifact download.
*
*/
private int remoteDownloadTimeout = 300;

/**
*
* Schedule download of remote index when archiva
* start
* .
*/
private boolean downloadRemoteIndexOnStartup = false;

/**
* Field extraParameters.
*/
private java.util.Map extraParameters;

/**
* Field extraHeaders.
*/
private java.util.Map extraHeaders;

/**
* The path to check the repository availability (relative to
* the repository URL). Some repositories do not allow
* browsing, so a certain artifact must be checked.
*/
private String checkPath;


//-----------/
//- Methods -/
//-----------/

/**
* Method addExtraHeader.
*
* @param key
* @param value
*/
public void addExtraHeader( Object key, String value )
{
getExtraHeaders().put( key, value );
} //-- void addExtraHeader( Object, String )

/**
* Method addExtraParameter.
*
* @param key
* @param value
*/
public void addExtraParameter( Object key, String value )
{
getExtraParameters().put( key, value );
} //-- void addExtraParameter( Object, String )

/**
* Get the path to check the repository availability (relative
* to the repository URL). Some repositories do not allow
* browsing, so a certain artifact must be checked.
*
* @return String
*/
public String getCheckPath()
{
return this.checkPath;
} //-- String getCheckPath()

/**
* Method getExtraHeaders.
*
* @return Map
*/
public java.util.Map getExtraHeaders()
{
if ( this.extraHeaders == null )
{
this.extraHeaders = new java.util.HashMap();
}

return this.extraHeaders;
} //-- java.util.Map getExtraHeaders()

/**
* Method getExtraParameters.
*
* @return Map
*/
public java.util.Map getExtraParameters()
{
if ( this.extraParameters == null )
{
this.extraParameters = new java.util.HashMap();
}

return this.extraParameters;
} //-- java.util.Map getExtraParameters()

/**
* Get the Password for this repository.
*
* @return String
*/
public String getPassword()
{
return this.password;
} //-- String getPassword()

/**
* Get when to run the refresh task.
* Default is every sunday at 8H00.
*
* @return String
*/
public String getRefreshCronExpression()
{
return this.refreshCronExpression;
} //-- String getRefreshCronExpression()

/**
* Get id of the networkProxy to use when downloading remote
* index.
*
* @return String
*/
public String getRemoteDownloadNetworkProxyId()
{
return this.remoteDownloadNetworkProxyId;
} //-- String getRemoteDownloadNetworkProxyId()

/**
* Get timeout in seconds for download remote index. Default is
* more long than artifact download.
*
* @return int
*/
public int getRemoteDownloadTimeout()
{
return this.remoteDownloadTimeout;
} //-- int getRemoteDownloadTimeout()

/**
* Get remote Index Url : if not starting with http will be
* relative to the remote repository url.
*
* @return String
*/
public String getRemoteIndexUrl()
{
return this.remoteIndexUrl;
} //-- String getRemoteIndexUrl()

/**
* Get timeout in seconds for connections to this repository.
*
* @return int
*/
public int getTimeout()
{
return this.timeout;
} //-- int getTimeout()

/**
* Get the URL for this repository.
*
* @return String
*/
public String getUrl()
{
return this.url;
} //-- String getUrl()

/**
* Get the Username for this repository.
*
* @return String
*/
public String getUsername()
{
return this.username;
} //-- String getUsername()

/**
* Get activate download of remote index if remoteIndexUrl is
* set too.
*
* @return boolean
*/
public boolean isDownloadRemoteIndex()
{
return this.downloadRemoteIndex;
} //-- boolean isDownloadRemoteIndex()

/**
* Get schedule download of remote index when archiva start.
*
* @return boolean
*/
public boolean isDownloadRemoteIndexOnStartup()
{
return this.downloadRemoteIndexOnStartup;
} //-- boolean isDownloadRemoteIndexOnStartup()

/**
* Set the path to check the repository availability (relative
* to the repository URL). Some repositories do not allow
* browsing, so a certain artifact must be checked.
*
* @param checkPath
*/
public void setCheckPath( String checkPath )
{
this.checkPath = checkPath;
} //-- void setCheckPath( String )

/**
* Set activate download of remote index if remoteIndexUrl is
* set too.
*
* @param downloadRemoteIndex
*/
public void setDownloadRemoteIndex( boolean downloadRemoteIndex )
{
this.downloadRemoteIndex = downloadRemoteIndex;
} //-- void setDownloadRemoteIndex( boolean )

/**
* Set schedule download of remote index when archiva start.
*
* @param downloadRemoteIndexOnStartup
*/
public void setDownloadRemoteIndexOnStartup( boolean downloadRemoteIndexOnStartup )
{
this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
} //-- void setDownloadRemoteIndexOnStartup( boolean )

/**
* Set additional http headers to add to url when requesting
* remote repositories.
*
* @param extraHeaders
*/
public void setExtraHeaders( java.util.Map extraHeaders )
{
this.extraHeaders = extraHeaders;
} //-- void setExtraHeaders( java.util.Map )

/**
* Set additionnal request parameters to add to url when
* requesting remote repositories.
*
* @param extraParameters
*/
public void setExtraParameters( java.util.Map extraParameters )
{
this.extraParameters = extraParameters;
} //-- void setExtraParameters( java.util.Map )

/**
* Set the Password for this repository.
*
* @param password
*/
public void setPassword( String password )
{
this.password = password;
} //-- void setPassword( String )

/**
* Set when to run the refresh task.
* Default is every sunday at 8H00.
*
* @param refreshCronExpression
*/
public void setRefreshCronExpression( String refreshCronExpression )
{
this.refreshCronExpression = refreshCronExpression;
} //-- void setRefreshCronExpression( String )

/**
* Set id of the networkProxy to use when downloading remote
* index.
*
* @param remoteDownloadNetworkProxyId
*/
public void setRemoteDownloadNetworkProxyId( String remoteDownloadNetworkProxyId )
{
this.remoteDownloadNetworkProxyId = remoteDownloadNetworkProxyId;
} //-- void setRemoteDownloadNetworkProxyId( String )

/**
* Set timeout in seconds for download remote index. Default is
* more long than artifact download.
*
* @param remoteDownloadTimeout
*/
public void setRemoteDownloadTimeout( int remoteDownloadTimeout )
{
this.remoteDownloadTimeout = remoteDownloadTimeout;
} //-- void setRemoteDownloadTimeout( int )

/**
* Set remote Index Url : if not starting with http will be
* relative to the remote repository url.
*
* @param remoteIndexUrl
*/
public void setRemoteIndexUrl( String remoteIndexUrl )
{
this.remoteIndexUrl = remoteIndexUrl;
} //-- void setRemoteIndexUrl( String )

/**
* Set timeout in seconds for connections to this repository.
*
* @param timeout
*/
public void setTimeout( int timeout )
{
this.timeout = timeout;
} //-- void setTimeout( int )

/**
* Set the URL for this repository.
*
* @param url
*/
public void setUrl( String url )
{
this.url = url;
} //-- void setUrl( String )

/**
* Set the Username for this repository.
*
* @param username
*/
public void setUsername( String username )
{
this.username = username;
} //-- void setUsername( String )

public String toString()
{
return "RemoteRepositoryConfiguration id:'" + getId() + "',name:'" + getName() +"'";
}


}

+ 96
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryCheckPath.java View File

@@ -0,0 +1,96 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class RepositoryCheckPath.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class RepositoryCheckPath
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
*
* The URL for which this path should be used
* .
*/
private String url;

/**
*
* The path to use for checking the repository
* connection.
*
*/
private String path;


//-----------/
//- Methods -/
//-----------/

/**
* Get the path to use for checking the repository connection.
*
* @return String
*/
public String getPath()
{
return this.path;
} //-- String getPath()

/**
* Get the URL for which this path should be used.
*
* @return String
*/
public String getUrl()
{
return this.url;
} //-- String getUrl()

/**
* Set the path to use for checking the repository connection.
*
* @param path
*/
public void setPath( String path )
{
this.path = path;
} //-- void setPath( String )

/**
* Set the URL for which this path should be used.
*
* @param url
*/
public void setUrl( String url )
{
this.url = url;
} //-- void setUrl( String )

}

+ 198
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryGroupConfiguration.java View File

@@ -0,0 +1,198 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class RepositoryGroupConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class RepositoryGroupConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* The id of the repository group.
*/
private String id;

/**
* The path of the merged index.
*/
private String mergedIndexPath = ".indexer";

/**
* The time to live of the merged index of the repository group.
*/
private int mergedIndexTtl = 30;

/**
*
* When to run the index merging for this group.
* No default value.
*
*/
private String cronExpression = "";

/**
* Field repositories.
*/
private java.util.List<String> repositories;


//-----------/
//- Methods -/
//-----------/

/**
* Method addRepository.
*
* @param string
*/
public void addRepository( String string )
{
getRepositories().add( string );
} //-- void addRepository( String )

/**
* Get when to run the index merging for this group.
* No default value.
*
* @return String
*/
public String getCronExpression()
{
return this.cronExpression;
} //-- String getCronExpression()

/**
* Get the id of the repository group.
*
* @return String
*/
public String getId()
{
return this.id;
} //-- String getId()

/**
* Get the path of the merged index.
*
* @return String
*/
public String getMergedIndexPath()
{
return this.mergedIndexPath;
} //-- String getMergedIndexPath()

/**
* Get the time to live of the merged index of the repository
* group.
*
* @return int
*/
public int getMergedIndexTtl()
{
return this.mergedIndexTtl;
} //-- int getMergedIndexTtl()

/**
* Method getRepositories.
*
* @return List
*/
public java.util.List<String> getRepositories()
{
if ( this.repositories == null )
{
this.repositories = new java.util.ArrayList<String>();
}

return this.repositories;
} //-- java.util.List<String> getRepositories()

/**
* Method removeRepository.
*
* @param string
*/
public void removeRepository( String string )
{
getRepositories().remove( string );
} //-- void removeRepository( String )

/**
* Set when to run the index merging for this group.
* No default value.
*
* @param cronExpression
*/
public void setCronExpression( String cronExpression )
{
this.cronExpression = cronExpression;
} //-- void setCronExpression( String )

/**
* Set the id of the repository group.
*
* @param id
*/
public void setId( String id )
{
this.id = id;
} //-- void setId( String )

/**
* Set the path of the merged index.
*
* @param mergedIndexPath
*/
public void setMergedIndexPath( String mergedIndexPath )
{
this.mergedIndexPath = mergedIndexPath;
} //-- void setMergedIndexPath( String )

/**
* Set the time to live of the merged index of the repository
* group.
*
* @param mergedIndexTtl
*/
public void setMergedIndexTtl( int mergedIndexTtl )
{
this.mergedIndexTtl = mergedIndexTtl;
} //-- void setMergedIndexTtl( int )

/**
* Set the list of repository ids under the group.
*
* @param repositories
*/
public void setRepositories( java.util.List<String> repositories )
{
this.repositories = repositories;
} //-- void setRepositories( java.util.List )

}

+ 191
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/RepositoryScanningConfiguration.java View File

@@ -0,0 +1,191 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class RepositoryScanningConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class RepositoryScanningConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* Field fileTypes.
*/
private java.util.List<FileType> fileTypes;

/**
* Field knownContentConsumers.
*/
private java.util.List<String> knownContentConsumers;

/**
* Field invalidContentConsumers.
*/
private java.util.List<String> invalidContentConsumers;


//-----------/
//- Methods -/
//-----------/

/**
* Method addFileType.
*
* @param fileType
*/
public void addFileType( FileType fileType )
{
getFileTypes().add( fileType );
} //-- void addFileType( FileType )

/**
* Method addInvalidContentConsumer.
*
* @param string
*/
public void addInvalidContentConsumer( String string )
{
getInvalidContentConsumers().add( string );
} //-- void addInvalidContentConsumer( String )

/**
* Method addKnownContentConsumer.
*
* @param string
*/
public void addKnownContentConsumer( String string )
{
getKnownContentConsumers().add( string );
} //-- void addKnownContentConsumer( String )

/**
* Method getFileTypes.
*
* @return List
*/
public java.util.List<FileType> getFileTypes()
{
if ( this.fileTypes == null )
{
this.fileTypes = new java.util.ArrayList<FileType>();
}

return this.fileTypes;
} //-- java.util.List<FileType> getFileTypes()

/**
* Method getInvalidContentConsumers.
*
* @return List
*/
public java.util.List<String> getInvalidContentConsumers()
{
if ( this.invalidContentConsumers == null )
{
this.invalidContentConsumers = new java.util.ArrayList<String>();
}

return this.invalidContentConsumers;
} //-- java.util.List<String> getInvalidContentConsumers()

/**
* Method getKnownContentConsumers.
*
* @return List
*/
public java.util.List<String> getKnownContentConsumers()
{
if ( this.knownContentConsumers == null )
{
this.knownContentConsumers = new java.util.ArrayList<String>();
}

return this.knownContentConsumers;
} //-- java.util.List<String> getKnownContentConsumers()

/**
* Method removeFileType.
*
* @param fileType
*/
public void removeFileType( FileType fileType )
{
getFileTypes().remove( fileType );
} //-- void removeFileType( FileType )

/**
* Method removeInvalidContentConsumer.
*
* @param string
*/
public void removeInvalidContentConsumer( String string )
{
getInvalidContentConsumers().remove( string );
} //-- void removeInvalidContentConsumer( String )

/**
* Method removeKnownContentConsumer.
*
* @param string
*/
public void removeKnownContentConsumer( String string )
{
getKnownContentConsumers().remove( string );
} //-- void removeKnownContentConsumer( String )

/**
* Set the FileTypes for the repository scanning configuration.
*
* @param fileTypes
*/
public void setFileTypes( java.util.List<FileType> fileTypes )
{
this.fileTypes = fileTypes;
} //-- void setFileTypes( java.util.List )

/**
* Set the list of active consumer IDs for invalid content.
*
* @param invalidContentConsumers
*/
public void setInvalidContentConsumers( java.util.List<String> invalidContentConsumers )
{
this.invalidContentConsumers = invalidContentConsumers;
} //-- void setInvalidContentConsumers( java.util.List )

/**
* Set the list of active consumers IDs for known content.
*
* @param knownContentConsumers
*/
public void setKnownContentConsumers( java.util.List<String> knownContentConsumers )
{
this.knownContentConsumers = knownContentConsumers;
} //-- void setKnownContentConsumers( java.util.List )

}

+ 95
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/SyncConnectorConfiguration.java View File

@@ -0,0 +1,95 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
* Class SyncConnectorConfiguration.
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class SyncConnectorConfiguration
extends AbstractRepositoryConnectorConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* When to run the sync mechanism. Default is every hour on the
* hour.
*/
private String cronExpression = "0 0 * * * ?";

/**
* The type of synchronization to use.
*/
private String method = "rsync";


//-----------/
//- Methods -/
//-----------/

/**
* Get when to run the sync mechanism. Default is every hour on
* the hour.
*
* @return String
*/
public String getCronExpression()
{
return this.cronExpression;
} //-- String getCronExpression()

/**
* Get the type of synchronization to use.
*
* @return String
*/
public String getMethod()
{
return this.method;
} //-- String getMethod()

/**
* Set when to run the sync mechanism. Default is every hour on
* the hour.
*
* @param cronExpression
*/
public void setCronExpression( String cronExpression )
{
this.cronExpression = cronExpression;
} //-- void setCronExpression( String )

/**
* Set the type of synchronization to use.
*
* @param method
*/
public void setMethod( String method )
{
this.method = method;
} //-- void setMethod( String )

}

+ 170
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/UserInterfaceOptions.java View File

@@ -0,0 +1,170 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The user interface configuration settings.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class UserInterfaceOptions
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* true if find artifacts should be enabled.
*/
private boolean showFindArtifacts = true;

/**
* true if applet behavior for find artifacts should be enabled.
*/
private boolean appletFindEnabled = true;

/**
* Field disableEasterEggs.
*/
private boolean disableEasterEggs = false;

/**
* Field applicationUrl.
*/
private String applicationUrl;

/**
* Field disableRegistration.
*/
private boolean disableRegistration = false;


//-----------/
//- Methods -/
//-----------/

/**
* Get the applicationUrl field.
*
* @return String
*/
public String getApplicationUrl()
{
return this.applicationUrl;
} //-- String getApplicationUrl()

/**
* Get true if applet behavior for find artifacts should be
* enabled.
*
* @return boolean
*/
public boolean isAppletFindEnabled()
{
return this.appletFindEnabled;
} //-- boolean isAppletFindEnabled()

/**
* Get the disableEasterEggs field.
*
* @return boolean
*/
public boolean isDisableEasterEggs()
{
return this.disableEasterEggs;
} //-- boolean isDisableEasterEggs()

/**
* Get the disableRegistration field.
*
* @return boolean
*/
public boolean isDisableRegistration()
{
return this.disableRegistration;
} //-- boolean isDisableRegistration()

/**
* Get true if find artifacts should be enabled.
*
* @return boolean
*/
public boolean isShowFindArtifacts()
{
return this.showFindArtifacts;
} //-- boolean isShowFindArtifacts()

/**
* Set true if applet behavior for find artifacts should be
* enabled.
*
* @param appletFindEnabled
*/
public void setAppletFindEnabled( boolean appletFindEnabled )
{
this.appletFindEnabled = appletFindEnabled;
} //-- void setAppletFindEnabled( boolean )

/**
* Set the applicationUrl field.
*
* @param applicationUrl
*/
public void setApplicationUrl( String applicationUrl )
{
this.applicationUrl = applicationUrl;
} //-- void setApplicationUrl( String )

/**
* Set the disableEasterEggs field.
*
* @param disableEasterEggs
*/
public void setDisableEasterEggs( boolean disableEasterEggs )
{
this.disableEasterEggs = disableEasterEggs;
} //-- void setDisableEasterEggs( boolean )

/**
* Set the disableRegistration field.
*
* @param disableRegistration
*/
public void setDisableRegistration( boolean disableRegistration )
{
this.disableRegistration = disableRegistration;
} //-- void setDisableRegistration( boolean )

/**
* Set true if find artifacts should be enabled.
*
* @param showFindArtifacts
*/
public void setShowFindArtifacts( boolean showFindArtifacts )
{
this.showFindArtifacts = showFindArtifacts;
} //-- void setShowFindArtifacts( boolean )

}

+ 68
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/WebappConfiguration.java View File

@@ -0,0 +1,68 @@
package org.apache.archiva.configuration;

/*
* 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.
*/

/**
*
* The webapp configuration settings.
*
*
* @version $Revision$ $Date$
*/
@SuppressWarnings( "all" )
public class WebappConfiguration
implements java.io.Serializable
{

//--------------------------/
//- Class/Member Variables -/
//--------------------------/

/**
* options for altering the ui presentation.
*/
private UserInterfaceOptions ui;


//-----------/
//- Methods -/
//-----------/

/**
* Get options for altering the ui presentation.
*
* @return UserInterfaceOptions
*/
public UserInterfaceOptions getUi()
{
return this.ui;
} //-- UserInterfaceOptions getUi()

/**
* Set options for altering the ui presentation.
*
* @param ui
*/
public void setUi( UserInterfaceOptions ui )
{
this.ui = ui;
} //-- void setUi( UserInterfaceOptions )

}

+ 1944
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryReader.java
File diff suppressed because it is too large
View File


+ 1335
- 0
archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/archiva/configuration/io/registry/ConfigurationRegistryWriter.java
File diff suppressed because it is too large
View File


Loading…
Cancel
Save