Skip to content
Snippets Groups Projects
Commit a165a571 authored by Ludovic Claude's avatar Ludovic Claude
Browse files

Update woken-messages to 2.7.1

parent 193de420
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,9 @@ ...@@ -47,9 +47,9 @@
<spring-data-jpa.version>1.10.11.RELEASE</spring-data-jpa.version> <spring-data-jpa.version>1.10.11.RELEASE</spring-data-jpa.version>
<spring-boot-starter-actuator.version>1.4.7.RELEASE</spring-boot-starter-actuator.version> <spring-boot-starter-actuator.version>1.4.7.RELEASE</spring-boot-starter-actuator.version>
<aspectjweaver.version>1.8.9</aspectjweaver.version> <aspectjweaver.version>1.8.9</aspectjweaver.version>
<woken-messages.version>2.6.5</woken-messages.version> <woken-messages.version>2.7.1</woken-messages.version>
<javax-inject.version>1</javax-inject.version> <javax-inject.version>1</javax-inject.version>
<akka.version>2.5.11</akka.version> <akka.version>2.5.12</akka.version>
<spring-context.version>4.3.4.RELEASE</spring-context.version> <spring-context.version>4.3.4.RELEASE</spring-context.version>
<protobuf-java.version>3.1.0</protobuf-java.version> <protobuf-java.version>3.1.0</protobuf-java.version>
......
...@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import scala.Option;
import scala.Some;
import java.io.IOException; import java.io.IOException;
import java.sql.Date; import java.sql.Date;
...@@ -93,10 +95,10 @@ public class MiningApi extends WokenClientController { ...@@ -93,10 +95,10 @@ public class MiningApi extends WokenClientController {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\":\"" + result.error().get() + "\"}"); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("{\"error\":\"" + result.error().get() + "\"}");
} else { } else {
Mining mining = new Mining( Mining mining = new Mining(
result.jobId(), unwrap(result.jobId()),
result.node(), result.node(),
result.algorithm(), unwrap(result.algorithm()),
result.shape(), result.type().mime(),
Date.from(result.timestamp().toInstant()), Date.from(result.timestamp().toInstant()),
result.data().get().compactPrint() result.data().get().compactPrint()
); );
...@@ -106,6 +108,13 @@ public class MiningApi extends WokenClientController { ...@@ -106,6 +108,13 @@ public class MiningApi extends WokenClientController {
} }
} }
private static String unwrap(Option<String> option) {
if (option.isDefined())
return option.get();
else
return "";
}
private static boolean isExaremeAlgo(eu.hbp.mip.model.MiningQuery query) { private static boolean isExaremeAlgo(eu.hbp.mip.model.MiningQuery query) {
return query.getAlgorithm().getCode().length() > 0 && "WP_".equals( return query.getAlgorithm().getCode().length() > 0 && "WP_".equals(
query.getAlgorithm().getCode().substring(0, 3)); query.getAlgorithm().getCode().substring(0, 3));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment