Search in sources :

Example 1 with ActionDescriptorProto

use of org.smartdata.common.protocol.AdminServerProto.ActionDescriptorProto in project SSM by Intel-bigdata.

the class ClientSmartProtocolServerSideTranslatorPB method listActionsSupported.

@Override
public ListActionsSupportedResponseProto listActionsSupported(RpcController controller, ListActionsSupportedRequestProto req) throws ServiceException {
    try {
        List<ActionDescriptor> adList = server.listActionsSupported();
        List<ActionDescriptorProto> prolist = new ArrayList<>();
        for (ActionDescriptor a : adList) {
            prolist.add(PBHelper.convert(a));
        }
        return ListActionsSupportedResponseProto.newBuilder().addAllActDesList(prolist).build();
    } catch (IOException e) {
        throw new ServiceException(e);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) ActionDescriptor(org.smartdata.common.actions.ActionDescriptor) ArrayList(java.util.ArrayList) ActionDescriptorProto(org.smartdata.common.protocol.AdminServerProto.ActionDescriptorProto) IOException(java.io.IOException)

Example 2 with ActionDescriptorProto

use of org.smartdata.common.protocol.AdminServerProto.ActionDescriptorProto in project SSM by Intel-bigdata.

the class SmartAdminProtocolAdminSideTranslatorPB method listActionsSupported.

@Override
public List<ActionDescriptor> listActionsSupported() throws IOException {
    ListActionsSupportedRequestProto req = ListActionsSupportedRequestProto.newBuilder().build();
    try {
        List<ActionDescriptorProto> prolist = rpcProxy.listActionsSupported(null, req).getActDesListList();
        List<ActionDescriptor> list = new ArrayList<>();
        for (ActionDescriptorProto a : prolist) {
            list.add(PBHelper.convert(a));
        }
        return list;
    } catch (ServiceException e) {
        throw PBHelper.getRemoteException(e);
    }
}
Also used : ServiceException(com.google.protobuf.ServiceException) ActionDescriptor(org.smartdata.common.actions.ActionDescriptor) ListActionsSupportedRequestProto(org.smartdata.common.protocol.AdminServerProto.ListActionsSupportedRequestProto) ActionDescriptorProto(org.smartdata.common.protocol.AdminServerProto.ActionDescriptorProto) ArrayList(java.util.ArrayList)

Aggregations

ServiceException (com.google.protobuf.ServiceException)2 ArrayList (java.util.ArrayList)2 ActionDescriptor (org.smartdata.common.actions.ActionDescriptor)2 ActionDescriptorProto (org.smartdata.common.protocol.AdminServerProto.ActionDescriptorProto)2 IOException (java.io.IOException)1 ListActionsSupportedRequestProto (org.smartdata.common.protocol.AdminServerProto.ListActionsSupportedRequestProto)1