public synchronized GoogleCloudStorageItemInfo putItem ( GoogleCloudStorageItemInfo item ) { StorageResourceId id = item . getResourceId ( ) ; PrefixKey key = new PrefixKey ( id . getBucketName ( ) , id . getObjectName ( ) ) ; CacheValue < GoogleCloudStorageItemInfo > value = new CacheValue < GoogleCloudStorageItemInfo > ( item , ticker . read ( ) ) ; CacheValue < GoogleCloudStorageItemInfo > oldValue = itemMap . put ( key , value ) ; if ( oldValue == null ) { return null ; } if ( isExpired ( oldValue ) ) { cleanupLists ( key ) ; return null ; } return oldValue . getValue ( ) ; }
Inserts an item into the cache . If an item with the same resource id is present it is overwritten by the new item .