diff options
author | Martin Stockhammer <martin_s@apache.org> | 2019-02-12 19:18:49 +0100 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2019-02-12 19:18:49 +0100 |
commit | 9fff17411dcf2735940900451235d51cb7d65982 (patch) | |
tree | 90a8d5a62f348df69072a240841b30d445ecc76e /archiva-modules/archiva-base/archiva-model | |
parent | 790e38f5ec27d5cd6da8502b52d9750a169b3e4d (diff) | |
download | archiva-9fff17411dcf2735940900451235d51cb7d65982.tar.gz archiva-9fff17411dcf2735940900451235d51cb7d65982.zip |
Deactivating code generation for model project
Diffstat (limited to 'archiva-modules/archiva-base/archiva-model')
9 files changed, 1950 insertions, 24 deletions
diff --git a/archiva-modules/archiva-base/archiva-model/pom.xml b/archiva-modules/archiva-base/archiva-model/pom.xml index a30d7d01d..1f7e113a6 100755 --- a/archiva-modules/archiva-base/archiva-model/pom.xml +++ b/archiva-modules/archiva-base/archiva-model/pom.xml @@ -57,28 +57,5 @@ <scope>runtime</scope> </dependency> </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.modello</groupId> - <artifactId>modello-maven-plugin</artifactId> - <configuration> - <version>1.3.0</version> - <packageWithVersion>false</packageWithVersion> - <models> - <model>src/main/mdo/archiva-base.xml</model> - </models> - </configuration> - <executions> - <execution> - <id>archiva-base</id> - <goals> - <goal>java</goal> - <goal>xsd</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> + </project> diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaAll.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaAll.java new file mode 100644 index 000000000..48e967f1e --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaAll.java @@ -0,0 +1,173 @@ +package org.apache.archiva.model; + +/* + * 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. + */ + +/** + * + * This object is only used for the XML backup / restore + * features of Archiva. + * This object is not serialized to the Database. + * + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class ArchivaAll + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * Field artifacts. + */ + private java.util.List<ArchivaArtifactModel> artifacts; + + /** + * Field repositoryMetadata. + */ + private java.util.List<ArchivaRepositoryMetadata> repositoryMetadata; + + /** + * Field modelEncoding. + */ + private String modelEncoding = "UTF-8"; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addArtifact. + * + * @param archivaArtifactModel + */ + public void addArtifact( ArchivaArtifactModel archivaArtifactModel ) + { + getArtifacts().add( archivaArtifactModel ); + } //-- void addArtifact( ArchivaArtifactModel ) + + /** + * Method addRepositoryMetadata. + * + * @param archivaRepositoryMetadata + */ + public void addRepositoryMetadata( ArchivaRepositoryMetadata archivaRepositoryMetadata ) + { + getRepositoryMetadata().add( archivaRepositoryMetadata ); + } //-- void addRepositoryMetadata( ArchivaRepositoryMetadata ) + + /** + * Method getArtifacts. + * + * @return List + */ + public java.util.List<ArchivaArtifactModel> getArtifacts() + { + if ( this.artifacts == null ) + { + this.artifacts = new java.util.ArrayList<ArchivaArtifactModel>(); + } + + return this.artifacts; + } //-- java.util.List<ArchivaArtifactModel> getArtifacts() + + /** + * Get the modelEncoding field. + * + * @return String + */ + public String getModelEncoding() + { + return this.modelEncoding; + } //-- String getModelEncoding() + + /** + * Method getRepositoryMetadata. + * + * @return List + */ + public java.util.List<ArchivaRepositoryMetadata> getRepositoryMetadata() + { + if ( this.repositoryMetadata == null ) + { + this.repositoryMetadata = new java.util.ArrayList<ArchivaRepositoryMetadata>(); + } + + return this.repositoryMetadata; + } //-- java.util.List<ArchivaRepositoryMetadata> getRepositoryMetadata() + + /** + * Method removeArtifact. + * + * @param archivaArtifactModel + */ + public void removeArtifact( ArchivaArtifactModel archivaArtifactModel ) + { + getArtifacts().remove( archivaArtifactModel ); + } //-- void removeArtifact( ArchivaArtifactModel ) + + /** + * Method removeRepositoryMetadata. + * + * @param archivaRepositoryMetadata + */ + public void removeRepositoryMetadata( ArchivaRepositoryMetadata archivaRepositoryMetadata ) + { + getRepositoryMetadata().remove( archivaRepositoryMetadata ); + } //-- void removeRepositoryMetadata( ArchivaRepositoryMetadata ) + + /** + * Set the artifacts field. + * + * @param artifacts + */ + public void setArtifacts( java.util.List<ArchivaArtifactModel> artifacts ) + { + this.artifacts = artifacts; + } //-- void setArtifacts( java.util.List ) + + /** + * Set the modelEncoding field. + * + * @param modelEncoding + */ + public void setModelEncoding( String modelEncoding ) + { + this.modelEncoding = modelEncoding; + } //-- void setModelEncoding( String ) + + /** + * Set the repositoryMetadata field. + * + * @param repositoryMetadata + */ + public void setRepositoryMetadata( java.util.List<ArchivaRepositoryMetadata> repositoryMetadata ) + { + this.repositoryMetadata = repositoryMetadata; + } //-- void setRepositoryMetadata( java.util.List ) + + + private static final long serialVersionUID = 3259707008803111764L; + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaArtifactModel.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaArtifactModel.java new file mode 100644 index 000000000..1cc409c8f --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaArtifactModel.java @@ -0,0 +1,457 @@ +package org.apache.archiva.model; + +/* + * 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 ArchivaArtifactModel. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class ArchivaArtifactModel + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The Group ID of the repository content. + * + */ + private String groupId; + + /** + * + * The Artifact ID of the repository content. + * + */ + private String artifactId; + + /** + * + * The version of the repository content. + * + */ + private String version; + + /** + * + * The classifier for this artifact. + * + */ + private String classifier; + + /** + * + * The type of artifact. + * + */ + private String type; + + /** + * + * The repository associated with this content. + * + */ + private String repositoryId; + + /** + * + * True if this is a snapshot. + * + */ + private boolean snapshot = false; + + /** + * + * The MD5 checksum for the artifact file. + * + */ + private String checksumMD5; + + /** + * + * The SHA1 checksum for the artifact file. + * + */ + private String checksumSHA1; + + /** + * + * The Last Modified Timestamp of this artifact. + * + */ + private java.util.Date lastModified; + + /** + * + * The size of the artifact on disk. + * + */ + private long size = 0L; + + /** + * + * When this artifact was gathered or discovered + * from the repository. + * + */ + private java.util.Date whenGathered; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method equals. + * + * @param other + * @return boolean + */ + public boolean equals( Object other ) + { + if ( this == other ) + { + return true; + } + + if ( !( other instanceof ArchivaArtifactModel ) ) + { + return false; + } + + ArchivaArtifactModel that = (ArchivaArtifactModel) other; + boolean result = true; + + result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); + result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); + result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); + result = result && ( getClassifier() == null ? that.getClassifier() == null : getClassifier().equals( that.getClassifier() ) ); + result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) ); + result = result && ( getRepositoryId() == null ? that.getRepositoryId() == null : getRepositoryId().equals( that.getRepositoryId() ) ); + + return result; + } //-- boolean equals( Object ) + + /** + * Get the Artifact ID of the repository content. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Get the MD5 checksum for the artifact file. + * + * @return String + */ + public String getChecksumMD5() + { + return this.checksumMD5; + } //-- String getChecksumMD5() + + /** + * Get the SHA1 checksum for the artifact file. + * + * @return String + */ + public String getChecksumSHA1() + { + return this.checksumSHA1; + } //-- String getChecksumSHA1() + + /** + * Get the classifier for this artifact. + * + * @return String + */ + public String getClassifier() + { + return this.classifier; + } //-- String getClassifier() + + /** + * Get the Group ID of the repository content. + * + * @return String + */ + public String getGroupId() + { + return this.groupId; + } //-- String getGroupId() + + /** + * Get the Last Modified Timestamp of this artifact. + * + * @return Date + */ + public java.util.Date getLastModified() + { + return this.lastModified; + } //-- java.util.Date getLastModified() + + /** + * Get the repository associated with this content. + * + * @return String + */ + public String getRepositoryId() + { + return this.repositoryId; + } //-- String getRepositoryId() + + /** + * Get the size of the artifact on disk. + * + * @return long + */ + public long getSize() + { + return this.size; + } //-- long getSize() + + /** + * Get the type of artifact. + * + * @return String + */ + public String getType() + { + return this.type; + } //-- String getType() + + /** + * Get the version of the repository content. + * + * @return String + */ + public String getVersion() + { + return this.version; + } //-- String getVersion() + + /** + * Get when this artifact was gathered or discovered from the + * repository. + * + * @return Date + */ + public java.util.Date getWhenGathered() + { + return this.whenGathered; + } //-- java.util.Date getWhenGathered() + + /** + * Method hashCode. + * + * @return int + */ + public int hashCode() + { + int result = 17; + + result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 ); + result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); + result = 37 * result + ( version != null ? version.hashCode() : 0 ); + result = 37 * result + ( classifier != null ? classifier.hashCode() : 0 ); + result = 37 * result + ( type != null ? type.hashCode() : 0 ); + result = 37 * result + ( repositoryId != null ? repositoryId.hashCode() : 0 ); + + return result; + } //-- int hashCode() + + /** + * Get true if this is a snapshot. + * + * @return boolean + */ + public boolean isSnapshot() + { + return this.snapshot; + } //-- boolean isSnapshot() + + /** + * Set the Artifact ID of the repository content. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the MD5 checksum for the artifact file. + * + * @param checksumMD5 + */ + public void setChecksumMD5( String checksumMD5 ) + { + this.checksumMD5 = checksumMD5; + } //-- void setChecksumMD5( String ) + + /** + * Set the SHA1 checksum for the artifact file. + * + * @param checksumSHA1 + */ + public void setChecksumSHA1( String checksumSHA1 ) + { + this.checksumSHA1 = checksumSHA1; + } //-- void setChecksumSHA1( String ) + + /** + * Set the classifier for this artifact. + * + * @param classifier + */ + public void setClassifier( String classifier ) + { + this.classifier = classifier; + } //-- void setClassifier( String ) + + /** + * Set the Group ID of the repository content. + * + * @param groupId + */ + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } //-- void setGroupId( String ) + + /** + * Set the Last Modified Timestamp of this artifact. + * + * @param lastModified + */ + public void setLastModified( java.util.Date lastModified ) + { + this.lastModified = lastModified; + } //-- void setLastModified( java.util.Date ) + + /** + * Set the repository associated with this content. + * + * @param repositoryId + */ + public void setRepositoryId( String repositoryId ) + { + this.repositoryId = repositoryId; + } //-- void setRepositoryId( String ) + + /** + * Set the size of the artifact on disk. + * + * @param size + */ + public void setSize( long size ) + { + this.size = size; + } //-- void setSize( long ) + + /** + * Set true if this is a snapshot. + * + * @param snapshot + */ + public void setSnapshot( boolean snapshot ) + { + this.snapshot = snapshot; + } //-- void setSnapshot( boolean ) + + /** + * Set the type of artifact. + * + * @param type + */ + public void setType( String type ) + { + this.type = type; + } //-- void setType( String ) + + /** + * Set the version of the repository content. + * + * @param version + */ + public void setVersion( String version ) + { + this.version = version; + } //-- void setVersion( String ) + + /** + * Set when this artifact was gathered or discovered from the + * repository. + * + * @param whenGathered + */ + public void setWhenGathered( java.util.Date whenGathered ) + { + this.whenGathered = whenGathered; + } //-- void setWhenGathered( java.util.Date ) + + /** + * Method toString. + * + * @return String + */ + public java.lang.String toString() + { + StringBuilder buf = new StringBuilder( 128 ); + + buf.append( "groupId = '" ); + buf.append( getGroupId() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "artifactId = '" ); + buf.append( getArtifactId() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "version = '" ); + buf.append( getVersion() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "classifier = '" ); + buf.append( getClassifier() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "type = '" ); + buf.append( getType() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "repositoryId = '" ); + buf.append( getRepositoryId() ); + buf.append( "'" ); + + return buf.toString(); + } //-- java.lang.String toString() + + + private static final long serialVersionUID = -6292417108113887384L; + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaRepositoryMetadata.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaRepositoryMetadata.java new file mode 100644 index 000000000..7ad114b62 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArchivaRepositoryMetadata.java @@ -0,0 +1,469 @@ +package org.apache.archiva.model; + +/* + * 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 ArchivaRepositoryMetadata. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class ArchivaRepositoryMetadata + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The Group ID of the metadata. + * + */ + private String groupId; + + /** + * + * The Artifact ID of the metadata. + * + */ + private String artifactId; + + /** + * + * The Version of the metadata. + * + */ + private String version; + + /** + * + * The latest version id. + * + */ + private String latestVersion; + + /** + * + * The released version id. + * + */ + private String releasedVersion; + + /** + * + * The snapshot version id. + * + */ + private SnapshotVersion snapshotVersion; + + /** + * Field plugins. + */ + private java.util.List<Plugin> plugins; + + /** + * Field availableVersions. + */ + private java.util.List<String> availableVersions; + + /** + * + * When the metadata was last updated. + * + */ + private String lastUpdated; + + /** + * + * The Last Modified Timestamp of this file. + * + */ + private java.util.Date fileLastModified; + + /** + * + * The size of the artifact on disk. + * + */ + private long fileSize = 0L; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method addAvailableVersion. + * + * @param string + */ + public void addAvailableVersion( String string ) + { + getAvailableVersions().add( string ); + } //-- void addAvailableVersion( String ) + + /** + * Method addPlugin. + * + * @param plugin + */ + public void addPlugin( Plugin plugin ) + { + getPlugins().add( plugin ); + } //-- void addPlugin( Plugin ) + + /** + * Method equals. + * + * @param other + * @return boolean + */ + public boolean equals( Object other ) + { + if ( this == other ) + { + return true; + } + + if ( !( other instanceof ArchivaRepositoryMetadata ) ) + { + return false; + } + + ArchivaRepositoryMetadata that = (ArchivaRepositoryMetadata) other; + boolean result = true; + + result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); + result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); + result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); + + return result; + } //-- boolean equals( Object ) + + /** + * Get the Artifact ID of the metadata. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Method getAvailableVersions. + * + * @return List + */ + public java.util.List<String> getAvailableVersions() + { + if ( this.availableVersions == null ) + { + this.availableVersions = new java.util.ArrayList<String>(); + } + + return this.availableVersions; + } //-- java.util.List<String> getAvailableVersions() + + /** + * Get the Last Modified Timestamp of this file. + * + * @return Date + */ + public java.util.Date getFileLastModified() + { + return this.fileLastModified; + } //-- java.util.Date getFileLastModified() + + /** + * Get the size of the artifact on disk. + * + * @return long + */ + public long getFileSize() + { + return this.fileSize; + } //-- long getFileSize() + + /** + * Get the Group ID of the metadata. + * + * @return String + */ + public String getGroupId() + { + return this.groupId; + } //-- String getGroupId() + + /** + * Get when the metadata was last updated. + * + * @return String + */ + public String getLastUpdated() + { + return this.lastUpdated; + } //-- String getLastUpdated() + + /** + * Get the latest version id. + * + * @return String + */ + public String getLatestVersion() + { + return this.latestVersion; + } //-- String getLatestVersion() + + /** + * Method getPlugins. + * + * @return List + */ + public java.util.List<Plugin> getPlugins() + { + if ( this.plugins == null ) + { + this.plugins = new java.util.ArrayList<Plugin>(); + } + + return this.plugins; + } //-- java.util.List<Plugin> getPlugins() + + /** + * Get the released version id. + * + * @return String + */ + public String getReleasedVersion() + { + return this.releasedVersion; + } //-- String getReleasedVersion() + + /** + * Get the snapshot version id. + * + * @return SnapshotVersion + */ + public SnapshotVersion getSnapshotVersion() + { + return this.snapshotVersion; + } //-- SnapshotVersion getSnapshotVersion() + + /** + * Get the Version of the metadata. + * + * @return String + */ + public String getVersion() + { + return this.version; + } //-- String getVersion() + + /** + * Method hashCode. + * + * @return int + */ + public int hashCode() + { + int result = 17; + + result = 37 * result + ( groupId != null ? groupId.hashCode() : 0 ); + result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); + result = 37 * result + ( version != null ? version.hashCode() : 0 ); + + return result; + } //-- int hashCode() + + /** + * Method removeAvailableVersion. + * + * @param string + */ + public void removeAvailableVersion( String string ) + { + getAvailableVersions().remove( string ); + } //-- void removeAvailableVersion( String ) + + /** + * Method removePlugin. + * + * @param plugin + */ + public void removePlugin( Plugin plugin ) + { + getPlugins().remove( plugin ); + } //-- void removePlugin( Plugin ) + + /** + * Set the Artifact ID of the metadata. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the list of available version ids. + * + * @param availableVersions + */ + public void setAvailableVersions( java.util.List<String> availableVersions ) + { + this.availableVersions = availableVersions; + } //-- void setAvailableVersions( java.util.List ) + + /** + * Set the Last Modified Timestamp of this file. + * + * @param fileLastModified + */ + public void setFileLastModified( java.util.Date fileLastModified ) + { + this.fileLastModified = fileLastModified; + } //-- void setFileLastModified( java.util.Date ) + + /** + * Set the size of the artifact on disk. + * + * @param fileSize + */ + public void setFileSize( long fileSize ) + { + this.fileSize = fileSize; + } //-- void setFileSize( long ) + + /** + * Set the Group ID of the metadata. + * + * @param groupId + */ + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } //-- void setGroupId( String ) + + /** + * Set when the metadata was last updated. + * + * @param lastUpdated + */ + public void setLastUpdated( String lastUpdated ) + { + this.lastUpdated = lastUpdated; + } //-- void setLastUpdated( String ) + + /** + * Set the latest version id. + * + * @param latestVersion + */ + public void setLatestVersion( String latestVersion ) + { + this.latestVersion = latestVersion; + } //-- void setLatestVersion( String ) + + /** + * Set the available plugins. + * + * @param plugins + */ + public void setPlugins( java.util.List<Plugin> plugins ) + { + this.plugins = plugins; + } //-- void setPlugins( java.util.List ) + + /** + * Set the released version id. + * + * @param releasedVersion + */ + public void setReleasedVersion( String releasedVersion ) + { + this.releasedVersion = releasedVersion; + } //-- void setReleasedVersion( String ) + + /** + * Set the snapshot version id. + * + * @param snapshotVersion + */ + public void setSnapshotVersion( SnapshotVersion snapshotVersion ) + { + this.snapshotVersion = snapshotVersion; + } //-- void setSnapshotVersion( SnapshotVersion ) + + /** + * Set the Version of the metadata. + * + * @param version + */ + public void setVersion( String version ) + { + this.version = version; + } //-- void setVersion( String ) + + /** + * Method toString. + * + * @return String + */ + public java.lang.String toString() + { + StringBuilder buf = new StringBuilder( 128 ); + + buf.append( "groupId = '" ); + buf.append( getGroupId() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "artifactId = '" ); + buf.append( getArtifactId() ); + buf.append( "'" ); + buf.append( "\n" ); + buf.append( "version = '" ); + buf.append( getVersion() ); + buf.append( "'" ); + + return buf.toString(); + } //-- java.lang.String toString() + + + private static final long serialVersionUID = 914715358219606100L; + + + public void updateTimestamp() + { + setLastUpdatedTimestamp( new java.util.Date() ); + } + + public void setLastUpdatedTimestamp( java.util.Date date ) + { + java.util.TimeZone timezone = java.util.TimeZone.getTimeZone( "UTC" ); + java.text.DateFormat fmt = new java.text.SimpleDateFormat( "yyyyMMddHHmmss" ); + fmt.setTimeZone( timezone ); + setLastUpdated( fmt.format( date ) ); + } + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArtifactReference.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArtifactReference.java new file mode 100644 index 000000000..aaaf9e808 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ArtifactReference.java @@ -0,0 +1,310 @@ +package org.apache.archiva.model; + +/* + * 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 ArtifactReference. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class ArtifactReference + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The Group ID of the repository content. + * + */ + private String groupId; + + /** + * + * The Artifact ID of the repository content. + * + */ + private String artifactId; + + /** + * + * The version of the repository content. + * + */ + private String version; + + /** + * + * The classifier for this artifact. + * + */ + private String classifier; + + /** + * + * The type of artifact. + * + */ + private String type; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Get the Artifact ID of the repository content. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Get the classifier for this artifact. + * + * @return String + */ + public String getClassifier() + { + return this.classifier; + } //-- String getClassifier() + + /** + * Get the Group ID of the repository content. + * + * @return String + */ + public String getGroupId() + { + return this.groupId; + } //-- String getGroupId() + + /** + * Get the type of artifact. + * + * @return String + */ + public String getType() + { + return this.type; + } //-- String getType() + + /** + * Get the version of the repository content. + * + * @return String + */ + public String getVersion() + { + return this.version; + } //-- String getVersion() + + /** + * Set the Artifact ID of the repository content. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the classifier for this artifact. + * + * @param classifier + */ + public void setClassifier( String classifier ) + { + this.classifier = classifier; + } //-- void setClassifier( String ) + + /** + * Set the Group ID of the repository content. + * + * @param groupId + */ + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } //-- void setGroupId( String ) + + /** + * Set the type of artifact. + * + * @param type + */ + public void setType( String type ) + { + this.type = type; + } //-- void setType( String ) + + /** + * Set the version of the repository content. + * + * @param version + */ + public void setVersion( String version ) + { + this.version = version; + } //-- void setVersion( String ) + + + private static final long serialVersionUID = -6116764846682178732L; + + + private static String defaultString( String value ) + { + if ( value == null ) + { + return ""; + } + + return value.trim(); + } + + public static String toKey( ArtifactReference artifactReference ) + { + StringBuilder key = new StringBuilder(); + + key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); + key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); + key.append( defaultString( artifactReference.getVersion() ) ).append( ":" ); + key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); + key.append( defaultString( artifactReference.getType() ) ); + + return key.toString(); + } + + public static String toVersionlessKey( ArtifactReference artifactReference ) + { + StringBuilder key = new StringBuilder(); + + key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); + key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); + key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); + key.append( defaultString( artifactReference.getType() ) ); + + return key.toString(); + } + + + public int hashCode() + { + final int PRIME = 31; + int result = 1; + result = PRIME * result + ( ( groupId == null ) ? 0 : groupId.hashCode() ); + result = PRIME * result + ( ( artifactId == null ) ? 0 : artifactId.hashCode() ); + result = PRIME * result + ( ( version == null ) ? 0 : version.hashCode() ); + result = PRIME * result + ( ( classifier == null ) ? 0 : classifier.hashCode() ); + result = PRIME * result + ( ( type == null ) ? 0 : type.hashCode() ); + return result; + } + + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + + if ( obj == null ) + { + return false; + } + + if ( getClass() != obj.getClass() ) + { + return false; + } + + final ArtifactReference other = (ArtifactReference) obj; + + if ( groupId == null ) + { + if ( other.groupId != null ) + { + return false; + } + } + else if ( !groupId.equals( other.groupId ) ) + { + return false; + } + + if ( artifactId == null ) + { + if ( other.artifactId != null ) + { + return false; + } + } + else if ( !artifactId.equals( other.artifactId ) ) + { + return false; + } + + if ( version == null ) + { + if ( other.version != null ) + { + return false; + } + } + else if ( !version.equals( other.version ) ) + { + return false; + } + + if ( classifier == null ) + { + if ( other.classifier != null ) + { + return false; + } + } + else if ( !classifier.equals( other.classifier ) ) + { + return false; + } + + if ( type == null ) + { + if ( other.type != null ) + { + return false; + } + } + else if ( !type.equals( other.type ) ) + { + return false; + } + + return true; + } + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/Plugin.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/Plugin.java new file mode 100644 index 000000000..f128cb0fc --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/Plugin.java @@ -0,0 +1,178 @@ +package org.apache.archiva.model; + +/* + * 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 Plugin. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class Plugin + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The prefix for a plugin + * . + */ + private String prefix; + + /** + * + * The artifactId for a plugin + * . + */ + private String artifactId; + + /** + * + * The name for a plugin + * . + */ + private String name; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Method equals. + * + * @param other + * @return boolean + */ + public boolean equals( Object other ) + { + if ( this == other ) + { + return true; + } + + if ( !( other instanceof Plugin ) ) + { + return false; + } + + Plugin that = (Plugin) other; + boolean result = true; + + result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); + + return result; + } //-- boolean equals( Object ) + + /** + * Get the artifactId for a plugin. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Get the name for a plugin. + * + * @return String + */ + public String getName() + { + return this.name; + } //-- String getName() + + /** + * Get the prefix for a plugin. + * + * @return String + */ + public String getPrefix() + { + return this.prefix; + } //-- String getPrefix() + + /** + * Method hashCode. + * + * @return int + */ + public int hashCode() + { + int result = 17; + + result = 37 * result + ( artifactId != null ? artifactId.hashCode() : 0 ); + + return result; + } //-- int hashCode() + + /** + * Set the artifactId for a plugin. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the name for a plugin. + * + * @param name + */ + public void setName( String name ) + { + this.name = name; + } //-- void setName( String ) + + /** + * Set the prefix for a plugin. + * + * @param prefix + */ + public void setPrefix( String prefix ) + { + this.prefix = prefix; + } //-- void setPrefix( String ) + + /** + * Method toString. + * + * @return String + */ + public java.lang.String toString() + { + StringBuilder buf = new StringBuilder( 128 ); + + buf.append( "artifactId = '" ); + buf.append( getArtifactId() ); + buf.append( "'" ); + + return buf.toString(); + } //-- java.lang.String toString() + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ProjectReference.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ProjectReference.java new file mode 100644 index 000000000..3009b0d88 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/ProjectReference.java @@ -0,0 +1,119 @@ +package org.apache.archiva.model; + +/* + * 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. + */ + +/** + * A reference to another (unversioned) Project. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class ProjectReference + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The Group ID of the project reference. + * + */ + private String groupId; + + /** + * + * The Artifact ID of the project reference. + * + */ + private String artifactId; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Get the Artifact ID of the project reference. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Get the Group ID of the project reference. + * + * @return String + */ + public String getGroupId() + { + return this.groupId; + } //-- String getGroupId() + + /** + * Set the Artifact ID of the project reference. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the Group ID of the project reference. + * + * @param groupId + */ + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } //-- void setGroupId( String ) + + + private static final long serialVersionUID = 8947981859537138991L; + + + private static String defaultString( String value ) + { + if ( value == null ) + { + return ""; + } + + return value.trim(); + } + + public static String toKey( ProjectReference reference ) + { + StringBuilder key = new StringBuilder(); + + key.append( defaultString( reference.getGroupId() ) ).append( ":" ); + key.append( defaultString( reference.getArtifactId() ) ); + + return key.toString(); + } + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/SnapshotVersion.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/SnapshotVersion.java new file mode 100644 index 000000000..0ab833eee --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/SnapshotVersion.java @@ -0,0 +1,96 @@ +package org.apache.archiva.model; + +/* + * 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 Snapshot Version. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class SnapshotVersion + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The unique timestamp for the snapshot version. + * + */ + private String timestamp; + + /** + * The incremental build number of the snapshot. + */ + private int buildNumber = 0; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Get the incremental build number of the snapshot. + * + * @return int + */ + public int getBuildNumber() + { + return this.buildNumber; + } //-- int getBuildNumber() + + /** + * Get the unique timestamp for the snapshot version. + * + * @return String + */ + public String getTimestamp() + { + return this.timestamp; + } //-- String getTimestamp() + + /** + * Set the incremental build number of the snapshot. + * + * @param buildNumber + */ + public void setBuildNumber( int buildNumber ) + { + this.buildNumber = buildNumber; + } //-- void setBuildNumber( int ) + + /** + * Set the unique timestamp for the snapshot version. + * + * @param timestamp + */ + public void setTimestamp( String timestamp ) + { + this.timestamp = timestamp; + } //-- void setTimestamp( String ) + + + private static final long serialVersionUID = -1251466956496493405L; + +} diff --git a/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/VersionedReference.java b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/VersionedReference.java new file mode 100644 index 000000000..f4949322e --- /dev/null +++ b/archiva-modules/archiva-base/archiva-model/src/main/java/org/apache/archiva/model/VersionedReference.java @@ -0,0 +1,147 @@ +package org.apache.archiva.model; + +/* + * 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. + */ + +/** + * A reference to another Versioned Project. + * + * @version $Revision$ $Date$ + */ +@SuppressWarnings( "all" ) +public class VersionedReference + implements java.io.Serializable +{ + + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ + + /** + * + * The Group ID of the repository content. + * + */ + private String groupId; + + /** + * + * The Artifact ID of the repository content. + * + */ + private String artifactId; + + /** + * + * The version of the repository content. + * + */ + private String version; + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + * Get the Artifact ID of the repository content. + * + * @return String + */ + public String getArtifactId() + { + return this.artifactId; + } //-- String getArtifactId() + + /** + * Get the Group ID of the repository content. + * + * @return String + */ + public String getGroupId() + { + return this.groupId; + } //-- String getGroupId() + + /** + * Get the version of the repository content. + * + * @return String + */ + public String getVersion() + { + return this.version; + } //-- String getVersion() + + /** + * Set the Artifact ID of the repository content. + * + * @param artifactId + */ + public void setArtifactId( String artifactId ) + { + this.artifactId = artifactId; + } //-- void setArtifactId( String ) + + /** + * Set the Group ID of the repository content. + * + * @param groupId + */ + public void setGroupId( String groupId ) + { + this.groupId = groupId; + } //-- void setGroupId( String ) + + /** + * Set the version of the repository content. + * + * @param version + */ + public void setVersion( String version ) + { + this.version = version; + } //-- void setVersion( String ) + + + private static final long serialVersionUID = -6990353165677563113L; + + + private static String defaultString( String value ) + { + if ( value == null ) + { + return ""; + } + + return value.trim(); + } + + public static String toKey( VersionedReference reference ) + { + StringBuilder key = new StringBuilder(); + + key.append( defaultString( reference.getGroupId() ) ).append( ":" ); + key.append( defaultString( reference.getArtifactId() ) ).append( ":" ); + key.append( defaultString( reference.getVersion() ) ); + + return key.toString(); + } + +} |