Skip to content

Commit

Permalink
Device 속성 수정 iotoasis#353
Browse files Browse the repository at this point in the history
  • Loading branch information
pahnjy01 committed Feb 3, 2017
1 parent 5acda57 commit 717d9bc
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,34 @@ public class Device {
*/
private String deviceStatus;

/**
* Device의 aspect
* format : Power
* ex) Power
*/
private String aspect;


/**
* Device의 functionality
* format : Switch
* ex) Switch
*/
private String functionality;


/**
* Device의 Type
* format : A(Actuator/S(Sensor)
* ex) A
*/
private String type;


public Device() {
}

public Device(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus) {
public Device(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus, String aspect, String functionality, String type) {
this.id = id;
this.deviceName = deviceName;
this.deviceLocation = deviceLocation;
Expand All @@ -82,6 +106,9 @@ public Device(String id, String deviceName, String deviceLocation, String device
this.deviceCreateTime = deviceCreateTime;
this.deviceExfiredTime = deviceExfiredTime;
this.deviceStatus = deviceStatus;
this.aspect = aspect;
this.functionality = functionality;
this.type = type;
}

public String getId() {
Expand Down Expand Up @@ -156,6 +183,30 @@ public void setDeviceStatus(String deviceStatus) {
this.deviceStatus = deviceStatus;
}

public String getAspect() {
return aspect;
}

public void setAspect(String aspect) {
this.aspect = aspect;
}

public String getFunctionality() {
return functionality;
}

public void setFunctionality(String functionality) {
this.functionality = functionality;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public boolean checkStatus(String status){
return this.deviceStatus.equals(status);
}
Expand All @@ -169,9 +220,12 @@ public String toString() {
", deviceUri='" + deviceUri + '\'' +
", deviceCommand=" + deviceCommand +
", deviceServices=" + deviceServices +
", deviceCreateTime='" + deviceCreateTime + '\'' +
", deviceExfiredTime='" + deviceExfiredTime + '\'' +
", deviceCreateTime=" + deviceCreateTime +
", deviceExfiredTime=" + deviceExfiredTime +
", deviceStatus='" + deviceStatus + '\'' +
", aspect='" + aspect + '\'' +
", functionality='" + functionality + '\'' +
", type='" + type + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ public class DeviceTransFormObject {
private long deviceCreateTime;
private long deviceExfiredTime;
private String deviceStatus;
private String aspect;
private String functionality;
private String type;
private String sessionId;

public DeviceTransFormObject() {
}

public DeviceTransFormObject(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus) {
public DeviceTransFormObject(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus, String aspect, String functionality, String type) {
this.id = id;
this.deviceName = deviceName;
this.deviceLocation = deviceLocation;
Expand All @@ -28,6 +31,9 @@ public DeviceTransFormObject(String id, String deviceName, String deviceLocation
this.deviceCreateTime = deviceCreateTime;
this.deviceExfiredTime = deviceExfiredTime;
this.deviceStatus = deviceStatus;
this.aspect = aspect;
this.functionality = functionality;
this.type = type;
}

public String getId() {
Expand Down Expand Up @@ -114,18 +120,46 @@ public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}

public String getAspect() {
return aspect;
}

public void setAspect(String aspect) {
this.aspect = aspect;
}

public String getFunctionality() {
return functionality;
}

public void setFunctionality(String functionality) {
this.functionality = functionality;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

@Override
public String toString() {
return "Device{" +
return "DeviceTransFormObject{" +
"id='" + id + '\'' +
", deviceName='" + deviceName + '\'' +
", deviceLocation='" + deviceLocation + '\'' +
", deviceUri='" + deviceUri + '\'' +
", deviceCommand=" + deviceCommand +
", deviceServices=" + deviceServices +
", deviceCreateTime='" + deviceCreateTime + '\'' +
", deviceExfiredTime='" + deviceExfiredTime + '\'' +
", deviceCreateTime=" + deviceCreateTime +
", deviceExfiredTime=" + deviceExfiredTime +
", deviceStatus='" + deviceStatus + '\'' +
", aspect='" + aspect + '\'' +
", functionality='" + functionality + '\'' +
", type='" + type + '\'' +
", sessionId='" + sessionId + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private Device DeviceMapping(DeviceTransFormObject deviceTransFormObject)
if(deviceTransFormObject == null){
return null;
}
Device device = new Device(deviceTransFormObject.getId(),deviceTransFormObject.getDeviceName(),deviceTransFormObject.getDeviceLocation(),deviceTransFormObject.getDeviceUri(),deviceTransFormObject.getDeviceCommand(),deviceTransFormObject.getDeviceServices(),deviceTransFormObject.getDeviceCreateTime(),deviceTransFormObject.getDeviceExfiredTime(),deviceTransFormObject.getDeviceStatus());
Device device = new Device(deviceTransFormObject.getId(),deviceTransFormObject.getDeviceName(),deviceTransFormObject.getDeviceLocation(),deviceTransFormObject.getDeviceUri(),deviceTransFormObject.getDeviceCommand(),deviceTransFormObject.getDeviceServices(),deviceTransFormObject.getDeviceCreateTime(),deviceTransFormObject.getDeviceExfiredTime(),deviceTransFormObject.getDeviceStatus(),deviceTransFormObject.getAspect(),deviceTransFormObject.getFunctionality(),deviceTransFormObject.getType());
return device;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ public class DeviceDataObject {
private List<String> deviceServices;
private long deviceCreateTime;
private long deviceExfiredTime;
private String deviceStatus;
private String deviceStatus;
private String aspect;
private String functionality;
private String type;

public DeviceDataObject() {
}

public DeviceDataObject(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus) {
public DeviceDataObject(String id, String deviceName, String deviceLocation, String deviceUri, List<String> deviceCommand, List<String> deviceServices, long deviceCreateTime, long deviceExfiredTime, String deviceStatus, String aspect, String functionality, String type) {
this.id = id;
this.deviceName = deviceName;
this.deviceLocation = deviceLocation;
Expand All @@ -30,6 +33,9 @@ public DeviceDataObject(String id, String deviceName, String deviceLocation, Str
this.deviceCreateTime = deviceCreateTime;
this.deviceExfiredTime = deviceExfiredTime;
this.deviceStatus = deviceStatus;
this.aspect = aspect;
this.functionality = functionality;
this.type = type;
}

public String getId() {
Expand Down Expand Up @@ -68,6 +74,18 @@ public String getDeviceStatus() {
return deviceStatus;
}

public String getAspect() {
return aspect;
}

public String getFunctionality() {
return functionality;
}

public String getType() {
return type;
}

@Override
public String toString() {
return "DeviceDataObject{" +
Expand All @@ -77,9 +95,12 @@ public String toString() {
", deviceUri='" + deviceUri + '\'' +
", deviceCommand=" + deviceCommand +
", deviceServices=" + deviceServices +
", deviceCreateTime='" + deviceCreateTime + '\'' +
", deviceExfiredTime='" + deviceExfiredTime + '\'' +
", deviceCreateTime=" + deviceCreateTime +
", deviceExfiredTime=" + deviceExfiredTime +
", deviceStatus='" + deviceStatus + '\'' +
", aspect='" + aspect + '\'' +
", functionality='" + functionality + '\'' +
", type='" + type + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ private DeviceDataObject deviceToDataObject(Device device){
if(device == null){
return null;
}
return new DeviceDataObject(device.getId(),device.getDeviceName(),device.getDeviceLocation(),device.getDeviceUri(),device.getDeviceCommand(),device.getDeviceServices(),device.getDeviceCreateTime(),device.getDeviceExfiredTime(),device.getDeviceStatus());
return new DeviceDataObject(device.getId(),device.getDeviceName(),device.getDeviceLocation(),device.getDeviceUri(),device.getDeviceCommand(),device.getDeviceServices(),device.getDeviceCreateTime(),device.getDeviceExfiredTime(),device.getDeviceStatus(),device.getAspect(),device.getFunctionality(),device.getType());
}

private Device DeviceObjectToDevice(DeviceDataObject deviceDataObject) {
if(deviceDataObject == null){
return null;
}
return new Device(deviceDataObject.getId(),deviceDataObject.getDeviceName(),deviceDataObject.getDeviceLocation(),deviceDataObject.getDeviceUri(),deviceDataObject.getDeviceCommand(),deviceDataObject.getDeviceServices(),deviceDataObject.getDeviceCreateTime(),deviceDataObject.getDeviceExfiredTime(),deviceDataObject.getDeviceStatus());
return new Device(deviceDataObject.getId(),deviceDataObject.getDeviceName(),deviceDataObject.getDeviceLocation(),deviceDataObject.getDeviceUri(),deviceDataObject.getDeviceCommand(),deviceDataObject.getDeviceServices(),deviceDataObject.getDeviceCreateTime(),deviceDataObject.getDeviceExfiredTime(),deviceDataObject.getDeviceStatus(),deviceDataObject.getAspect(),deviceDataObject.getFunctionality(),deviceDataObject.getType());
}

}

0 comments on commit 717d9bc

Please sign in to comment.