Class MavenStorage

java.lang.Object
net.microfalx.talos.core.MavenStorage

public class MavenStorage extends Object
Provides locations to store files for Maven projects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    cleanupWorkspace(org.apache.maven.execution.MavenSession session)
    Cleanups the workspaces based on file age.
    static net.microfalx.resource.Resource
    Returns the directory to store data for all workspaces (mostly temporary data).
    static net.microfalx.resource.Resource
    getLocalSessionsDirectory(org.apache.maven.execution.MavenSession session)
    Returns the directory to store data for a given session (mostly temporary data).
    static Collection<net.microfalx.resource.Resource>
    getLocalTrends(org.apache.maven.execution.MavenSession session)
    Returns a list of resources containing trends information.
    static net.microfalx.resource.Resource
    getLocalTrendsDirectory(org.apache.maven.execution.MavenSession session)
    Returns the directory to store data for trends a given project.
    static net.microfalx.resource.Resource
    getRemoteSessionsDirectory(org.apache.maven.execution.MavenSession session)
    Returns the directory to store data for a given session (mostly temporary data).
    static net.microfalx.resource.Resource
    getRemoteStorage(org.apache.maven.execution.MavenSession session)
    Returns a resource used to store session data remotely.
    static Collection<net.microfalx.resource.Resource>
    getRemoteTrends(org.apache.maven.execution.MavenSession session)
    Returns a list of resources containing trends information.
    static net.microfalx.resource.Resource
    getRemoteTrendsDirectory(org.apache.maven.execution.MavenSession session)
    Returns the directory to store data for trends a given project.
    static net.microfalx.resource.Resource
    Returns a staging directory used to collect data related to a build.
    static net.microfalx.resource.Resource
    getStagingDirectory(org.apache.maven.execution.MavenSession session)
    Returns a staging directory used to collect data related to a build.
    static net.microfalx.resource.Resource
    Returns a director used to store files for any maven plugins.
    static boolean
    hasRemoteStorage(org.apache.maven.execution.MavenSession session)
    Returns whether a remote storage was configured.
    static net.microfalx.resource.Resource
    storeTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend)
    Stores trend metrics.
    static void
    uploadTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend)
    Uploads the trend metrics to a remote store.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MavenStorage

      public MavenStorage()
  • Method Details

    • getStorageDirectory

      public static net.microfalx.resource.Resource getStorageDirectory()
      Returns a director used to store files for any maven plugins.
      Returns:
      a non-null instance
    • getLocalSessionsDirectory

      public static net.microfalx.resource.Resource getLocalSessionsDirectory()
      Returns the directory to store data for all workspaces (mostly temporary data).
      Returns:
      a non-null instance
    • getStagingDirectory

      public static net.microfalx.resource.Resource getStagingDirectory()
      Returns a staging directory used to collect data related to a build.
      Returns:
      the staging directory for a session
    • getStagingDirectory

      public static net.microfalx.resource.Resource getStagingDirectory(org.apache.maven.execution.MavenSession session)
      Returns a staging directory used to collect data related to a build.
      Parameters:
      session - the session
      Returns:
      the staging directory for a session
    • getLocalSessionsDirectory

      public static net.microfalx.resource.Resource getLocalSessionsDirectory(org.apache.maven.execution.MavenSession session)
      Returns the directory to store data for a given session (mostly temporary data).
      Parameters:
      session - the session
      Returns:
      a non-null instance
    • getRemoteSessionsDirectory

      public static net.microfalx.resource.Resource getRemoteSessionsDirectory(org.apache.maven.execution.MavenSession session)
      Returns the directory to store data for a given session (mostly temporary data).
      Parameters:
      session - the session
      Returns:
      a non-null instance
    • getLocalTrendsDirectory

      public static net.microfalx.resource.Resource getLocalTrendsDirectory(org.apache.maven.execution.MavenSession session)
      Returns the directory to store data for trends a given project.
      Parameters:
      session - the session
      Returns:
      a non-null instance
    • storeTrend

      public static net.microfalx.resource.Resource storeTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend) throws IOException
      Stores trend metrics.
      Parameters:
      session - the session
      trend - the trend resource
      Throws:
      IOException - if an I/O error occurs
    • uploadTrend

      public static void uploadTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend) throws IOException
      Uploads the trend metrics to a remote store.
      Parameters:
      session - the maven session
      trend - the trend resource
      Throws:
      IOException - if an I/O error occurs
    • getLocalTrends

      public static Collection<net.microfalx.resource.Resource> getLocalTrends(org.apache.maven.execution.MavenSession session) throws IOException
      Returns a list of resources containing trends information.
      Parameters:
      session - the session
      Returns:
      a non-null instance
      Throws:
      IOException - if an I/O error occurs
    • getRemoteTrends

      public static Collection<net.microfalx.resource.Resource> getRemoteTrends(org.apache.maven.execution.MavenSession session) throws IOException
      Returns a list of resources containing trends information.
      Parameters:
      session - the session
      Returns:
      a non-null instance
      Throws:
      IOException - if an I/O error occurs
    • hasRemoteStorage

      public static boolean hasRemoteStorage(org.apache.maven.execution.MavenSession session)
      Returns whether a remote storage was configured.
      Parameters:
      session - the session
      Returns:
      true if configured, false otherwise
    • getRemoteStorage

      public static net.microfalx.resource.Resource getRemoteStorage(org.apache.maven.execution.MavenSession session)
      Returns a resource used to store session data remotely.

      If the remote store is not configured, the Resource.NULL is returned.

      Parameters:
      session - the session
      Returns:
      a non-null instance
    • getRemoteTrendsDirectory

      public static net.microfalx.resource.Resource getRemoteTrendsDirectory(org.apache.maven.execution.MavenSession session)
      Returns the directory to store data for trends a given project.
      Parameters:
      session - the session
      Returns:
      a non-null instance
    • cleanupWorkspace

      public static void cleanupWorkspace(org.apache.maven.execution.MavenSession session)
      Cleanups the workspaces based on file age.