Search in sources :

Example 1 with ManagementException

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());
    }
}
Also used : ClientInvokable(com.cinchapi.concourse.server.management.ClientInvokable) ManagementException(com.cinchapi.concourse.thrift.ManagementException) ComplexTObject(com.cinchapi.concourse.thrift.ComplexTObject) ComplexTObject(com.cinchapi.concourse.thrift.ComplexTObject) TObject(com.cinchapi.concourse.thrift.TObject) TransactionStateException(com.cinchapi.concourse.server.storage.TransactionStateException) SecurityException(com.cinchapi.concourse.thrift.SecurityException) TransactionException(com.cinchapi.concourse.thrift.TransactionException) NotCompliantMBeanException(javax.management.NotCompliantMBeanException) DuplicateEntryException(com.cinchapi.concourse.thrift.DuplicateEntryException) MalformedObjectNameException(javax.management.MalformedObjectNameException) InsufficientAtomicityException(com.cinchapi.concourse.server.ops.InsufficientAtomicityException) TException(org.apache.thrift.TException) TTransportException(org.apache.thrift.transport.TTransportException) AtomicStateException(com.cinchapi.concourse.server.storage.AtomicStateException) InstanceAlreadyExistsException(javax.management.InstanceAlreadyExistsException) ManagementException(com.cinchapi.concourse.thrift.ManagementException) ParseException(com.cinchapi.concourse.thrift.ParseException) MBeanRegistrationException(javax.management.MBeanRegistrationException) PluginRestricted(com.cinchapi.concourse.server.plugin.PluginRestricted)

Aggregations

ClientInvokable (com.cinchapi.concourse.server.management.ClientInvokable)1 InsufficientAtomicityException (com.cinchapi.concourse.server.ops.InsufficientAtomicityException)1 PluginRestricted (com.cinchapi.concourse.server.plugin.PluginRestricted)1 AtomicStateException (com.cinchapi.concourse.server.storage.AtomicStateException)1 TransactionStateException (com.cinchapi.concourse.server.storage.TransactionStateException)1 ComplexTObject (com.cinchapi.concourse.thrift.ComplexTObject)1 DuplicateEntryException (com.cinchapi.concourse.thrift.DuplicateEntryException)1 ManagementException (com.cinchapi.concourse.thrift.ManagementException)1 ParseException (com.cinchapi.concourse.thrift.ParseException)1 SecurityException (com.cinchapi.concourse.thrift.SecurityException)1 TObject (com.cinchapi.concourse.thrift.TObject)1 TransactionException (com.cinchapi.concourse.thrift.TransactionException)1 InstanceAlreadyExistsException (javax.management.InstanceAlreadyExistsException)1 MBeanRegistrationException (javax.management.MBeanRegistrationException)1 MalformedObjectNameException (javax.management.MalformedObjectNameException)1 NotCompliantMBeanException (javax.management.NotCompliantMBeanException)1 TException (org.apache.thrift.TException)1 TTransportException (org.apache.thrift.transport.TTransportException)1