Class ReleaseRepository

java.lang.Object
rs.baselib.util.ReleaseRepository

public class ReleaseRepository
extends java.lang.Object
Holds information about packages and modules.
Author:
ralph
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String BASELIB_ARTIFACT_ID  
    static java.lang.String BASELIB_GROUP_ID  
    static java.lang.String BUNDLE_ARTIFACT_ID  
    static ReleaseRepository INSTANCE
    The instance of the repository
  • Constructor Summary

    Constructors 
    Constructor Description
    ReleaseRepository()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    boolean addBuildProperties​(java.io.InputStream in)
    Add properties from given stream and parse release information with given prefix.
    boolean addBuildProperties​(java.net.URL url)
    Add properties from given URL and parse release information with given prefix.
    boolean addPomProperties​(java.io.InputStream in)
    Add properties from given stream and parse release information with given prefix.
    boolean addPomProperties​(java.net.URL url)
    Add properties from given URL and parse release information with given prefix.
    boolean addProperties​(java.io.File file)
    Add properties from given File and parse release information with given prefix.
    ReleaseInformation addReleaseInformation​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String name)
    Add release information in repository using the given properties.
    ReleaseInformation addReleaseInformation​(java.util.Properties props)
    Parse release information in repository using the given properties.
    boolean addReleaseInformation​(ReleaseInformation info)
    Add the given information to the repository.
    void dumpArtifacts()
    Dumps all release information own log in INFO level.
    void dumpArtifacts​(java.io.Writer writer)
    Dumps all release information into the writer.
    void dumpArtifacts​(Logger log, LogLevel logLevel)
    Dumps all release information to a log.
    void dumpArtifacts​(LogLevel logLevel)
    Dumps all release information to own log.
    java.util.Collection<ReleaseInformation> getAllInfos()
    Returns all artifacts.
    java.util.Collection<ReleaseInformation> getArtifactInfos​(java.lang.String groupId)
    Returns all artifact versions.
    java.util.Collection<java.lang.String> getArtifacts​(java.lang.String groupId)
    Returns all artifact IDs of a group.
    java.util.Collection<java.lang.String> getGroups()
    Returns all group IDs.
    ReleaseInformation getReleaseInformation​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
    Returns the information for the given artifact.
    java.util.Collection<ReleaseInformation> getVersionInfos​(java.lang.String groupId, java.lang.String artifactId)
    Returns all artifact versions.
    java.util.Collection<java.lang.String> getVersions​(java.lang.String groupId, java.lang.String artifactId)
    Returns all versions of an artifact.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • addProperties

      public boolean addProperties​(java.io.File file) throws java.io.IOException
      Add properties from given File and parse release information with given prefix.
      Parameters:
      file - file load from
      Returns:
      true when the information could be added
      Throws:
      java.io.IOException - when the stream cannot be read.
    • addBuildProperties

      public boolean addBuildProperties​(java.net.URL url) throws java.io.IOException
      Add properties from given URL and parse release information with given prefix.
      Parameters:
      url - url to load from
      Returns:
      true when the information could be added
      Throws:
      java.io.IOException - when the stream cannot be read.
    • addBuildProperties

      public boolean addBuildProperties​(java.io.InputStream in) throws java.io.IOException
      Add properties from given stream and parse release information with given prefix.
      Parameters:
      in - stream
      Returns:
      true when the information could be added
      Throws:
      java.io.IOException - when the stream cannot be read.
    • addPomProperties

      public boolean addPomProperties​(java.net.URL url) throws java.io.IOException
      Add properties from given URL and parse release information with given prefix.
      Parameters:
      url - url to load from
      Returns:
      true when the information could be added
      Throws:
      java.io.IOException - when the stream cannot be read.
    • addPomProperties

      public boolean addPomProperties​(java.io.InputStream in) throws java.io.IOException
      Add properties from given stream and parse release information with given prefix.
      Parameters:
      in - stream
      Returns:
      true when the information could be added
      Throws:
      java.io.IOException - when the stream cannot be read.
    • addReleaseInformation

      public ReleaseInformation addReleaseInformation​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String name)
      Add release information in repository using the given properties.
      Parameters:
      groupId - group ID of release
      artifactId - artifact ID of release
      version - version of release
      name - name of release
      Returns:
      the information created or null (if any property is null)
    • addReleaseInformation

      public ReleaseInformation addReleaseInformation​(java.util.Properties props)
      Parse release information in repository using the given properties.
      Parameters:
      props - the properties to be parsed
      Returns:
      the information found or null
    • addReleaseInformation

      public boolean addReleaseInformation​(ReleaseInformation info)
      Add the given information to the repository.
      Parameters:
      info - info to be added.
      Returns:
      true when the information could be added
    • getGroups

      public java.util.Collection<java.lang.String> getGroups()
      Returns all group IDs.
      Returns:
      collection with group IDs
    • getReleaseInformation

      public ReleaseInformation getReleaseInformation​(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
      Returns the information for the given artifact.
      Parameters:
      groupId - group ID
      artifactId - artifact ID
      version - version
      Returns:
      release information or NULL
    • getAllInfos

      public java.util.Collection<ReleaseInformation> getAllInfos()
      Returns all artifacts.
      Returns:
      collection with group IDs
    • getArtifactInfos

      public java.util.Collection<ReleaseInformation> getArtifactInfos​(java.lang.String groupId)
      Returns all artifact versions.
      Parameters:
      groupId - the groupId to check
      Returns:
      collection with release information
    • getVersionInfos

      public java.util.Collection<ReleaseInformation> getVersionInfos​(java.lang.String groupId, java.lang.String artifactId)
      Returns all artifact versions.
      Parameters:
      groupId - the groupId to check
      artifactId - the artifactId to check
      Returns:
      collection with release information
    • getArtifacts

      public java.util.Collection<java.lang.String> getArtifacts​(java.lang.String groupId)
      Returns all artifact IDs of a group.
      Parameters:
      groupId - group ID to return
      Returns:
      collection with artifact IDs
    • getVersions

      public java.util.Collection<java.lang.String> getVersions​(java.lang.String groupId, java.lang.String artifactId)
      Returns all versions of an artifact.
      Parameters:
      groupId - group ID to return
      artifactId - artifact ID to return
      Returns:
      collection with versions
    • dumpArtifacts

      public void dumpArtifacts()
      Dumps all release information own log in INFO level.
      Since:
      1.2.4
    • dumpArtifacts

      public void dumpArtifacts​(LogLevel logLevel)
      Dumps all release information to own log.
      Parameters:
      logLevel - the log level to be used
      Since:
      1.2.4
    • dumpArtifacts

      public void dumpArtifacts​(Logger log, LogLevel logLevel)
      Dumps all release information to a log.
      Parameters:
      log - the logger to be used
      logLevel - the log level to be used
      Since:
      1.2.4
    • dumpArtifacts

      public void dumpArtifacts​(java.io.Writer writer) throws java.io.IOException
      Dumps all release information into the writer.
      Parameters:
      writer - the writer where to dump to
      Throws:
      java.io.IOException - if I/O exception occurs
      Since:
      1.2.4