All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hyperchain.sdk.service.impl.NodeServiceImpl Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
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