Search in sources :

Example 1 with RpcDescription

use of org.onosproject.workflow.api.RpcDescription in project onos by opennetworkinglab.

the class WorkflowNetConfig method getRpcDescriptions.

public Collection<RpcDescription> getRpcDescriptions() throws WorkflowException {
    JsonNode node = object.at(RPC_PTR);
    if (!(node instanceof ArrayNode)) {
        throw new WorkflowException("invalid rpc for " + object);
    }
    ArrayNode rpcArrayNode = (ArrayNode) node;
    List<RpcDescription> rpcDescriptions = new ArrayList<>();
    for (JsonNode rpcNode : rpcArrayNode) {
        rpcDescriptions.add(DefaultRpcDescription.valueOf(rpcNode));
    }
    return rpcDescriptions;
}
Also used : WorkflowException(org.onosproject.workflow.api.WorkflowException) RpcDescription(org.onosproject.workflow.api.RpcDescription) DefaultRpcDescription(org.onosproject.workflow.api.DefaultRpcDescription) ArrayList(java.util.ArrayList) JsonNode(com.fasterxml.jackson.databind.JsonNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Aggregations

JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ArrayList (java.util.ArrayList)1 DefaultRpcDescription (org.onosproject.workflow.api.DefaultRpcDescription)1 RpcDescription (org.onosproject.workflow.api.RpcDescription)1 WorkflowException (org.onosproject.workflow.api.WorkflowException)1