make ShardSet serializable
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.inteligr8.alfresco.asie.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
@@ -11,7 +12,9 @@ import org.alfresco.repo.index.shard.ShardMethodEnum;
|
||||
import org.alfresco.repo.index.shard.ShardState;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
|
||||
public class ShardSet {
|
||||
public class ShardSet implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8891094367429601316L;
|
||||
|
||||
/**
|
||||
* Examples:
|
||||
@@ -24,12 +27,12 @@ public class ShardSet {
|
||||
* DATE;key:cm:created;date.grouping:3
|
||||
* PROPERTY;key:cm:created;regex:^d{4}
|
||||
*/
|
||||
private final Pattern shardSetPattern = Pattern.compile("([A-Z]+)(;fulltext)?(;([a-z]+):([^;]+))?(;([a-z]+):([^;]+))?");
|
||||
private static final Pattern shardSetPattern = Pattern.compile("([A-Z]+)(;fulltext)?(;([a-z]+):([^;]+))?(;([a-z]+):([^;]+))?");
|
||||
|
||||
private final ShardMethodEnum method;
|
||||
private final boolean hasContent;
|
||||
private final Map<String, String> config;
|
||||
private Integer hash;
|
||||
private transient Integer hash;
|
||||
|
||||
public ShardSet(Floc floc, ShardState anyShardNode) {
|
||||
this.method = floc.getShardMethod();
|
||||
@@ -38,7 +41,7 @@ public class ShardSet {
|
||||
}
|
||||
|
||||
public ShardSet(String shardSetSpec) {
|
||||
Matcher matcher = this.shardSetPattern.matcher(shardSetSpec);
|
||||
Matcher matcher = shardSetPattern.matcher(shardSetSpec);
|
||||
if (!matcher.find())
|
||||
throw new IllegalArgumentException("The shard set '" + shardSetSpec + "' is not properly formatted");
|
||||
|
||||
|
Reference in New Issue
Block a user