From 9680e1c13ea0ca92ccff513f369e0c4d2723a61b Mon Sep 17 00:00:00 2001 From: pahnjy Date: Mon, 16 Jan 2017 16:52:16 +0900 Subject: [PATCH] =?UTF-8?q?Log=20=EC=88=98=EC=A0=95=20#320?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/CompositeVirtualObject.java | 37 +++++++++++++++++- .../CompositeVirtualObjectPresentation.java | 2 +- ...CompositeVirtualObjectTransFormObject.java | 25 +++++++++++- .../CompositeVirtualObjectDataObject.java | 38 ++++++++++++++++++- .../CompositeVirtualObjectMongoStore.java | 4 +- .../so/device/pr/DevicePresentation.java | 13 +++++++ .../util/session/pr/SessionPresentation.java | 9 ++++- .../pr/VirtualObjectPresentation.java | 2 +- 8 files changed, 122 insertions(+), 8 deletions(-) diff --git a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/entity/CompositeVirtualObject.java b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/entity/CompositeVirtualObject.java index 6d430ea6..9853ff60 100644 --- a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/entity/CompositeVirtualObject.java +++ b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/entity/CompositeVirtualObject.java @@ -53,10 +53,25 @@ public class CompositeVirtualObject { */ private String description; + /** + * Composite VirtualObject의 기능 + * format : http://www.iotoasis.org/ontology/"functionality" + * ex) http://www.iotoasis.org/ontology/SwitchFunctionality + */ + private String functionality; + + /** + * Composite VirtualObject의 관점. + * format : http://www.iotoasis.org/ontology/"aspect" + * ex) http://www.iotoasis.org/ontology/luminosity-aspect + */ + private String aspect; + + public CompositeVirtualObject() { } - public CompositeVirtualObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description) { + public CompositeVirtualObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) { this.id = id; this.name = name; this.voIdList = voIdList; @@ -64,6 +79,8 @@ public CompositeVirtualObject(String id, String name, List voIdList, Str this.createTime = createTime; this.modifiedTime = modifiedTime; this.description = description; + this.functionality = functionality; + this.aspect = aspect; } public String getId() { @@ -122,6 +139,22 @@ public void setDescription(String description) { this.description = description; } + public String getFunctionality() { + return functionality; + } + + public void setFunctionality(String functionality) { + this.functionality = functionality; + } + + public String getAspect() { + return aspect; + } + + public void setAspect(String aspect) { + this.aspect = aspect; + } + @Override public String toString() { return "CompositeVirtualObject{" + @@ -132,6 +165,8 @@ public String toString() { ", createTime='" + createTime + '\'' + ", modifiedTime='" + modifiedTime + '\'' + ", description='" + description + '\'' + + ", functionality='" + functionality + '\'' + + ", aspect='" + aspect + '\'' + '}'; } } diff --git a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectPresentation.java b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectPresentation.java index 90f1edd5..7371990d 100644 --- a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectPresentation.java +++ b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectPresentation.java @@ -88,7 +88,7 @@ public void controlCompostieVirtualObject(@RequestBody VirtualObjectControlData private CompositeVirtualObject compositeVirtualObjectMapping(CompositeVirtualObjectTransFormObject compositeVirtualObjectDataObject){ if(compositeVirtualObjectDataObject == null) return null; - CompositeVirtualObject compositeVirtualObject = new CompositeVirtualObject(compositeVirtualObjectDataObject.getId(), compositeVirtualObjectDataObject.getName(), compositeVirtualObjectDataObject.getVoIdList(), compositeVirtualObjectDataObject.getLocation(), compositeVirtualObjectDataObject.getCreateTime(), compositeVirtualObjectDataObject.getModifiedTime(), compositeVirtualObjectDataObject.getDescription()); + CompositeVirtualObject compositeVirtualObject = new CompositeVirtualObject(compositeVirtualObjectDataObject.getId(),compositeVirtualObjectDataObject.getName(),compositeVirtualObjectDataObject.getVoIdList(),compositeVirtualObjectDataObject.getAspect(),compositeVirtualObjectDataObject.getCreateTime(),compositeVirtualObjectDataObject.getModifiedTime(),compositeVirtualObjectDataObject.getDescription(),compositeVirtualObjectDataObject.getFunctionality(),compositeVirtualObjectDataObject.getAspect()); if(!compositeVirtualObject.getId().startsWith(CompositeProfile.COMPOSITE_ID)){ String cvoId = compositeVirtualObject.getId(); compositeVirtualObject.setId(CompositeProfile.COMPOSITE_ID + cvoId); diff --git a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectTransFormObject.java b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectTransFormObject.java index c04e4a21..effcb50e 100644 --- a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectTransFormObject.java +++ b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/pr/CompositeVirtualObjectTransFormObject.java @@ -11,11 +11,14 @@ public class CompositeVirtualObjectTransFormObject { private String createTime; private String modifiedTime; private String description; + private String functionality; + private String aspect; + public CompositeVirtualObjectTransFormObject() { } - public CompositeVirtualObjectTransFormObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description) { + public CompositeVirtualObjectTransFormObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) { this.id = id; this.name = name; this.voIdList = voIdList; @@ -23,6 +26,8 @@ public CompositeVirtualObjectTransFormObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description) { + public CompositeVirtualObjectDataObject(String id, String name, List voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) { this.id = id; this.name = name; this.voIdList = voIdList; @@ -26,6 +29,8 @@ public CompositeVirtualObjectDataObject(String id, String name, List voI this.createTime = createTime; this.modifiedTime = modifiedTime; this.description = description; + this.functionality = functionality; + this.aspect = aspect; } public String getId() { @@ -83,4 +88,35 @@ public String getDescription() { public void setDescription(String description) { this.description = description; } + + public String getFunctionality() { + return functionality; + } + + public void setFunctionality(String functionality) { + this.functionality = functionality; + } + + public String getAspect() { + return aspect; + } + + public void setAspect(String aspect) { + this.aspect = aspect; + } + + @Override + public String toString() { + return "CompositeVirtualObject{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + ", voIdList=" + voIdList + + ", location='" + location + '\'' + + ", createTime='" + createTime + '\'' + + ", modifiedTime='" + modifiedTime + '\'' + + ", description='" + description + '\'' + + ", functionality='" + functionality + '\'' + + ", aspect='" + aspect + '\'' + + '}'; + } } diff --git a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/store/mongo/CompositeVirtualObjectMongoStore.java b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/store/mongo/CompositeVirtualObjectMongoStore.java index 7e2749f6..9bb1cb84 100644 --- a/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/store/mongo/CompositeVirtualObjectMongoStore.java +++ b/so-compositevirtualobject/src/main/java/com/pineone/icbms/so/compositevo/store/mongo/CompositeVirtualObjectMongoStore.java @@ -63,11 +63,11 @@ public void delete(String id) { private CompositeVirtualObjectDataObject CompositeVirtualObjectToDataObject(CompositeVirtualObject compositeVirtualObject){ if(compositeVirtualObject == null) return null; - return new CompositeVirtualObjectDataObject(compositeVirtualObject.getId(),compositeVirtualObject.getName(),compositeVirtualObject.getVoIdList(),compositeVirtualObject.getLocation(),compositeVirtualObject.getCreateTime(),compositeVirtualObject.getModifiedTime(),compositeVirtualObject.getDescription()); + return new CompositeVirtualObjectDataObject(compositeVirtualObject.getId(),compositeVirtualObject.getName(),compositeVirtualObject.getVoIdList(),compositeVirtualObject.getLocation(),compositeVirtualObject.getCreateTime(),compositeVirtualObject.getModifiedTime(),compositeVirtualObject.getDescription(),compositeVirtualObject.getCreateTime(),compositeVirtualObject.getCreateTime()); } private CompositeVirtualObject CompositeVirtualObjectDataObjectToCVO(CompositeVirtualObjectDataObject dataObject){ if(dataObject == null) return null; - return new CompositeVirtualObject(dataObject.getId(),dataObject.getName(),dataObject.getVoIdList(),dataObject.getLocation(),dataObject.getCreateTime(),dataObject.getModifiedTime(),dataObject.getDescription()); + return new CompositeVirtualObject(dataObject.getId(),dataObject.getName(),dataObject.getVoIdList(),dataObject.getLocation(),dataObject.getCreateTime(),dataObject.getModifiedTime(),dataObject.getDescription(),dataObject.getCreateTime(),dataObject.getCreateTime()); } } diff --git a/so-device/src/main/java/com/pineone/icbms/so/device/pr/DevicePresentation.java b/so-device/src/main/java/com/pineone/icbms/so/device/pr/DevicePresentation.java index b8eb2182..321b26a2 100644 --- a/so-device/src/main/java/com/pineone/icbms/so/device/pr/DevicePresentation.java +++ b/so-device/src/main/java/com/pineone/icbms/so/device/pr/DevicePresentation.java @@ -82,6 +82,19 @@ public List findDeviceList(){ return deviceList; } + /** + * Device 검색. By ID + */ + @RequestMapping(value = "/search",method = RequestMethod.POST) + @ResponseStatus(value = HttpStatus.OK) + public Device findDeviceById1(@RequestBody DeviceTransFormObject deviceTransFormObject){ + // Search Device By Id + logger.info(LogPrint.inputInfoLogPrint() + "DeviceID = " + deviceTransFormObject.getId()); + Device device = deviceManager.deviceSearchById(deviceTransFormObject.getId()); + return device; + } + + /** * Device 검색. By ID */ diff --git a/so-util/src/main/java/com/pineone/icbms/so/util/session/pr/SessionPresentation.java b/so-util/src/main/java/com/pineone/icbms/so/util/session/pr/SessionPresentation.java index 829eec96..e1321a99 100644 --- a/so-util/src/main/java/com/pineone/icbms/so/util/session/pr/SessionPresentation.java +++ b/so-util/src/main/java/com/pineone/icbms/so/util/session/pr/SessionPresentation.java @@ -1,7 +1,10 @@ package com.pineone.icbms.so.util.session.pr; +import com.pineone.icbms.so.util.logprint.LogPrint; import com.pineone.icbms.so.util.session.Session; import com.pineone.icbms.so.util.session.store.SessionStore; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -21,6 +24,8 @@ public class SessionPresentation { @Autowired SessionStore sessionStore; + public static final Logger logger = LoggerFactory.getLogger(SessionPresentation.class); + @RequestMapping(value = "/{number}", method = RequestMethod.GET) @ResponseStatus(value = HttpStatus.OK) public List retrieveSessionData(@PathVariable int number){ @@ -38,7 +43,9 @@ public List retrieveSessionDataByTime(@PathVariable int time){ @RequestMapping(value = "/collection/{id}") @ResponseStatus(value = HttpStatus.OK) public Session retrieveSessionDetail(@PathVariable String id){ - return sessionStore.retrieveSessionDetail(id); + Session session = sessionStore.retrieveSessionDetail(id); + logger.info(LogPrint.inputInfoLogPrint() + "Session = " + session.toString()); + return session; } diff --git a/so-virtualobject/src/main/java/com/pineone/icbms/so/virtualobject/pr/VirtualObjectPresentation.java b/so-virtualobject/src/main/java/com/pineone/icbms/so/virtualobject/pr/VirtualObjectPresentation.java index 9243a733..e12c6ef1 100644 --- a/so-virtualobject/src/main/java/com/pineone/icbms/so/virtualobject/pr/VirtualObjectPresentation.java +++ b/so-virtualobject/src/main/java/com/pineone/icbms/so/virtualobject/pr/VirtualObjectPresentation.java @@ -42,7 +42,7 @@ public void createVirtualObject(@RequestBody VirtualObjectTransFormObject virtul @RequestMapping(value = "/control",method = RequestMethod.POST) @ResponseStatus(HttpStatus.OK) public String requestControlVirtualObject(@RequestBody VirtualObjectTransFormObject virtualObjectTransFormObject){ - logger.info(LogPrint.inputInfoLogPrint()); + logger.info(LogPrint.inputInfoLogPrint() + "virtualobjectID = " + virtualObjectTransFormObject.getId() + " Command = "+ virtualObjectTransFormObject.getVoCommand()); // return virtualObjectManager.requestControlDevice(virtualObjectTransFormObject.getId(), virtualObjectTransFormObject.getVoCommand(), virtualObjectTransFormObject.getSessionId()); }