Package net.microfalx.talos.core
Class MavenStorage
java.lang.Object
net.microfalx.talos.core.MavenStorage
Provides locations to store files for Maven projects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcleanupWorkspace(org.apache.maven.execution.MavenSession session) Cleanups the workspaces based on file age.static net.microfalx.resource.ResourceReturns the directory to store data for all workspaces (mostly temporary data).static net.microfalx.resource.ResourcegetLocalSessionsDirectory(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.ResourcegetLocalTrendsDirectory(org.apache.maven.execution.MavenSession session) Returns the directory to store data for trends a given project.static net.microfalx.resource.ResourcegetRemoteSessionsDirectory(org.apache.maven.execution.MavenSession session) Returns the directory to store data for a given session (mostly temporary data).static net.microfalx.resource.ResourcegetRemoteStorage(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.ResourcegetRemoteTrendsDirectory(org.apache.maven.execution.MavenSession session) Returns the directory to store data for trends a given project.static net.microfalx.resource.ResourceReturns a staging directory used to collect data related to a build.static net.microfalx.resource.ResourcegetStagingDirectory(org.apache.maven.execution.MavenSession session) Returns a staging directory used to collect data related to a build.static net.microfalx.resource.ResourceReturns a director used to store files for any maven plugins.static booleanhasRemoteStorage(org.apache.maven.execution.MavenSession session) Returns whether a remote storage was configured.static net.microfalx.resource.ResourcestoreTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend) Stores trend metrics.static voiduploadTrend(org.apache.maven.execution.MavenSession session, net.microfalx.resource.Resource trend) Uploads the trend metrics to a remote store.
-
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 sessiontrend- 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 sessiontrend- 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:
trueif configured,falseotherwise
-
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.NULLis 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.
-