Exemple #1
0
  // 스케줄러 상태
  // http://localhost:8080/sda/sch/status
  @RequestMapping(value = "/status", method = RequestMethod.GET)
  public @ResponseBody ResponseEntity<ResponseMessage> statusSchList() {
    ResponseMessage resultMsg = new ResponseMessage();
    ResponseEntity<ResponseMessage> entity = null;
    HttpHeaders responseHeaders = new HttpHeaders();
    Gson gson = new Gson();
    String msg = "";

    log.info("status sch begin================>");
    try {
      checkScheduerMainService();
      thm.statusSchList();
      msg = thm.getStatusList();

      resultMsg.setCode(Utils.OK_CODE);
      resultMsg.setMessage(Utils.OK_MSG);
      resultMsg.setContent(gson.toJson(msg));
      entity = new ResponseEntity<ResponseMessage>(resultMsg, responseHeaders, HttpStatus.OK);
    } catch (PersistenceException e) {
      msg = "db connection error...";
      resultMsg = Utils.makeResponseBody(e);
      resultMsg.setContent(gson.toJson(msg));
      entity =
          new ResponseEntity<ResponseMessage>(
              resultMsg, responseHeaders, HttpStatus.valueOf(resultMsg.getCode()));
    } catch (NullPointerException e) {
      msg = "scheduler is not initiated....";
      resultMsg = Utils.makeResponseBody(e);
      resultMsg.setContent(gson.toJson(msg));
      entity =
          new ResponseEntity<ResponseMessage>(
              resultMsg, responseHeaders, HttpStatus.valueOf(resultMsg.getCode()));
    } catch (Exception e) {
      e.printStackTrace();
      resultMsg = Utils.makeResponseBody(e);
      responseHeaders.add("ExceptionCause", e.getMessage());
      responseHeaders.add("ExceptionClass", e.getClass().getName());
      entity =
          new ResponseEntity<ResponseMessage>(
              resultMsg, responseHeaders, HttpStatus.valueOf(resultMsg.getCode()));
    }
    log.info("status sch end ================>");
    return entity;
  }
Exemple #2
0
  // 스케쥴러 기동
  // http://localhost:8080/sda/sch/init
  @RequestMapping(value = "/init", method = RequestMethod.GET)
  public @ResponseBody ResponseEntity<ResponseMessage> inittSch() {
    ResponseMessage resultMsg = new ResponseMessage();
    ResponseEntity<ResponseMessage> entity = null;
    HttpHeaders responseHeaders = new HttpHeaders();
    Gson gson = new Gson();
    String msg = "";

    log.info("init sch begin================>");
    try {
      // init
      thm = new SchedulerMainService();
      thm.JobInit();
      msg = thm.getStatusList();

      resultMsg.setCode(Utils.OK_CODE);
      resultMsg.setMessage(Utils.OK_MSG);
      resultMsg.setContent(gson.toJson(msg));
      entity = new ResponseEntity<ResponseMessage>(resultMsg, responseHeaders, HttpStatus.OK);
    } catch (ObjectAlreadyExistsException e) {
      msg = "scheduler is already initiated...";
      resultMsg = Utils.makeResponseBody(e);
      resultMsg.setContent(gson.toJson(msg));
      entity =
          new ResponseEntity<ResponseMessage>(
              resultMsg, responseHeaders, HttpStatus.valueOf(resultMsg.getCode()));
    } catch (Exception e) {
      e.printStackTrace();
      resultMsg = Utils.makeResponseBody(e);
      responseHeaders.add("ExceptionCause", e.getMessage());
      responseHeaders.add("ExceptionClass", e.getClass().getName());
      entity =
          new ResponseEntity<ResponseMessage>(
              resultMsg, responseHeaders, HttpStatus.valueOf(resultMsg.getCode()));
    }
    log.info("init sch end================>");
    return entity;
  }
Exemple #3
0
 @Override
 public void initResource() {
   applicationEntity = model.createResource(baseuri + this.dto.get_uri());
   parentResource = model.createResource(baseuri + "/" + Utils.getParentURI(this.dto.get_uri()));
   resourceName = dto.getRn();
   resourceId = dto.getRi();
   if (dto.getLbl() != null) {
     for (int i = 0; i < dto.getLbl().length; i++) {
       label = label + "," + dto.getLbl()[i];
     }
   } else {
     label = "";
   }
   ontologyReference = this.dto.getOr();
 }
Exemple #4
0
 public OneM2MAEMapper(OneM2MAEDTO dto, Configuration config) {
   this.dto = dto;
   this.baseuri = Utils.getSdaProperty("com.pineone.icbms.sda.knowledgebase.uri");
 }