public class StringPrefixPartitionResolver extends Object implements PartitionResolver<String,Object>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_DELIMITER
The default delimiter is "|".
|
| Constructor and Description |
|---|
StringPrefixPartitionResolver()
Creates a prefix resolver with the default delimiter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Called when the region containing this callback is closed or destroyed, when the cache is
closed, or when a callback is removed from a region using an
AttributesMutator. |
boolean |
equals(Object o) |
String |
getName()
Returns the name of the PartitionResolver
|
Object |
getRoutingObject(EntryOperation<String,Object> opDetails)
Returns the prefix of the String key that precedes the first "|" in the key.
|
int |
hashCode() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitinit, initializepublic static final String DEFAULT_DELIMITER
public StringPrefixPartitionResolver()
public Object getRoutingObject(EntryOperation<String,Object> opDetails)
getRoutingObject in interface PartitionResolver<String,Object>opDetails - the detail of the entry operation e.g. Region.get(Object)ClassCastException - if the key is not an instance of StringIllegalArgumentException - if the key does not contain at least one "|".public String getName()
PartitionResolvergetName in interface PartitionResolver<String,Object>public void close()
CacheCallbackAttributesMutator.
Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.
It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.
close in interface CacheCallbackRegionService.close(),
Region.close(),
Region.localDestroyRegion(),
Region.destroyRegion(),
AttributesMutator