@Override public void setUserAttribute(Object value) { checkReadiness(); this.regionUserAttribute = value; }
@Override public AttributesMutator getAttributesMutator() { checkReadiness(); return this; }
@Override public Region getSubregion(String path) { checkReadiness(); return getSubregion(path, false); }
@Override public Set subregions(boolean recursive) { checkReadiness(); return new SubregionsSet(recursive); }
/** * This method should be called when the caller cannot locate an entry and that condition is * unexpected. This will first double check the cache and region state before throwing an * EntryNotFoundException. EntryNotFoundException should be a last resort exception. * * @param entryKey the missing entry's key. */ @Override public void checkEntryNotFound(Object entryKey) { checkReadiness(); // Localized string for partitioned region is generic enough for general use throw new EntryNotFoundException( String.format("Entry not found for key %s", entryKey)); }
@Override public void invalidate(Object key, Object aCallbackArgument) throws TimeoutException, EntryNotFoundException { checkReadiness(); checkForLimitedOrNoAccess(); validatedInvalidate(key, aCallbackArgument); }
/** * Flavor of keys that will not do repeatable read * * @since GemFire 5.5 */ public Set testHookKeys() { checkReadiness(); checkForNoAccess(); return new EntriesSet(this, false, IteratorType.KEYS, false /* allowTombstones */); }
/** * return a set of the keys in this region * * @param allowTombstones whether destroyed entries should be included * @return the keys */ public Set keySet(boolean allowTombstones) { checkReadiness(); checkForNoAccess(); return new EntriesSet(this, false, IteratorType.KEYS, allowTombstones); }
@Override public boolean containsKeyOnServer(Object key) { checkReadiness(); checkForNoAccess(); ServerRegionProxy proxy = getServerProxy(); if (proxy != null) { return proxy.containsKey(key); } else { throw new UnsupportedOperationException( "Server keySet requires a pool."); } }
@Override public Collection values() { checkReadiness(); checkForNoAccess(); if (!restoreSetOperationTransactionBehavior) { discoverJTA(); } return new EntriesSet(this, false, IteratorType.VALUES, false); }
/** * This implementation only checks readiness and scope */ @Override public Lock getRegionDistributedLock() throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException( "Only supported for GLOBAL scope, not LOCAL"); }
/** * This implementation only checks readiness and scope */ @Override public Lock getDistributedLock(Object key) throws IllegalStateException { checkReadiness(); checkForLimitedOrNoAccess(); Scope theScope = getAttributes().getScope(); Assert.assertTrue(theScope == Scope.LOCAL); throw new IllegalStateException( "Only supported for GLOBAL scope, not LOCAL"); }
@Override public Set entrySet(boolean recursive) { checkReadiness(); checkForNoAccess(); if (!restoreSetOperationTransactionBehavior) { discoverJTA(); } return basicEntries(recursive); }
public Set keys() { checkReadiness(); checkForNoAccess(); if (!restoreSetOperationTransactionBehavior) { discoverJTA(); } return new EntriesSet(this, false, IteratorType.KEYS, false); }
@Override public boolean containsKey(Object key) { checkReadiness(); checkForNoAccess(); return getDataView().containsKey(getKeyInfo(key), this); }
@Retained EntryEventImpl newDestroyEntryEvent(Object key, Object aCallbackArgument) { validateKey(key); checkReadiness(); checkForLimitedOrNoAccess(); return EntryEventImpl.create(this, Operation.DESTROY, key, null/* newValue */, aCallbackArgument, false, getMyId()); }
@Override public Region.Entry getEntry(Object key) { validateKey(key); checkReadiness(); checkForNoAccess(); discoverJTA(); return getDataView().getEntry(getKeyInfo(key), this, false); }
@Retained private EntryEventImpl newCreateEntryEvent(Object key, Object value, Object aCallbackArgument) { validateArguments(key, value, aCallbackArgument); checkReadiness(); checkForLimitedOrNoAccess(); return EntryEventImpl .create(this, Operation.CREATE, key, value, aCallbackArgument, false, getMyId()) /* to distinguish genuine create */.setCreate(true); }
@Override public void localInvalidateRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionInvalidate(); checkReadiness(); checkForNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_INVALIDATE, aCallbackArgument, false, getMyId()); basicInvalidateRegion(event); }
@Override public void invalidateRegion(Object aCallbackArgument) throws TimeoutException { getDataView().checkSupportsRegionInvalidate(); checkReadiness(); checkForLimitedOrNoAccess(); RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_INVALIDATE, aCallbackArgument, false, getMyId(), generateEventID()); basicInvalidateRegion(event); }