View Javadoc

1   /**
2    *
3    * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4    *
5    * ====================================================================
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * 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, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   * ====================================================================
18   */
19  package org.jclouds.blobstore.domain;
20  
21  import java.net.URI;
22  import java.util.Date;
23  import java.util.Map;
24  
25  import org.jclouds.blobstore.domain.internal.StorageMetadataImpl;
26  import org.jclouds.domain.ResourceMetadata;
27  
28  import com.google.inject.ImplementedBy;
29  
30  /**
31   * Identifies containers, files, etc.
32   * 
33   * @author Adrian Cole
34   */
35  @ImplementedBy(StorageMetadataImpl.class)
36  public interface StorageMetadata extends ResourceMetadata<StorageType> {
37  
38     /**
39      * Whether this resource is a container, file, etc.
40      */
41     @Override
42     StorageType getType();
43  
44     /**
45      * Unique identifier of this resource within its enclosing namespace. In some scenarios, this id
46      * is not user assignable. For files, this may be an system generated key, or the full path to
47      * the resource. ex. /path/to/file.txt
48      * 
49      * @see org.jclouds.blobstore.attr.ContainerCapability#CONTAINER_METADATA
50      */
51     @Override
52     String getProviderId();
53  
54     /**
55      * Name of this resource. Names are dictated by the user. For files, this may be the filename,
56      * ex. file.txt
57      * 
58      */
59     @Override
60     String getName();
61  
62     /**
63      * URI used to access this resource
64      */
65     @Override
66     URI getUri();
67  
68     /**
69      * Any key-value pairs associated with the resource.
70      * 
71      * @see org.jclouds.blobstore.attr.ContainerCapability#CONTAINER_METADATA
72      * @see org.jclouds.blobstore.attr.ContainerCapability#BLOB_METADATA
73      */
74     @Override
75     Map<String, String> getUserMetadata();
76  
77     /**
78      * The eTag value stored in the Etag header returned by HTTP.
79      * 
80      * @see org.jclouds.blobstore.attr.ContainerCapability#CONTAINER_ETAG
81      * @see org.jclouds.blobstore.attr.ContainerCapability#BLOB_ETAG
82      */
83     String getETag();
84  
85     /**
86      * Last modification time of the resource
87      * 
88      * @see org.jclouds.blobstore.attr.ContainerCapability#CONTAINER_LAST_MODIFIED
89      * @see org.jclouds.blobstore.attr.ContainerCapability#BLOB_LAST_MODIFIED
90      * @see org.jclouds.blobstore.attr.ContainerCapability#MILLISECOND_PRECISION
91      */
92     Date getLastModified();
93  
94  }