diff --git a/src/main/java/org/codelibs/fess/es/config/allcommon/EsAbstractBehavior.java b/src/main/java/org/codelibs/fess/es/config/allcommon/EsAbstractBehavior.java index aebf49386..595e3a6d0 100644 --- a/src/main/java/org/codelibs/fess/es/config/allcommon/EsAbstractBehavior.java +++ b/src/main/java/org/codelibs/fess/es/config/allcommon/EsAbstractBehavior.java @@ -361,16 +361,27 @@ public abstract class EsAbstractBehavior int[] delegateBatchRequest(final List entityList, Function call) { - final BulkList bulkList = (BulkList) entityList; + @SuppressWarnings("unchecked") + final BulkList bulkList = (BulkList) entityList; + final RequestOptionCall builderEntityCall = bulkList.getEntityCall(); final BulkRequestBuilder bulkBuilder = client.prepareBulk(); for (final Entity entity : entityList) { final EsAbstractEntity esEntity = (EsAbstractEntity) entity; BUILDER builder = call.apply(esEntity); if (builder instanceof IndexRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((IndexRequestBuilder) builder); } else if (builder instanceof UpdateRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((UpdateRequestBuilder) builder); } else if (builder instanceof DeleteRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((DeleteRequestBuilder) builder); } } @@ -424,14 +435,17 @@ public abstract class EsAbstractBehavior implements List { + public static class BulkList implements List { private final List parent; private final RequestOptionCall call; - public BulkList(final List parent, final RequestOptionCall call) { + private final RequestOptionCall entityCall; + + public BulkList(final List parent, final RequestOptionCall call, final RequestOptionCall entityCall) { this.parent = parent; + this.entityCall = entityCall; this.call = call; } @@ -538,5 +552,9 @@ public abstract class EsAbstractBehavior getCall() { return call; } + + public RequestOptionCall getEntityCall() { + return entityCall; + } } } diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBadWordBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBadWordBhv.java index ef2d22ecf..4e5049e21 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBadWordBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBadWordBhv.java @@ -226,27 +226,42 @@ public abstract class BsBadWordBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBoostDocumentRuleBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBoostDocumentRuleBhv.java index 24bfcfc92..a5244da53 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBoostDocumentRuleBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsBoostDocumentRuleBhv.java @@ -227,27 +227,42 @@ public abstract class BsBoostDocumentRuleBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoBhv.java index c7c993b49..e7359ad9a 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoBhv.java @@ -223,27 +223,42 @@ public abstract class BsCrawlingInfoBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoParamBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoParamBhv.java index 951af51c4..41ddd49c3 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoParamBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsCrawlingInfoParamBhv.java @@ -224,27 +224,42 @@ public abstract class BsCrawlingInfoParamBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigBhv.java index ccf95c26b..6d2a66237 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigBhv.java @@ -230,27 +230,42 @@ public abstract class BsDataConfigBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToLabelBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToLabelBhv.java index a8b857e62..b9074f2bd 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToLabelBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToLabelBhv.java @@ -222,27 +222,42 @@ public abstract class BsDataConfigToLabelBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToRoleBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToRoleBhv.java index 3324e475e..754666745 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToRoleBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDataConfigToRoleBhv.java @@ -222,27 +222,42 @@ public abstract class BsDataConfigToRoleBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDuplicateHostBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDuplicateHostBhv.java index 1cc9e62af..46f92cde7 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDuplicateHostBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsDuplicateHostBhv.java @@ -226,27 +226,42 @@ public abstract class BsDuplicateHostBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordBhv.java index 8f3dedd84..9d1e50907 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordBhv.java @@ -228,27 +228,42 @@ public abstract class BsElevateWordBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordToLabelBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordToLabelBhv.java index c508738e1..66d59d7a4 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordToLabelBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsElevateWordToLabelBhv.java @@ -222,27 +222,42 @@ public abstract class BsElevateWordToLabelBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFailureUrlBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFailureUrlBhv.java index c6f35f015..ded6e43f2 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFailureUrlBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFailureUrlBhv.java @@ -226,27 +226,42 @@ public abstract class BsFailureUrlBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileAuthenticationBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileAuthenticationBhv.java index 427ee5ec7..190ba5826 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileAuthenticationBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileAuthenticationBhv.java @@ -231,27 +231,42 @@ public abstract class BsFileAuthenticationBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigBhv.java index 1255e4e3f..b8a001570 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigBhv.java @@ -238,27 +238,42 @@ public abstract class BsFileConfigBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToLabelBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToLabelBhv.java index 00673fceb..273daea69 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToLabelBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToLabelBhv.java @@ -222,27 +222,42 @@ public abstract class BsFileConfigToLabelBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToRoleBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToRoleBhv.java index 440375a7a..59ceab5df 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToRoleBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsFileConfigToRoleBhv.java @@ -222,27 +222,42 @@ public abstract class BsFileConfigToRoleBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsJobLogBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsJobLogBhv.java index 8d8973459..4893c89ed 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsJobLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsJobLogBhv.java @@ -227,27 +227,42 @@ public abstract class BsJobLogBhv extends EsAbstractBehavior { } public int[] batchInsert(List list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsKeyMatchBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsKeyMatchBhv.java index 58b062aa2..38fb47037 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsKeyMatchBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsKeyMatchBhv.java @@ -227,27 +227,42 @@ public abstract class BsKeyMatchBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelToRoleBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelToRoleBhv.java index 299e2a037..06bf5345b 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelToRoleBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelToRoleBhv.java @@ -221,27 +221,42 @@ public abstract class BsLabelToRoleBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelTypeBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelTypeBhv.java index bb73b99f6..07f1cf6e7 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelTypeBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsLabelTypeBhv.java @@ -228,27 +228,42 @@ public abstract class BsLabelTypeBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsPathMappingBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsPathMappingBhv.java index cafc2dad5..13d650a0f 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsPathMappingBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsPathMappingBhv.java @@ -227,27 +227,42 @@ public abstract class BsPathMappingBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRequestHeaderBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRequestHeaderBhv.java index 922b605e3..99e493043 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRequestHeaderBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRequestHeaderBhv.java @@ -226,27 +226,42 @@ public abstract class BsRequestHeaderBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRoleTypeBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRoleTypeBhv.java index d51a6b304..1797f3e3c 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRoleTypeBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsRoleTypeBhv.java @@ -226,27 +226,42 @@ public abstract class BsRoleTypeBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsScheduledJobBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsScheduledJobBhv.java index 7008843be..60c1e80ee 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsScheduledJobBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsScheduledJobBhv.java @@ -232,27 +232,42 @@ public abstract class BsScheduledJobBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebAuthenticationBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebAuthenticationBhv.java index 964e17c4d..3e7cb1be6 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebAuthenticationBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebAuthenticationBhv.java @@ -232,27 +232,42 @@ public abstract class BsWebAuthenticationBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigBhv.java index 1c5b26120..d0e1e18eb 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigBhv.java @@ -239,27 +239,42 @@ public abstract class BsWebConfigBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToLabelBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToLabelBhv.java index 51d84564e..05ac4a9a1 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToLabelBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToLabelBhv.java @@ -222,27 +222,42 @@ public abstract class BsWebConfigToLabelBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToRoleBhv.java b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToRoleBhv.java index ba2b7d313..5d4b5c0ec 100644 --- a/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToRoleBhv.java +++ b/src/main/java/org/codelibs/fess/es/config/bsbhv/BsWebConfigToRoleBhv.java @@ -222,27 +222,42 @@ public abstract class BsWebConfigToRoleBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/allcommon/EsAbstractBehavior.java b/src/main/java/org/codelibs/fess/es/log/allcommon/EsAbstractBehavior.java index 61e29b917..818e1172f 100644 --- a/src/main/java/org/codelibs/fess/es/log/allcommon/EsAbstractBehavior.java +++ b/src/main/java/org/codelibs/fess/es/log/allcommon/EsAbstractBehavior.java @@ -361,16 +361,27 @@ public abstract class EsAbstractBehavior int[] delegateBatchRequest(final List entityList, Function call) { - final BulkList bulkList = (BulkList) entityList; + @SuppressWarnings("unchecked") + final BulkList bulkList = (BulkList) entityList; + final RequestOptionCall builderEntityCall = bulkList.getEntityCall(); final BulkRequestBuilder bulkBuilder = client.prepareBulk(); for (final Entity entity : entityList) { final EsAbstractEntity esEntity = (EsAbstractEntity) entity; BUILDER builder = call.apply(esEntity); if (builder instanceof IndexRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((IndexRequestBuilder) builder); } else if (builder instanceof UpdateRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((UpdateRequestBuilder) builder); } else if (builder instanceof DeleteRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((DeleteRequestBuilder) builder); } } @@ -424,14 +435,17 @@ public abstract class EsAbstractBehavior implements List { + public static class BulkList implements List { private final List parent; private final RequestOptionCall call; - public BulkList(final List parent, final RequestOptionCall call) { + private final RequestOptionCall entityCall; + + public BulkList(final List parent, final RequestOptionCall call, final RequestOptionCall entityCall) { this.parent = parent; + this.entityCall = entityCall; this.call = call; } @@ -538,5 +552,9 @@ public abstract class EsAbstractBehavior getCall() { return call; } + + public RequestOptionCall getEntityCall() { + return entityCall; + } } } diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsClickLogBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsClickLogBhv.java index 0ddc3779a..b88cdbae6 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsClickLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsClickLogBhv.java @@ -226,27 +226,42 @@ public abstract class BsClickLogBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsEventLogBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsEventLogBhv.java index 7c8f1e173..d3a4e01dd 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsEventLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsEventLogBhv.java @@ -224,27 +224,42 @@ public abstract class BsEventLogBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsFavoriteLogBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsFavoriteLogBhv.java index 5c7c0ec33..518c2066f 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsFavoriteLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsFavoriteLogBhv.java @@ -224,27 +224,42 @@ public abstract class BsFavoriteLogBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchFieldLogBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchFieldLogBhv.java index d6b5e44f7..d15d5d7b3 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchFieldLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchFieldLogBhv.java @@ -222,27 +222,42 @@ public abstract class BsSearchFieldLogBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchLogBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchLogBhv.java index 9e16ea3d2..72807d150 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchLogBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsSearchLogBhv.java @@ -235,27 +235,42 @@ public abstract class BsSearchLogBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsUserInfoBhv.java b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsUserInfoBhv.java index b2b1af492..7c2484278 100644 --- a/src/main/java/org/codelibs/fess/es/log/bsbhv/BsUserInfoBhv.java +++ b/src/main/java/org/codelibs/fess/es/log/bsbhv/BsUserInfoBhv.java @@ -221,27 +221,42 @@ public abstract class BsUserInfoBhv extends EsAbstractBehavior list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, + RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/user/allcommon/EsAbstractBehavior.java b/src/main/java/org/codelibs/fess/es/user/allcommon/EsAbstractBehavior.java index d7526854c..62eff78c6 100644 --- a/src/main/java/org/codelibs/fess/es/user/allcommon/EsAbstractBehavior.java +++ b/src/main/java/org/codelibs/fess/es/user/allcommon/EsAbstractBehavior.java @@ -361,16 +361,27 @@ public abstract class EsAbstractBehavior int[] delegateBatchRequest(final List entityList, Function call) { - final BulkList bulkList = (BulkList) entityList; + @SuppressWarnings("unchecked") + final BulkList bulkList = (BulkList) entityList; + final RequestOptionCall builderEntityCall = bulkList.getEntityCall(); final BulkRequestBuilder bulkBuilder = client.prepareBulk(); for (final Entity entity : entityList) { final EsAbstractEntity esEntity = (EsAbstractEntity) entity; BUILDER builder = call.apply(esEntity); if (builder instanceof IndexRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((IndexRequestBuilder) builder); } else if (builder instanceof UpdateRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((UpdateRequestBuilder) builder); } else if (builder instanceof DeleteRequestBuilder) { + if (builderEntityCall != null) { + builderEntityCall.callback(builder); + } bulkBuilder.add((DeleteRequestBuilder) builder); } } @@ -424,14 +435,17 @@ public abstract class EsAbstractBehavior implements List { + public static class BulkList implements List { private final List parent; private final RequestOptionCall call; - public BulkList(final List parent, final RequestOptionCall call) { + private final RequestOptionCall entityCall; + + public BulkList(final List parent, final RequestOptionCall call, final RequestOptionCall entityCall) { this.parent = parent; + this.entityCall = entityCall; this.call = call; } @@ -538,5 +552,9 @@ public abstract class EsAbstractBehavior getCall() { return call; } + + public RequestOptionCall getEntityCall() { + return entityCall; + } } } diff --git a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsGroupBhv.java b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsGroupBhv.java index ad65e64fa..95ef3bf42 100644 --- a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsGroupBhv.java +++ b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsGroupBhv.java @@ -220,27 +220,39 @@ public abstract class BsGroupBhv extends EsAbstractBehavior { } public int[] batchInsert(List list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsRoleBhv.java b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsRoleBhv.java index ce1f91d05..f05a45f1c 100644 --- a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsRoleBhv.java +++ b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsRoleBhv.java @@ -220,27 +220,39 @@ public abstract class BsRoleBhv extends EsAbstractBehavior { } public int[] batchInsert(List list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove diff --git a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsUserBhv.java b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsUserBhv.java index 9e4678910..087139b14 100644 --- a/src/main/java/org/codelibs/fess/es/user/bsbhv/BsUserBhv.java +++ b/src/main/java/org/codelibs/fess/es/user/bsbhv/BsUserBhv.java @@ -223,27 +223,39 @@ public abstract class BsUserBhv extends EsAbstractBehavior { } public int[] batchInsert(List list) { - return batchInsert(list, null); + return batchInsert(list, null, null); } public int[] batchInsert(List list, RequestOptionCall call) { - return doBatchInsert(new BulkList<>(list, call), null); + return batchInsert(list, call, null); + } + + public int[] batchInsert(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchInsert(new BulkList<>(list, call, entityCall), null); } public int[] batchUpdate(List list) { - return batchUpdate(list, null); + return batchUpdate(list, null, null); } public int[] batchUpdate(List list, RequestOptionCall call) { - return doBatchUpdate(new BulkList<>(list, call), null); + return batchUpdate(list, call, null); + } + + public int[] batchUpdate(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchUpdate(new BulkList<>(list, call, entityCall), null); } public int[] batchDelete(List list) { - return batchDelete(list, null); + return batchDelete(list, null, null); } public int[] batchDelete(List list, RequestOptionCall call) { - return doBatchDelete(new BulkList<>(list, call), null); + return batchDelete(list, call, null); + } + + public int[] batchDelete(List list, RequestOptionCall call, RequestOptionCall entityCall) { + return doBatchDelete(new BulkList<>(list, call, entityCall), null); } // #pending create, modify, remove