public class CacheEntry extends Object
Constructor and Description |
---|
CacheEntry(GoogleCloudStorageItemInfo itemInfo) |
CacheEntry(StorageResourceId resourceId)
Constructs a CacheEntry with no known GoogleCloudStorageItemInfo; callers may have to
fetch the associated GoogleCloudStorageItemInfo on-demand.
|
CacheEntry(StorageResourceId resourceId,
long creationTimeMillis)
Constructs a CacheEntry with no known GoogleCloudStorageItemInfo and an explicit
creationTimeMillis; callers may have to fetch the associated GoogleCloudStorageItemInfo
on-demand.
|
Modifier and Type | Method and Description |
---|---|
void |
clearItemInfo()
Clears the GoogleCloudStorageItemInfo stored by this CacheEntry, if any, and sets
itemInfoUpdateTimeMillis to 0.
|
long |
getCreationTimeMillis()
Accessor for the creation-time of this CacheEntry, which was set at construction-time and is
immutable.
|
GoogleCloudStorageItemInfo |
getItemInfo()
Returns the GoogleCloudStorageItemInfo currently held by this CacheEntry; may be null if one
was never provided.
|
long |
getItemInfoUpdateTimeMillis()
Accessor for the last time the GoogleCloudStorageItemInfo of this CacheEntry was updated,
or 0 if it was never updated.
|
StorageResourceId |
getResourceId()
Returns the StorageResourceId associated with this CacheEntry; may identify a Bucket or
StorageObject.
|
static void |
setClock(com.google.api.client.util.Clock clock)
Sets a custom Clock to be used for computing cache creation and update times.
|
GoogleCloudStorageItemInfo |
setItemInfo(GoogleCloudStorageItemInfo newItemInfo)
Sets the GoogleCloudStorageItemInfo corresponding to this CacheEntry's StorageResourceId,
and updates the itemInfoUpdateTimeMillis.
|
public CacheEntry(StorageResourceId resourceId)
resourceId
- Must be non-null, and correspond to either a Bucket or StorageObject.public CacheEntry(StorageResourceId resourceId, long creationTimeMillis)
resourceId
- Must be non-null, and correspond to either a Bucket or StorageObject.creationTimeMillis
- The logical creation time of the authoritative cache entry.public CacheEntry(GoogleCloudStorageItemInfo itemInfo)
itemInfo
- A last-known itemInfo associated to be held and returned by this CacheEntry;
must be non-null, must be a Bucket or StorageObject, and exists() must return true.public static void setClock(com.google.api.client.util.Clock clock)
public StorageResourceId getResourceId()
public long getCreationTimeMillis()
public long getItemInfoUpdateTimeMillis()
public GoogleCloudStorageItemInfo getItemInfo()
public void clearItemInfo()
public GoogleCloudStorageItemInfo setItemInfo(GoogleCloudStorageItemInfo newItemInfo)
newItemInfo
- Info corresponding to this entry's Storage resource, must not be null,
must not be root, and the info's StorageResourceId must match the existing
StorageResourceId of this CacheEntry.Copyright © 2015. All rights reserved.