use of com.cinchapi.concourse.thrift.ManagementException in project concourse by cinchapi.
the class ConcourseServer method invokeManagement.
@Override
@PluginRestricted
public ComplexTObject invokeManagement(String method, List<ComplexTObject> params, AccessToken creds) throws TException {
Object[] args = new Object[params.size() + 1];
for (int i = 0; i < params.size(); ++i) {
ComplexTObject arg = params.get(i);
args[i] = arg.getJavaObject();
}
args[args.length - 1] = creds;
try {
Object result = Reflection.callIf(invoked -> Reflection.isDeclaredAnnotationPresentInHierarchy(invoked, ClientInvokable.class), this, method, args);
return ComplexTObject.fromJavaObject(result);
} catch (IllegalStateException e) {
throw new ManagementException("The requested method invocation is either invalid or not " + "eligble for client-side invocation");
} catch (Exception e) {
throw new ManagementException(e.getMessage());
}
}
Aggregations