Class Bucket.Builder

  • Enclosing class:
    Bucket

    public static class Bucket.Builder
    extends Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • namespace

        public Bucket.Builder namespace​(String namespace)
        The Object Storage namespace in which the bucket resides.
        Parameters:
        namespace - the value to set
        Returns:
        this builder
      • name

        public Bucket.Builder name​(String name)
        The name of the bucket.

        Avoid entering confidential information. Example: my-new-bucket1

        Parameters:
        name - the value to set
        Returns:
        this builder
      • compartmentId

        public Bucket.Builder compartmentId​(String compartmentId)
        The compartment ID in which the bucket is authorized.
        Parameters:
        compartmentId - the value to set
        Returns:
        this builder
      • metadata

        public Bucket.Builder metadata​(Map<String,​String> metadata)
        Arbitrary string keys and values for user-defined metadata.
        Parameters:
        metadata - the value to set
        Returns:
        this builder
      • createdBy

        public Bucket.Builder createdBy​(String createdBy)
        The OCID of the user who created the bucket.
        Parameters:
        createdBy - the value to set
        Returns:
        this builder
      • timeCreated

        public Bucket.Builder timeCreated​(Date timeCreated)
        The date and time the bucket was created, as described in RFC 2616.
        Parameters:
        timeCreated - the value to set
        Returns:
        this builder
      • etag

        public Bucket.Builder etag​(String etag)
        The entity tag (ETag) for the bucket.
        Parameters:
        etag - the value to set
        Returns:
        this builder
      • publicAccessType

        public Bucket.Builder publicAccessType​(Bucket.PublicAccessType publicAccessType)
        The type of public access enabled on this bucket.

        A bucket is set to NoPublicAccess by default, which only allows an authenticated caller to access the bucket and its contents. When ObjectRead is enabled on the bucket, public access is allowed for the GetObject, HeadObject, and ListObjects operations. When ObjectReadWithoutList is enabled on the bucket, public access is allowed for the GetObject and HeadObject operations.

        Parameters:
        publicAccessType - the value to set
        Returns:
        this builder
      • storageTier

        public Bucket.Builder storageTier​(Bucket.StorageTier storageTier)
        The storage tier type assigned to the bucket.

        A bucket is set to Standard tier by default, which means objects uploaded or copied to the bucket will be in the standard storage tier. When the Archive tier type is set explicitly for a bucket, objects uploaded or copied to the bucket will be stored in archive storage. The storageTier property is immutable after bucket is created.

        Parameters:
        storageTier - the value to set
        Returns:
        this builder
      • objectEventsEnabled

        public Bucket.Builder objectEventsEnabled​(Boolean objectEventsEnabled)
        Whether or not events are emitted for object state changes in this bucket.

        By default, objectEventsEnabled is set to false. Set objectEventsEnabled to true to emit events for object state changes. For more information about events, see Overview of Events.

        Parameters:
        objectEventsEnabled - the value to set
        Returns:
        this builder
      • freeformTags

        public Bucket.Builder freeformTags​(Map<String,​String> freeformTags)
        Free-form tags for this resource.

        Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {“Department”: “Finance”}

        Parameters:
        freeformTags - the value to set
        Returns:
        this builder
      • definedTags

        public Bucket.Builder definedTags​(Map<String,​Map<String,​Object>> definedTags)
        Defined tags for this resource.

        Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {“Operations”: {“CostCenter”: “42”}}

        Parameters:
        definedTags - the value to set
        Returns:
        this builder
      • kmsKeyId

        public Bucket.Builder kmsKeyId​(String kmsKeyId)
        The OCID of a master encryption key used to call the Key Management service to generate a data encryption key or to encrypt or decrypt a data encryption key.
        Parameters:
        kmsKeyId - the value to set
        Returns:
        this builder
      • objectLifecyclePolicyEtag

        public Bucket.Builder objectLifecyclePolicyEtag​(String objectLifecyclePolicyEtag)
        The entity tag (ETag) for the live object lifecycle policy on the bucket.
        Parameters:
        objectLifecyclePolicyEtag - the value to set
        Returns:
        this builder
      • approximateCount

        public Bucket.Builder approximateCount​(Long approximateCount)
        The approximate number of objects in the bucket.

        Count statistics are reported periodically. You will see a lag between what is displayed and the actual object count.

        Parameters:
        approximateCount - the value to set
        Returns:
        this builder
      • approximateSize

        public Bucket.Builder approximateSize​(Long approximateSize)
        The approximate total size in bytes of all objects in the bucket.

        Size statistics are reported periodically. You will see a lag between what is displayed and the actual size of the bucket.

        Parameters:
        approximateSize - the value to set
        Returns:
        this builder
      • replicationEnabled

        public Bucket.Builder replicationEnabled​(Boolean replicationEnabled)
        Whether or not this bucket is a replication source.

        By default, replicationEnabled is set to false. This will be set to ‘true’ when you create a replication policy for the bucket.

        Parameters:
        replicationEnabled - the value to set
        Returns:
        this builder
      • isReadOnly

        public Bucket.Builder isReadOnly​(Boolean isReadOnly)
        Whether or not this bucket is read only.

        By default, isReadOnly is set to false. This will be set to ‘true’ when this bucket is configured as a destination in a replication policy.

        Parameters:
        isReadOnly - the value to set
        Returns:
        this builder
      • id

        public Bucket.Builder id​(String id)
        The OCID of the bucket.
        Parameters:
        id - the value to set
        Returns:
        this builder
      • versioning

        public Bucket.Builder versioning​(Bucket.Versioning versioning)
        The versioning status on the bucket.

        A bucket is created with versioning Disabled by default. For versioning Enabled, objects are protected from overwrites and deletes, by maintaining their version history. When versioning is Suspended, the previous versions will still remain but new versions will no longer be created when overwitten or deleted.

        Parameters:
        versioning - the value to set
        Returns:
        this builder
      • autoTiering

        public Bucket.Builder autoTiering​(Bucket.AutoTiering autoTiering)
        The auto tiering status on the bucket.

        A bucket is created with auto tiering Disabled by default. For auto tiering InfrequentAccess, objects are transitioned automatically between the ‘Standard’ and ‘InfrequentAccess’ tiers based on the access pattern of the objects.

        Parameters:
        autoTiering - the value to set
        Returns:
        this builder
      • build

        public Bucket build()