diff --git a/CHANGELOG.md b/CHANGELOG.md
index 241271cc2..d34250f9c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+##1.4.5
+BUG FIXES:
+* Fixed about Executing Cell Recursive Delete API does not delete OData in cell. ([#13](https://github.com/personium/personium-core/issues/13))
+
## 1.4.4
MODIFICATIONS FOR RELIABILITY:
diff --git a/pom.xml b/pom.xml
index d9cef2897..330fdbbb7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
io.personium
personium-core
war
- 1.4.4
+ 1.4.5
personium-core Maven Webapp
http://maven.apache.org
@@ -26,7 +26,7 @@
io.personium
personium-lib-es-adapter
- 1.4.2
+ 1.4.3
io.personium
diff --git a/src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java b/src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java
deleted file mode 100644
index 3be30306d..000000000
--- a/src/main/java/io/personium/core/model/impl/es/BoxCmpEsImpl.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * personium.io
- * Copyright 2014 FUJITSU LIMITED
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.personium.core.model.impl.es;
-
-import org.apache.wink.webdav.model.ObjectFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import io.personium.core.PersoniumCoreException;
-import io.personium.core.model.Box;
-import io.personium.core.model.BoxCmp;
-import io.personium.core.model.DavCmp;
-import io.personium.core.model.impl.es.accessor.DavNodeAccessor;
-
-/**
- * Boxに対応した処理を扱う部品のESを使った実装.
- */
-public class BoxCmpEsImpl extends DavCmpEsImpl implements BoxCmp {
- DavNodeAccessor esCol;
-
- /**
- * ログ.
- */
- static Logger log = LoggerFactory.getLogger(BoxCmpEsImpl.class);
-
- /**
- * コンストラクタ.
- * @param box Boxオブジェクト
- */
- public BoxCmpEsImpl(final Box box) {
- this.of = new ObjectFactory();
- this.box = box;
- this.cell = box.getCell();
- this.esCol = EsModel.col(box.getCell());
- this.nodeId = this.box.getId();
- try {
- // nodeIDを元に管理データをDBからロードする
- this.load();
- } catch (Exception e) {
- log.debug("Exception occured. Maybe Dav index is not present so creating..");
- }
-
- if (this.davNode == null) {
- // 管理データのロードに失敗した場合(col.boxが存在しない場合)はcol.box情報を作成する
- this.createRootDoc();
- }
- }
-
- @Override
- public final DavNodeAccessor getEsColType() {
- return this.esCol;
- }
-
- @Override
- public String getUrl() {
- return this.cell.getUrl() + this.box.getName();
- }
-
- private void createRootDoc() {
- this.davNode = new DavNode(this.cell.getId(), this.box.getId(), DavCmp.TYPE_COL_BOX);
- this.esCol.create(this.box.getId(), this.davNode);
- }
-
- @Override
- public PersoniumCoreException getNotFoundException() {
- return PersoniumCoreException.Dav.BOX_NOT_FOUND;
- }
-}
diff --git a/src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java b/src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java
deleted file mode 100644
index eed786249..000000000
--- a/src/main/java/io/personium/core/model/impl/es/CellCmpEsImpl.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * personium.io
- * Copyright 2014 FUJITSU LIMITED
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.personium.core.model.impl.es;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.wink.webdav.model.ObjectFactory;
-import org.json.simple.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import io.personium.common.es.response.PersoniumGetResponse;
-import io.personium.common.es.response.PersoniumIndexResponse;
-import io.personium.common.es.response.PersoniumSearchResponse;
-import io.personium.core.PersoniumCoreException;
-import io.personium.core.model.Cell;
-import io.personium.core.model.CellCmp;
-import io.personium.core.model.impl.es.accessor.EntitySetAccessor;
-import io.personium.core.model.impl.es.cache.CellCache;
-import io.personium.core.model.impl.es.doc.CellDocHandler;
-import io.personium.core.model.lock.Lock;
-import io.personium.core.model.lock.LockManager;
-
-/**
- * Cellに対応した処理を扱う部品のESを使った実装.
- */
-public class CellCmpEsImpl extends DavCmpEsImpl implements CellCmp {
- EntitySetAccessor cellAcceccor;
-
- /**
- * ログ.
- */
- static Logger log = LoggerFactory.getLogger(CellCmpEsImpl.class);
-
- CellDocHandler docHandler;
-
- /**
- * コンストラクタ.
- * @param cell ellオブジェクト
- */
- public CellCmpEsImpl(final Cell cell) {
- this.of = new ObjectFactory();
- this.cell = cell;
- this.cellAcceccor = EsModel.cell();
- this.nodeId = cell.getId();
- this.docHandler = new CellDocHandler(getNode());
-
- try {
- this.load();
- } catch (Exception e) {
- log.debug("Exception occured. Maybe Dav index is not present so creating..");
- }
-
- }
-
- /**
- * CellEntityのアクセッサーを取得する.
- * @return cellAcceccor
- */
- private EntitySetAccessor getCellAccessor() {
- return this.cellAcceccor;
- }
-
- /**
- * Nodeのデータを取得する.
- * @return Node取得結果
- */
- @Override
- public PersoniumGetResponse getNode() {
- PersoniumGetResponse res = this.getCellAccessor().get(this.nodeId);
- return res;
- }
-
- /**
- * バージョン指定でNodeの情報を更新する.
- * @return 更新結果.
- */
- @Override
- public PersoniumIndexResponse updateNodeWithVersion() {
- PersoniumIndexResponse resp;
- try {
- resp = this.getCellAccessor().update(this.nodeId, this.docHandler, this.version);
- } finally {
- CellCache.clear(this.cell.getName());
- }
- return resp;
- }
-
- /**
- * Nodeの情報を更新する.
- * @return 更新結果.
- */
- @Override
- public PersoniumIndexResponse updateNode() {
- PersoniumIndexResponse resp;
- try {
- resp = this.getCellAccessor().update(this.nodeId, this.docHandler);
- } finally {
- CellCache.clear(this.cell.getName());
- }
- return resp;
- }
-
- /**
- * Node情報を作成する.
- * @return 作成結果
- */
- @Override
- public PersoniumIndexResponse createNode() {
- PersoniumIndexResponse res;
- res = this.getCellAccessor().create(this.docHandler);
- return res;
- }
-
- /**
- * Nodeを削除する.
- */
- public void deleteNode() {
- try {
- this.getCellAccessor().delete(this.docHandler);
- } finally {
- CellCache.clear(this.cell.getName());
- }
- }
- @Override
- public void makeEmpty() {
- // TODO Impl
- }
- /**
- * 子リソースの情報を取得する.
- * @return 子リソースの検索結果
- */
- @Override
- public PersoniumSearchResponse getChildResource() {
- // 子リソースの情報を取得する。
- Map query = new HashMap();
- Map query2 = new HashMap();
- Map query3 = new HashMap();
- query3.put(DavNode.KEY_PARENT, this.nodeId);
- query2.put("term", query3);
- query.put("query", query2);
-
- PersoniumSearchResponse resp = this.getCellAccessor().search(query);
- return resp;
- }
-
- /**
- * jsonにACL情報を設定する.
- * @param aclJson ACL
- */
- @SuppressWarnings("unchecked")
- @Override
- protected void setAclToJson(JSONObject aclJson) {
- this.docHandler.setAclFields(aclJson);
- }
-
- /**
- * jsonにProp情報を設定する.
- * @param propsJson Prop
- */
- protected void setPropToJson(Map propsJson) {
- this.docHandler.setDynamicFields(propsJson);
- }
-
- /**
- * Cellをロックする.
- * @return 自ノードのロック
- */
- @Override
- public Lock lock() {
- return LockManager.getLock(Lock.CATEGORY_CELL, this.cell.getId(), null, null);
- }
-
- @Override
- public PersoniumCoreException getNotFoundException() {
- return PersoniumCoreException.Dav.CELL_NOT_FOUND;
- }
-}
diff --git a/src/main/java/io/personium/core/model/impl/es/DavNode.java b/src/main/java/io/personium/core/model/impl/es/DavNode.java
index 64c4ad0f0..e1fca762f 100644
--- a/src/main/java/io/personium/core/model/impl/es/DavNode.java
+++ b/src/main/java/io/personium/core/model/impl/es/DavNode.java
@@ -43,7 +43,7 @@ public class DavNode implements EsBulkRequest {
long published;
long updated;
Map file;
- private BULK_REQUEST_TYPE requestType = BULK_REQUEST_TYPE.INDEX;
+ private BulkRequestType requestType = BulkRequestType.INDEX;
/** ES上のDavNode格納においてCellの内部IDを保存するJSONキー. */
public static final String KEY_CELL_ID = "c";
@@ -335,7 +335,7 @@ public String getType() {
}
@Override
- public BULK_REQUEST_TYPE getRequestType() {
+ public BulkRequestType getRequestType() {
return requestType;
}
@@ -344,7 +344,7 @@ public BULK_REQUEST_TYPE getRequestType() {
* 既存の処理への影響を考慮して、デフォルト値は INDEX にしておく。
* @param request リクエスト種別
*/
- public void setRequestType(BULK_REQUEST_TYPE request) {
+ public void setRequestType(BulkRequestType request) {
this.requestType = request;
}
}
diff --git a/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java b/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java
index 2770b2a86..fb0642d61 100644
--- a/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java
+++ b/src/main/java/io/personium/core/model/impl/es/accessor/DavMoveAccessor.java
@@ -23,7 +23,7 @@
import io.personium.common.ads.AdsWriteFailureLogInfo;
import io.personium.common.es.EsBulkRequest;
-import io.personium.common.es.EsBulkRequest.BULK_REQUEST_TYPE;
+import io.personium.common.es.EsBulkRequest.BulkRequestType;
import io.personium.common.es.EsIndex;
import io.personium.common.es.response.PersoniumBulkItemResponse;
import io.personium.common.es.response.PersoniumBulkResponse;
@@ -176,7 +176,7 @@ public void setMoveRequest(
}
// 移動先のDavNodeが存在する場合は、そのDavNodeを削除する(ファイル実体は含まない)。
if (null != dstNode) {
- dstNode.setRequestType(EsBulkRequest.BULK_REQUEST_TYPE.DELETE);
+ dstNode.setRequestType(EsBulkRequest.BulkRequestType.DELETE);
adsBulkRequest.add(dstNode);
esBulkRequest.add(dstNode);
setDestinationNodeForRollback(dstNode);
@@ -219,7 +219,7 @@ private PersoniumBulkResponse adsMove(PersoniumBulkResponse response) {
int i;
for (i = 0; i < esBulkRequest.size(); i++) {
EsBulkRequest esReq = esBulkRequest.get(i);
- if (BULK_REQUEST_TYPE.DELETE != esReq.getRequestType()) {
+ if (BulkRequestType.DELETE != esReq.getRequestType()) {
adsUpdateBulkRequest.add(adsBulkRequest.get(i));
} else {
// Davテーブル一括更新
diff --git a/src/main/java/io/personium/core/rs/odata/BulkRequest.java b/src/main/java/io/personium/core/rs/odata/BulkRequest.java
index 26555b82f..ed35fee2d 100644
--- a/src/main/java/io/personium/core/rs/odata/BulkRequest.java
+++ b/src/main/java/io/personium/core/rs/odata/BulkRequest.java
@@ -134,8 +134,8 @@ public void setError(Exception error) {
}
@Override
- public BULK_REQUEST_TYPE getRequestType() {
- return BULK_REQUEST_TYPE.INDEX;
+ public BulkRequestType getRequestType() {
+ return BulkRequestType.INDEX;
}
}
diff --git a/src/main/resources/personium-unit-config-default.properties b/src/main/resources/personium-unit-config-default.properties
index af9f9cf44..06e01ae91 100644
--- a/src/main/resources/personium-unit-config-default.properties
+++ b/src/main/resources/personium-unit-config-default.properties
@@ -23,7 +23,7 @@
#################################################
# core version
-io.personium.core.version=1.4.4
+io.personium.core.version=1.4.5
# general configurations
io.personium.core.unitUser.issuers=
diff --git a/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java b/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java
index 841f43888..91f25f9f3 100644
--- a/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java
+++ b/src/test/java/io/personium/test/jersey/cell/CellBulkDeletionTest.java
@@ -95,12 +95,16 @@ public void Before() {
CellUtils.create(cellName, MASTER_TOKEN_NAME, -1);
// イベントログを出力する
- Map body = new HashMap();
- body.put("level", "INFO");
- body.put("action", "POST");
- body.put("object", "ObjectData");
- body.put("result", "resultData");
- CellUtils.event(MASTER_TOKEN_NAME, -1, cellName, JSONObject.toJSONString(body));
+ String os = System.getProperty("os.name").toLowerCase();
+ // Windowsはプロセスの関係でイベントログが消せない為イベントログを作成しない
+ if (!os.contains("windows")) {
+ Map body = new HashMap();
+ body.put("level", "INFO");
+ body.put("action", "POST");
+ body.put("object", "ObjectData");
+ body.put("result", "resultData");
+ CellUtils.event(MASTER_TOKEN_NAME, -1, cellName, JSONObject.toJSONString(body));
+ }
// ボックスを作成する
BoxUtils.create(cellName, boxName, MASTER_TOKEN_NAME, -1);
@@ -208,6 +212,12 @@ public void Before() {
// セル削除APIを実行して、204が返却されることを確認
PersoniumResponse response = request(request);
assertEquals(HttpStatus.SC_NO_CONTENT, response.getStatusCode());
+ // スレッドで非同期で削除しているため、3秒スリープする
+ try {
+ Thread.sleep(3000);
+ } catch (InterruptedException e) {
+ System.out.println("");
+ }
}
/**