Assembly: soss_namedcache (in soss_namedcache.dll) Version: 220.127.116.11
public static Task<AsyncGetMetadataResult> GetMetadataAsync( this NamedCache cache, string id, GetMetadataOptions options = null, LockTicket lockTicket = null, CancellationToken cancellationToken = null )
<ExtensionAttribute> Public Shared Function GetMetadataAsync ( cache As NamedCache, id As String, Optional options As GetMetadataOptions = Nothing, Optional lockTicket As LockTicket = Nothing, Optional cancellationToken As CancellationToken = Nothing ) As Task(Of AsyncGetMetadataResult)
- Type: Soss.ClientNamedCache
the NamedCache this extension method operates on.
- Type: SystemString
a String that will be transformed into a CachedObjectId via CreateKey(String) which identifies the object in the cache.
- options (Optional)
- Type: Soss.ClientGetMetadataOptions
A set of GetMetadataOptions options that control locking and GeoServer behavior.
- lockTicket (Optional)
- Type: Soss.ClientLockTicket
An optional LockTicket obtained from a previous locking call
- cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
An optional CancellationToken that can be used to cancel the asynchronous operation.
Return ValueType: TaskAsyncGetMetadataResult
If the object identified by id is found in the cache, the object's NamedCacheObjectMetadata is returned. If the object is not found in the cache, null is returned.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type NamedCache. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
|ObjectLockedException||Thrown if the options parameter requests a lock but the associated object in the StateServer is locked by another client.|
|StateServerException||Thrown if ScaleOut StateServer is unavailable or has experienced an internal error.|
|ReadThroughTimeoutException||Thrown if GeoServer pull replication is used on this NamedCache and a remote read of an object is delayed beyond the number of retries specified by MaxReadThroughPendingAttempts.|
This method optionally locks the object in SOSS to prevent other clients from updating or removing the object. The UseLocking property is not taken into consideration by this method. If the options parameter requests a lock, this call will block until the lock is acquired or the MaxLockAttempts limit has been met. The lock affects the entire object, not just its metadata, and can be released through a call to ReleaseLock(CachedObjectId), Update(CachedObjectId, Object, Boolean), Remove(CachedObjectId), SetMetadata(CachedObjectId, ObjectMetadata, Boolean), or their asynchronous equivalents. If no subsequent call is made, the lock will automatically expire after approximately 90 seconds. Re-locking an object that is already locked by the same instance of the NamedCache will refresh the lock by resetting the 90 second lock timeout.
If GeoServer pull replication is being used with this named cache, note that performing a locking retrieval of an object's metadata will cause GeoServer pull replication to move the master copy of the associated object into the local store.