@JsonRpcService( "api/temperature" // note the absence of a leading slash ) public interface Temperature { @SuppressWarnings("unused") Integer currentTemperature(); }
/** * <p>Unlike the {@link com.googlecode.jsonrpc4j.spring.service.Service} / * {@link com.googlecode.jsonrpc4j.spring.service.ServiceImpl} example, this case has no interface * so the bean has the @JsonRpcService directly into the implementation. This setup worked * in jsonrpc4j 1.1, but failed in 1.2.</p> */ @JsonRpcService("ServiceSansInterface") public class ServiceSansInterfaceImpl { }
@JsonRpcService("TestService") public interface Service { }
@JsonRpcService("/api/peer") public interface PeerApi { /** * Returns all active peers */ @JsonRpcErrors({ @JsonRpcError(exception = NonExistObjectException.class, code = NonExistObjectException.code)}) List<String> getAllActivePeer(); }
@JsonRpcService("/api/branch") public interface BranchApi { /** * Returns the spec of all running branches in the node */ @JsonRpcErrors({ @JsonRpcError(exception = NonExistObjectException.class, code = NonExistObjectException.code)}) Map<String, BranchDto> getBranches(); }
@JsonRpcService("/api/admin") public interface AdminApi { /** * Client send a nodeHello message, node return a clientHello message. * * @param command The command data */ @JsonRpcErrors({ @JsonRpcError(exception = FailedOperationException.class, code = FailedOperationException.code)}) String nodeHello(@JsonRpcParam(value = "command") AdminDto command); /** * Client send a requestCommand message, node return a responseCommand message. * * @param command The command data */ @JsonRpcErrors({ @JsonRpcError(exception = FailedOperationException.class, code = FailedOperationException.code)}) String requestCommand(@JsonRpcParam(value = "command") AdminDto command); }
@JsonRpcService("/api/contract") public interface ContractApi { /** * Handles all queries that are dispatched to the contract * * @param branchId branch id of contract * @param method query method * @param params query params * @return result of query * @throws Exception exception */ @JsonRpcErrors({ @JsonRpcError(exception = NonExistObjectException.class, code = NonExistObjectException.code)}) Object query(@JsonRpcParam(value = "branchId") String branchId, @JsonRpcParam(value = "method") String method, @JsonRpcParam(value = "params") Map params) throws Exception; @JsonRpcErrors({ @JsonRpcError(exception = NonExistObjectException.class, code = NonExistObjectException.code)}) Object contract(@JsonRpcParam(value = "contractId") String contractId, @JsonRpcParam(value = "method") String method) throws Exception; }
@JsonRpcService("/api/wallet") public interface AccountApi {
@JsonRpcService("/api/block") public interface BlockApi {
@JsonRpcService("/api/transaction") public interface TransactionApi {