Skip to content

Commit

Permalink
Merge pull request #330 from pahnjy/develop
Browse files Browse the repository at this point in the history
Log 수정 #320
  • Loading branch information
pahnjy authored Jan 16, 2017
2 parents 00758a0 + 9680e1c commit a55418a
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,34 @@ 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<String> voIdList, String location, String createTime, String modifiedTime, String description) {
public CompositeVirtualObject(String id, String name, List<String> voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) {
this.id = id;
this.name = name;
this.voIdList = voIdList;
this.location = location;
this.createTime = createTime;
this.modifiedTime = modifiedTime;
this.description = description;
this.functionality = functionality;
this.aspect = aspect;
}

public String getId() {
Expand Down Expand Up @@ -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{" +
Expand All @@ -132,6 +165,8 @@ public String toString() {
", createTime='" + createTime + '\'' +
", modifiedTime='" + modifiedTime + '\'' +
", description='" + description + '\'' +
", functionality='" + functionality + '\'' +
", aspect='" + aspect + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ 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<String> voIdList, String location, String createTime, String modifiedTime, String description) {
public CompositeVirtualObjectTransFormObject(String id, String name, List<String> voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) {
this.id = id;
this.name = name;
this.voIdList = voIdList;
this.location = location;
this.createTime = createTime;
this.modifiedTime = modifiedTime;
this.description = description;
this.functionality = functionality;
this.aspect = aspect;
}

public String getId() {
Expand Down Expand Up @@ -81,6 +86,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{" +
Expand All @@ -91,6 +112,8 @@ public String toString() {
", createTime='" + createTime + '\'' +
", modifiedTime='" + modifiedTime + '\'' +
", description='" + description + '\'' +
", functionality='" + functionality + '\'' +
", aspect='" + aspect + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,23 @@ public class CompositeVirtualObjectDataObject {
private String createTime;
private String modifiedTime;
private String description;
private String functionality;
private String aspect;


public CompositeVirtualObjectDataObject() {
}

public CompositeVirtualObjectDataObject(String id, String name, List<String> voIdList, String location, String createTime, String modifiedTime, String description) {
public CompositeVirtualObjectDataObject(String id, String name, List<String> voIdList, String location, String createTime, String modifiedTime, String description, String functionality, String aspect) {
this.id = id;
this.name = name;
this.voIdList = voIdList;
this.location = location;
this.createTime = createTime;
this.modifiedTime = modifiedTime;
this.description = description;
this.functionality = functionality;
this.aspect = aspect;
}

public String getId() {
Expand Down Expand Up @@ -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 + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ public List<Device> 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
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -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.*;
Expand All @@ -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<SessionTransFormObject> retrieveSessionData(@PathVariable int number){
Expand All @@ -38,7 +43,9 @@ public List<Session> 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;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit a55418a

Please sign in to comment.