cn.hyperchain.sdk.service.impl.NodeServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of litesdk Show documentation
Show all versions of litesdk Show documentation
A Java client tool for Hyperchain
package cn.hyperchain.sdk.service.impl;
import cn.hyperchain.sdk.provider.ProviderManager;
import cn.hyperchain.sdk.request.NodeRequest;
import cn.hyperchain.sdk.request.Request;
import cn.hyperchain.sdk.response.node.NodeHashResponse;
import cn.hyperchain.sdk.response.node.NodeResponse;
import cn.hyperchain.sdk.response.node.NodeStateResponse;
import cn.hyperchain.sdk.service.NodeService;
public class NodeServiceImpl implements NodeService {
private ProviderManager providerManager;
private static final String NODE_PREFIX = "node_";
public NodeServiceImpl(ProviderManager providerManager) {
this.providerManager = providerManager;
}
@Override
public Request getNodes(int... nodeIds) {
NodeRequest nodeRequest = new NodeRequest(NODE_PREFIX + "getNodes", providerManager, NodeResponse.class, nodeIds);
return nodeRequest;
}
@Override
public Request getNodeStates(int... nodeIds) {
NodeRequest nodeRequest = new NodeRequest(NODE_PREFIX + "getNodeStates", providerManager, NodeStateResponse.class, nodeIds);
return nodeRequest;
}
@Override
public Request getNodeHash(int... nodeIds) {
NodeRequest nodeRequest = new NodeRequest(NODE_PREFIX + "getNodeHash", providerManager, NodeHashResponse.class, nodeIds);
return nodeRequest;
}
@Override
public Request getNodeHashByID(int nodeId) {
NodeRequest nodeRequest = new NodeRequest(NODE_PREFIX + "getNodeHash", providerManager, NodeHashResponse.class, nodeId);
return nodeRequest;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy