Class ExpiringBucketLifecycleManager
- java.lang.Object
-
- com.google.jenkins.plugins.storage.AbstractUpload
-
- com.google.jenkins.plugins.storage.AbstractBucketLifecycleManager
-
- com.google.jenkins.plugins.storage.ExpiringBucketLifecycleManager
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<AbstractUpload>
,Serializable
public class ExpiringBucketLifecycleManager extends AbstractBucketLifecycleManager
A simple implementation of the bucket lifecycle extension point that surfaces object expiration (aka TTL).- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpiringBucketLifecycleManager.DescriptorImpl
Denotes this is anAbstractUpload
plugin-
Nested classes/interfaces inherited from class com.google.jenkins.plugins.storage.AbstractUpload
AbstractUpload.UploadSpec
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ExpiringBucketLifecycleManager(String bucket, UploadModule module, Integer ttl, String bucketNameWithVars, Integer bucketObjectTTL)
Construct the simple lifecycle manager from a TLL and the common properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.api.services.storage.model.Bucket
checkBucket(com.google.api.services.storage.model.Bucket bucket)
This is intended to be an identity function that throws when the input is not adequately annotated.protected com.google.api.services.storage.model.Bucket
decorateBucket(com.google.api.services.storage.model.Bucket bucket)
A hook by which extensions may annotate a new or existing bucket.String
getDetails()
int
getTtl()
-
Methods inherited from class com.google.jenkins.plugins.storage.AbstractBucketLifecycleManager
getDescriptor, getInclusions, getOrCreateBucket
-
Methods inherited from class com.google.jenkins.plugins.storage.AbstractUpload
all, annotateObject, forResult, getBucket, getMetadata, getModule, getPathPrefix, isForFailedJobs, isSharedPublicly, isShowInline, perform, perform, setForFailedJobs, setPathPrefix, setSharedPublicly, setShowInline
-
-
-
-
Constructor Detail
-
ExpiringBucketLifecycleManager
@DataBoundConstructor public ExpiringBucketLifecycleManager(String bucket, @Nullable UploadModule module, Integer ttl, @Deprecated @Nullable String bucketNameWithVars, @Deprecated @Nullable Integer bucketObjectTTL)
Construct the simple lifecycle manager from a TLL and the common properties.- Parameters:
bucket
- GCS Bucket in which to alter the time to live.module
- Helper class methods to use for execution.ttl
- The number of days after which to delete data stored in the GCS bucket.bucketNameWithVars
- Legacy name for bucket. Deprecated.bucketObjectTTL
- Legacy name for ttl. Deprecated.
-
-
Method Detail
-
getDetails
public String getDetails()
- Specified by:
getDetails
in classAbstractUpload
- Returns:
- Provide detail information summarizing this download for the GCS upload report.
-
checkBucket
protected com.google.api.services.storage.model.Bucket checkBucket(com.google.api.services.storage.model.Bucket bucket) throws InvalidAnnotationException
This is intended to be an identity function that throws when the input is not adequately annotated.- Specified by:
checkBucket
in classAbstractBucketLifecycleManager
- Parameters:
bucket
- the pre-existing bucket whose annotations to validate.- Returns:
- The bucket that was validated.
- Throws:
InvalidAnnotationException
- if not annotated properly.
-
decorateBucket
protected com.google.api.services.storage.model.Bucket decorateBucket(com.google.api.services.storage.model.Bucket bucket)
A hook by which extensions may annotate a new or existing bucket.- Specified by:
decorateBucket
in classAbstractBucketLifecycleManager
- Parameters:
bucket
- The bucket to annotate and return.- Returns:
- The bucket to annotate and return.
-
getTtl
public int getTtl()
- Returns:
- Surface the TTL for objects contained within the bucket for roundtripping to the jelly UI.
-
-