| 1 | /** |
| 2 | * Licensed to jclouds, Inc. (jclouds) under one or more |
| 3 | * contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. jclouds licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.jclouds.s3.domain; |
| 20 | |
| 21 | import java.net.URI; |
| 22 | import java.util.Date; |
| 23 | import java.util.Map; |
| 24 | |
| 25 | import org.jclouds.io.ContentMetadata; |
| 26 | |
| 27 | /** |
| 28 | * /** Amazon S3 is designed to store objects. Objects are stored in {@link S3BucketListing buckets} |
| 29 | * and consist of a {@link org.jclouds.s3.domain.S3Object#getData() value}, a |
| 30 | * {@link S3Object#getKey key}, {@link ObjectMetadata#getUserMetadata() metadata}, and an access |
| 31 | * control policy. |
| 32 | * |
| 33 | * @author Adrian Cole |
| 34 | * @see <a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?UsingObjects.html" |
| 35 | * |
| 36 | * @see <a href= "http://docs.amazonwebservices.com/AmazonS3/2006-03-01/UsingMetadata.html" /> |
| 37 | */ |
| 38 | public interface ObjectMetadata extends Comparable<ObjectMetadata> { |
| 39 | |
| 40 | public enum StorageClass { |
| 41 | STANDARD, REDUCED_REDUNDANCY |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * The key is the handle that you assign to an object that allows you retrieve it later. A key is |
| 46 | * a sequence of Unicode characters whose UTF-8 encoding is at most 1024 bytes long. Each object |
| 47 | * in a bucket must have a unique key. |
| 48 | * |
| 49 | * @see <a href= "http://docs.amazonwebservices.com/AmazonHTTP/2006-03-01/UsingKeys.html" /> |
| 50 | */ |
| 51 | String getKey(); |
| 52 | |
| 53 | String getBucket(); |
| 54 | |
| 55 | URI getUri(); |
| 56 | |
| 57 | /** |
| 58 | * Every bucket and object in Amazon S3 has an owner, the user that created the bucket or object. |
| 59 | * The owner of a bucket or object cannot be changed. However, if the object is overwritten by |
| 60 | * another user (deleted and rewritten), the new object will have a new owner. |
| 61 | */ |
| 62 | CanonicalUser getOwner(); |
| 63 | |
| 64 | /** |
| 65 | * Currently defaults to 'STANDARD' and not used. |
| 66 | */ |
| 67 | StorageClass getStorageClass(); |
| 68 | |
| 69 | /** |
| 70 | * Can be used to specify caching behavior along the request/reply chain. |
| 71 | * |
| 72 | * @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html?sec14.9. |
| 73 | */ |
| 74 | String getCacheControl(); |
| 75 | |
| 76 | Date getLastModified(); |
| 77 | |
| 78 | String getETag(); |
| 79 | |
| 80 | Map<String, String> getUserMetadata(); |
| 81 | |
| 82 | ContentMetadata getContentMetadata(); |
| 83 | |
| 84 | } |