View Javadoc

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.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  }