1 /*
2  * Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  *  http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */

15 package com.amazonaws.services.s3.model;
16
17 /**
18  * <p>
19  * Specifies constants that define Amazon S3 storage classes. The standard storage class
20  * is the default storage class.
21  * </p>
22  * <p>
23  * Amazon S3 offers multiple storage classes for different customers' needs. The
24  * <code>STANDARD</code> storage class is the default storage class, and means that
25  * redundant copies of data will be stored in different locations.
26  * </p>
27  * <p>
28  * The <code>REDUCED_REDUNDANCY</code> storage class offers customers who are using Amazon S3
29  * for storing non-critical, reproducible data a low-cost highly available,
30  * but less redundant, storage option.
31  * </p>
32  */

33 public enum StorageClass {
34
35     /**
36      * The default Amazon S3 storage class. This storage class
37      * is recommended for critical, non-reproducible data.  The standard
38      * storage class is a highly available and highly redundant storage option
39      * provided for an affordable price.
40      */

41     Standard("STANDARD"),
42
43     /**
44      * The reduced redundancy storage class.
45      * This storage class allows customers to reduce their storage costs
46      * in return for a reduced level of data redundancy. Customers who are using
47      * Amazon S3 for storing non-critical, reproducible data can choose this
48      * low cost and highly available, but less redundant, storage option.
49      */

50     ReducedRedundancy("REDUCED_REDUNDANCY"),
51
52     /**
53      * The Amazon Glacier storage class.
54      * This storage class means your object's data is stored in Amazon Glacier,
55      * and Amazon S3 stores a reference to the data in the Amazon S3 bucket.
56      */

57     Glacier("GLACIER"),
58
59     /**
60      * Standard Infrequent Access storage class
61      */

62     StandardInfrequentAccess("STANDARD_IA"),
63
64     /**
65      * One Zone Infrequent Access storage class stores object data in only one Availability Zone at a lower price than
66      * STANDARD_IA.
67      */

68     OneZoneInfrequentAccess("ONEZONE_IA"),
69
70     /**
71      * IntelligentTiering makes it easy to lower your overall cost of storage by automatically placing data in the storage
72      * class that best matches the access patterns for the storage. With IntelligentTiering, you don’t need to define
73      * and manage individual policies for lifecycle data management or write code to transition objects
74      * between storage classes. Instead, you can use IntelligentTiering to manage transitions between Standard and
75      * S-IA without writing any application code. IntelligentTiering also manages transitions automatically to
76      * Glacier for long term archive in addition to S3 storage classes.
77      */

78     IntelligentTiering("INTELLIGENT_TIERING"),
79
80     /**
81      * S3 Glacier Deep Archive provides secure, durable object storage class for long term data archival. It’s the
82      * ideal storage class to make an archival, durable copy of data that rarely, if ever, needs to be accessed. It can
83      * be used as an offline backup for their most important data assets and to meet long-term retention needs.
84      */

85     DeepArchive("DEEP_ARCHIVE")
86     ;
87
88     /**
89      * Returns the Amazon S3 {@link StorageClass} enumeration value representing the
90      * specified Amazon S3 <code>StorageClass</code> ID string.
91      * If the specified string doesn't map to a known Amazon S3 storage class,
92      * an <code>IllegalArgumentException</code> is thrown.
93      *
94      * @param s3StorageClassString
95      *            The Amazon S3 storage class ID string.
96      *
97      * @return The Amazon S3 <code>StorageClass</code> enumeration value representing the
98      *         specified Amazon S3 storage class ID.
99      *
100      * @throws IllegalArgumentException
101      *             If the specified value does not map to one of the known
102      *             Amazon S3 storage classes.
103      */

104     public static StorageClass fromValue(String s3StorageClassString) throws IllegalArgumentException {
105         for (StorageClass storageClass : StorageClass.values()) {
106             if (storageClass.toString().equals(s3StorageClassString)) return storageClass;
107         }
108
109         throw new IllegalArgumentException(
110                 "Cannot create enum from " + s3StorageClassString + " value!");
111     }
112
113     private final String storageClassId;
114
115     private StorageClass(String id) {
116         this.storageClassId = id;
117     }
118
119     /* (non-Javadoc)
120      * @see java.lang.Enum#toString()
121      */

122     @Override
123     public String toString() {
124         return storageClassId;
125     }
126
127 }
128