@RestController
@ControllerAdvice
public class Router
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected BuildService |
buildService |
|
protected ContractService |
contractService |
|
protected LiveUpdateService |
liveUpdateService |
|
protected org.slf4j.Logger |
logger |
Constructor | Description |
---|---|
Router() |
Modifier and Type | Method | Description |
---|---|---|
DeploymentResult |
deploy(java.lang.String buildUuid) |
Deploy result of build with
buildUuid . |
ExecutionResult |
execute(java.lang.String contractTransactionHash,
java.lang.String functionName,
ContractInput contractInput) |
|
BuildDetails |
getBuild(java.lang.String buildUuid) |
|
java.util.List<BuildSummary> |
getLatestBuilds() |
|
DeploymentResult |
getLatestContract() |
|
protected org.springframework.http.ResponseEntity |
handleHttpException(HttpException ex,
org.springframework.web.context.request.WebRequest request) |
|
protected java.lang.Object |
handleThrowable(java.lang.Throwable ex,
org.springframework.web.context.request.WebRequest request) |
|
void |
initialize() |
|
QueryResult |
query(java.lang.String contractTransactionHash,
java.lang.String functionName,
java.lang.String[] arguments) |
Query contract.
|
protected final transient org.slf4j.Logger logger
@Inject protected BuildService buildService
@Inject protected ContractService contractService
@Inject protected LiveUpdateService liveUpdateService
@PostConstruct public void initialize()
@GetMapping("contract") public DeploymentResult getLatestContract()
@GetMapping("builds") public java.util.List<BuildSummary> getLatestBuilds()
@GetMapping("build/{uuid}") public BuildDetails getBuild(@PathVariable("uuid") java.lang.String buildUuid)
@PostMapping("build/{uuid}/deploy") public DeploymentResult deploy(@PathVariable("uuid") java.lang.String buildUuid) throws java.lang.Exception
buildUuid
.buildUuid
- build uuidjava.lang.Exception
- Fail to deploy@PostMapping("contract/{tx}/{function}") public ExecutionResult execute(@PathVariable("tx") java.lang.String contractTransactionHash, @PathVariable("function") java.lang.String functionName, @RequestBody ContractInput contractInput) throws java.io.IOException
java.io.IOException
@GetMapping("contract/{tx}/{function}") public QueryResult query(@PathVariable("tx") java.lang.String contractTransactionHash, @PathVariable("function") java.lang.String functionName, @RequestParam(value="arguments",required=false) java.lang.String[] arguments)
contractTransactionHash
- transaction hashfunctionName
- function'name to callarguments
- argument for function@ExceptionHandler(HttpException.class) protected org.springframework.http.ResponseEntity handleHttpException(HttpException ex, org.springframework.web.context.request.WebRequest request)
@ExceptionHandler(java.lang.Throwable.class) @ResponseStatus(INTERNAL_SERVER_ERROR) @ResponseBody protected java.lang.Object handleThrowable(java.lang.Throwable ex, org.springframework.web.context.request.WebRequest request)