Example #1
0
  @GET
  @Path("/getSystemTime/")
  @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
  public WSHectare getSystemTime() {

    WSHectare hectare = new WSHectare();
    hectare.setId(1);
    hectare.setNodeId(1);
    hectare.setParcelId(1);
    hectare.setStatus(0);
    hectare.setTransactionTime(DateConverter.nowDate());

    return hectare;
  }
Example #2
0
  @GET
  @Path("upsert/{databaseName}/{id}/{nodeId}/{parcelId}/{status}/{transactionTime}")
  public String upsertHectare(
      @PathParam("databaseName") String databaseName,
      @PathParam("id") int id,
      @PathParam("nodeId") int nodeId,
      @PathParam("parcelId") int parcelId,
      @PathParam("status") int status,
      @PathParam("transactionTime") String transactionTime)
      throws ParseException {

    WSHectare hectareFromService = new WSHectare();
    hectareFromService.setId(id);
    hectareFromService.setNodeId(nodeId);
    hectareFromService.setParcelId(parcelId);
    hectareFromService.setStatus(status);
    hectareFromService.setTransactionTime(DateConverter.stringToDate(transactionTime));

    hectareService.upsert(databaseName, hectareFromService);

    return "success";
  }