Skip to content

Commit

Permalink
Device Result 부분제거 iotoasis#293
Browse files Browse the repository at this point in the history
  • Loading branch information
pahnjy01 committed Dec 8, 2016
1 parent f84affe commit 162e185
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import com.pineone.icbms.so.device.entity.Device;
import com.pineone.icbms.so.device.entity.DeviceStatusData;
import com.pineone.icbms.so.device.entity.ResultMessage;

import java.util.List;

public interface DeviceManager {
void deviceRegister(String deviceUri, String time);
void deviceRelease(String deviceId);
String deviceExecute(String deviceId,String deviceCommand, String sessionId);
String deviceControlResult(ResultMessage resultMessage);
Device deviceSearchById(String deviceId);
List<Device> deviceSearchByLocation(String location);
List<String> requestDeviceServiceList(String location);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.pineone.icbms.so.device.entity.*;
import com.pineone.icbms.so.device.proxy.DeviceControlProxy;
import com.pineone.icbms.so.device.proxy.DeviceICollectionProxy;
import com.pineone.icbms.so.device.store.DeviceResultStore;
import com.pineone.icbms.so.device.store.DeviceStore;
import com.pineone.icbms.so.device.store.DeviceSubscriptionStore;
import com.pineone.icbms.so.device.store.mongo.DeviceSubscriptionObject;
Expand Down Expand Up @@ -35,9 +34,6 @@ public class DeviceManagerLogic implements DeviceManager {
@Autowired
private DeviceStore deviceStore;

@Autowired
private DeviceResultStore deviceResultStore;

@Autowired
private SessionStore sessionStore;

Expand Down Expand Up @@ -185,26 +181,6 @@ public void run() {
return resultMessage.getCode();
}

@Override
public String deviceControlResult(ResultMessage resultMessage) {
logger.debug("ResultMessage = " + resultMessage.toString());
DeviceResult deviceResult = deviceResultStore.retrieve(resultMessage.get_commandId());

if(deviceResult != null && deviceResult.getCommandId() != null){
// It has been confirmed for the linked data.
if(ClientProfile.RESPONSE_SUCCESS_CODE.equals(resultMessage.getCode()) ||
ClientProfile.RESPONSE_SUCCESS.equals(resultMessage.getCode()) ||
ClientProfile.RESPONSE_SUCCESS_ONEM2MCODE.equals(resultMessage.getCode())){

deviceResult.setResult2(resultMessage.getCode());
deviceResultStore.update(deviceResult);
}
return resultMessage.getCode();
} else {
return "No device Control Message.";
}
}

@Override
public Device deviceSearchById(String deviceId) {
logger.debug(LogPrint.LogMethodNamePrint() + " | Device ID = " + deviceId);
Expand Down Expand Up @@ -257,10 +233,6 @@ public void deviceUpdate(DeviceStatusData deviceStatusData) {
deviceSubscriptionRelease(deviceUri + (ClientProfile.actionDeviceCommand(device.getDeviceUri()) ? ClientProfile.SI_CONTAINER_ACTION : ClientProfile.SI_CONTAINER_POWER) + ClientProfile.SI_CONTAINER_STATUS);
deviceSubscriptionStore.delete(deviceSubscriptionObject.get_id());
}

if(!deviceStatusData.getDeviceStatus().isEmpty() && !deviceStatusData.checkDeviceStatus(device.getDeviceStatus())) {

}
}
}

Expand Down Expand Up @@ -297,28 +269,6 @@ private Device deviceRequest(String uri){
return deviceICollectionProxy.findDeviceByID(uri);
}

/**
* Device 제어 결과 저장. 2차년도에는 Device Subscription으로 불필요.
* @param deviceId
* @param commandId
* @param deviceCommand
* @param resultMessage
*/
private void controlResultsStorage(String deviceId, String commandId, String deviceCommand, ResultMessage resultMessage){

DeviceResult deviceResult = new DeviceResult();

deviceResult.setCommandId(commandId);
deviceResult.setSendMessage(deviceId + deviceCommand);
deviceResult.setDeviceUrl(deviceId);
deviceResult.setValue(deviceCommand);
deviceResult.setResult1(resultMessage.getCode());
deviceResult.setResult2("");

deviceResultStore.create(deviceResult);

}

/**
* Device 생성
* Device Id, createTime,exfitedTime 추가
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,6 @@ public void deviceDisableNotification(@RequestBody deviceReleaseMessage message)
deviceManager.deviceRelease(message.getDeviceId());
}


/**
* Device 제어 결과 노티 SI -> SO
*/
@RequestMapping(value ="/monitor",method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public String asynchronousControlResult(@RequestBody ResultMessage message){
// NOTO : Device the result is stored in the data memory.
logger.info(LogPrint.inputInfoLogPrint() + "Result = " + message.getCode());
logger.debug("ResultMessage = " + message.toString());
return deviceManager.deviceControlResult(message);
}

/**
* Device Operation을 검색
*/
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 162e185

Please sign in to comment.