org.opengis.feature
Interface LockResponse
-
@XmlElement(value="LockFeatureResponse") public interface LockResponse
Represents a response for a lock request. A lock is requested for a duration, except for the special case of aTRANSACTION_LOCKwhere the request is until the next commit or rollback.A successful lock request will result in an authorization ID being generated. This is a simple token you can keep until you need to work with the content again. Without this token you are prevented from work (at least until the duration is up).
- Since:
- GeoAPI 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddAuthorization(FeatureStore store, java.lang.String token)Add an additional authorization token to collected results forTransaction.commit().java.lang.StringgetAuthorization(FeatureStore store)Returns the authorization token for indicated feature store, or null if there is no locks known for the feature store.java.util.Set<FeatureStore>getFeatureStores()Returns the set of locked feature stores.intgetNumberLocked()Number of features successfully locked, or -1 if unknown In the rare case where you need to report back on the number of successful locks you can issue a bunch of individual lock request and check the number of features locked.java.lang.StringgetToken()Retreives the authorization token for the special case of only oneFeatureStorebeing locked.voidincreaseNumberLocked(int amount)Used to collect the results of a number of lock requests forTransaction.commit().
-
-
-
Method Detail
-
getNumberLocked
int getNumberLocked()
Number of features successfully locked, or -1 if unknown In the rare case where you need to report back on the number of successful locks you can issue a bunch of individual lock request and check the number of features locked.- Returns:
- number of locked features or -1 if unknown.
-
increaseNumberLocked
void increaseNumberLocked(int amount)
Used to collect the results of a number of lock requests forTransaction.commit().
-
addAuthorization
void addAuthorization(FeatureStore store, java.lang.String token)
Add an additional authorization token to collected results forTransaction.commit(). Note this abstraction does not allow the collection of more than one token perFeatureStore. This should not be an issue give our two workflows:AUTO_COMMIT: Each lock method returns a differentLockResponse.Transaction+TRANSACTION_LOCK: Sepcial case objectTRANSACTION_LOCK_RESPONSEis always returned.Transaction: Each lock method returns null, commit returns a singleLockResponse. Given that aTransactionis supposed to gather everything up into a single commit, a datastore should be capable of issuing a single authorization token (even if more then one of itsFeatureCollections was involved in the transaction.
-
getToken
@XmlElement(value="LockID") java.lang.String getToken()
Retreives the authorization token for the special case of only oneFeatureStorebeing locked. This is the most common situation. Often client code will only work on oneFeatureCollectionat a time, or severalFeatureCollections belonging to the sameFeatureStore.- Returns:
- token, or null if a single token was unavailable.
-
getAuthorization
java.lang.String getAuthorization(FeatureStore store)
Returns the authorization token for indicated feature store, or null if there is no locks known for the feature store.- Parameters:
store- The feature store to search for.- Returns:
- token, or null if a token for feature store was unavailable.
-
getFeatureStores
@XmlElement(value="FeaturesLocked") java.util.Set<FeatureStore> getFeatureStores()
Returns the set of locked feature stores.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG