From 0ee04f17f88bd6624863eb257328db62e794001f Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 11:23:29 -0400 Subject: [PATCH 1/7] make type argument clearer --- .../java/com/cinchapi/concourse/server/storage/db/Database.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/storage/db/Database.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/storage/db/Database.java index 67634964d..2e2f9ea10 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/storage/db/Database.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/storage/db/Database.java @@ -961,7 +961,7 @@ public boolean verify(Write write, long timestamp) { * * @return the cache */ - private Cache buildCache() { + private > Cache buildCache() { Cache cache = CacheBuilder.newBuilder() .maximumSize(100000).softValues().build(); return new RunningAwareCache<>(cache); From 86f13bb005230f71c79bdebcbfc7d3ea8cd150d3 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:17:36 -0400 Subject: [PATCH 2/7] add the thrift interface definition --- interface/concourse.thrift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/interface/concourse.thrift b/interface/concourse.thrift index 3eaa15501..13c87d2a7 100644 --- a/interface/concourse.thrift +++ b/interface/concourse.thrift @@ -6556,4 +6556,14 @@ service ConcourseService { 1: exceptions.SecurityException ex, 2: exceptions.ManagementException ex2, ); + + bool ping( + 1: shared.AccessToken creds, + 2: shared.TransactionToken transaction, + 3: string environment + ) + throws ( + 1: exceptions.SecurityException ex + 2: exceptions.PermissionException ex2 + ) } From 6a0fec3e75379624ef6eb05a6368141501a167f7 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:18:15 -0400 Subject: [PATCH 3/7] implement the ping method --- .../server/ManagedConcourseServer.java | 5 + .../com/cinchapi/concourse/Concourse.java | 12 + .../concourse/ConcourseThriftDriver.java | 10 + .../concourse/ForwardingConcourse.java | 5 + .../com/cinchapi/concourse/NoOpConcourse.java | 5 + .../concourse/thrift/ConcourseService.java | 1720 +++++++++++++++-- .../plugin/StatefulConcourseService.java | 4 + .../concourse/server/ConcourseServer.java | 9 + 8 files changed, 1598 insertions(+), 172 deletions(-) diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index 9fd29bf19..285c39dfa 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -2291,6 +2291,11 @@ public Map> navigate(String key, String ccl, return invoke("navigate", String.class, String.class, Timestamp.class).with(key, ccl, timestamp); } + + @Override + public boolean ping() { + return invoke("ping").with(); + } @Override public Map ping(Collection records) { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 8733a7944..551b6f02e 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -5123,6 +5123,18 @@ public final Map> navigate(String key, Long record, public abstract Map> navigate(String key, String ccl, Timestamp timestamp); + /** + * Test the connection to the server. + *

+ * Check if this client is still connected to the server by sending an echo + * request and awaiting a response. This can be used to ensure subsequent + * communication with the server is possible. If the connection is broken, + * it will be necessary to establish a new connection. + * + * @return boolean - {@code true} if the connection is still alive + */ + public abstract boolean ping(); + /** * Atomically check to see if each of the {@code records} currently contains * any data. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 03b8b05e8..517b14657 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -2472,6 +2472,16 @@ public Map> navigate(final String key, final String ccl, }); } + @Override + public boolean ping() { + try { + return execute(() -> core.ping(creds, transaction, environment)); + } + catch (Exception e) { + return false; + } + } + @Override public Map ping(Collection records) { return execute(() -> core.pingRecords(Collections.toLongList(records), diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index e1bab8c09..8d493c41b 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -1091,6 +1091,11 @@ public Map> navigate(String key, String ccl, return concourse.navigate(key, ccl, timestamp); } + @Override + public boolean ping() { + return concourse.ping(); + } + @Override public Map ping(Collection records) { return concourse.ping(records); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index c07a15862..70bb94702 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -1068,6 +1068,11 @@ public Map> navigate(String key, String ccl, throw new UnsupportedOperationException(); } + @Override + public boolean ping() { + throw new UnsupportedOperationException(); + } + @Override public Map ping(Collection records) { throw new UnsupportedOperationException(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java index 1cf594cc8..04abe0ea6 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java @@ -6,7 +6,7 @@ */ package com.cinchapi.concourse.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-05-01") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-05-02") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseService { @@ -2287,6 +2287,8 @@ public interface Iface { public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException; + public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException; + } public interface AsyncIface { @@ -2995,6 +2997,8 @@ public interface AsyncIface { public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -16881,6 +16885,38 @@ public com.cinchapi.concourse.thrift.ComplexTObject recv_invokeManagement() thro throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "invokeManagement failed: unknown result"); } + @Override + public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException + { + send_ping(creds, transaction, environment); + return recv_ping(); + } + + public void send_ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException + { + ping_args args = new ping_args(); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + sendBase("ping", args); + } + + public boolean recv_ping() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException + { + ping_result result = new ping_result(); + receiveBase(result, "ping"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.ex != null) { + throw result.ex; + } + if (result.ex2 != null) { + throw result.ex2; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { @@ -34538,6 +34574,47 @@ public com.cinchapi.concourse.thrift.ComplexTObject getResult() throws com.cinch } } + @Override + public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + ping_call method_call = new ping_call(creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall { + private com.cinchapi.concourse.thrift.AccessToken creds; + private com.cinchapi.concourse.thrift.TransactionToken transaction; + private java.lang.String environment; + public ping_call(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + @Override + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0)); + ping_args args = new ping_args(); + args.setCreds(creds); + args.setTransaction(transaction); + args.setEnvironment(environment); + args.write(prot); + prot.writeMessageEnd(); + } + + @Override + public java.lang.Boolean getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_ping(); + } + } + } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -34903,6 +34980,7 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { + public ping() { + super("ping"); + } + + @Override + public ping_args getEmptyArgsInstance() { + return new ping_args(); + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + @Override + public ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException { + ping_result result = new ping_result(); + try { + result.success = iface.ping(args.creds, args.transaction, args.environment); + result.setSuccessIsSet(true); + } catch (com.cinchapi.concourse.thrift.SecurityException ex) { + result.ex = ex; + } catch (com.cinchapi.concourse.thrift.PermissionException ex2) { + result.ex2 = ex2; + } + return result; + } + } + } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -48320,6 +48433,7 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction { + public ping() { + super("ping"); + } + + @Override + public ping_args getEmptyArgsInstance() { + return new ping_args(); + } + + @Override + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + @Override + public void onComplete(java.lang.Boolean o) { + ping_result result = new ping_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + @Override + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + ping_result result = new ping_result(); + if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { + result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; + result.setExIsSet(true); + msg = result; + } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { + result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; + result.setEx2IsSet(true); + msg = result; + } else if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + @Override + protected boolean isOneway() { + return false; + } + + @Override + public void start(I iface, ping_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.ping(args.creds, args.transaction, args.environment,resultHandler); + } + } + } public static class abort_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -703635,30 +703825,1253 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_args("); + boolean first = true; + + sb.append("method:"); + if (this.method == null) { + sb.append("null"); + } else { + sb.append(this.method); + } + first = false; + if (!first) sb.append(", "); + sb.append("params:"); + if (this.params == null) { + sb.append("null"); + } else { + sb.append(this.params); + } + first = false; + if (!first) sb.append(", "); + sb.append("creds:"); + if (this.creds == null) { + sb.append("null"); + } else { + sb.append(this.creds); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (creds != null) { + creds.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class invokeManagement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public invokeManagement_argsStandardScheme getScheme() { + return new invokeManagement_argsStandardScheme(); + } + } + + private static class invokeManagement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 2: // METHOD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.method = iprot.readString(); + struct.setMethodIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PARAMS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); + struct.params = new java.util.ArrayList(_list7210.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7211; + for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) + { + _elem7211 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7211.read(iprot); + struct.params.add(_elem7211); + } + iprot.readListEnd(); + } + struct.setParamsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.method != null) { + oprot.writeFieldBegin(METHOD_FIELD_DESC); + oprot.writeString(struct.method); + oprot.writeFieldEnd(); + } + if (struct.params != null) { + oprot.writeFieldBegin(PARAMS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7213 : struct.params) + { + _iter7213.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class invokeManagement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public invokeManagement_argsTupleScheme getScheme() { + return new invokeManagement_argsTupleScheme(); + } + } + + private static class invokeManagement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetMethod()) { + optionals.set(0); + } + if (struct.isSetParams()) { + optionals.set(1); + } + if (struct.isSetCreds()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetMethod()) { + oprot.writeString(struct.method); + } + if (struct.isSetParams()) { + { + oprot.writeI32(struct.params.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7214 : struct.params) + { + _iter7214.write(oprot); + } + } + } + if (struct.isSetCreds()) { + struct.creds.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.method = iprot.readString(); + struct.setMethodIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.params = new java.util.ArrayList(_list7215.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7216; + for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) + { + _elem7216 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7216.read(iprot); + struct.params.add(_elem7216); + } + } + struct.setParamsIsSet(true); + } + if (incoming.get(2)) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class invokeManagement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("invokeManagement_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new invokeManagement_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new invokeManagement_resultTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"), + EX((short)1, "ex"), + EX2((short)2, "ex2"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // EX + return EX; + case 2: // EX2 + return EX2; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); + tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); + tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ManagementException.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(invokeManagement_result.class, metaDataMap); + } + + public invokeManagement_result() { + } + + public invokeManagement_result( + com.cinchapi.concourse.thrift.ComplexTObject success, + com.cinchapi.concourse.thrift.SecurityException ex, + com.cinchapi.concourse.thrift.ManagementException ex2) + { + this(); + this.success = success; + this.ex = ex; + this.ex2 = ex2; + } + + /** + * Performs a deep copy on other. + */ + public invokeManagement_result(invokeManagement_result other) { + if (other.isSetSuccess()) { + this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); + } + if (other.isSetEx()) { + this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); + } + if (other.isSetEx2()) { + this.ex2 = new com.cinchapi.concourse.thrift.ManagementException(other.ex2); + } + } + + @Override + public invokeManagement_result deepCopy() { + return new invokeManagement_result(this); + } + + @Override + public void clear() { + this.success = null; + this.ex = null; + this.ex2 = null; + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { + return this.success; + } + + public invokeManagement_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.SecurityException getEx() { + return this.ex; + } + + public invokeManagement_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + this.ex = ex; + return this; + } + + public void unsetEx() { + this.ex = null; + } + + /** Returns true if field ex is set (has been assigned a value) and false otherwise */ + public boolean isSetEx() { + return this.ex != null; + } + + public void setExIsSet(boolean value) { + if (!value) { + this.ex = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ManagementException getEx2() { + return this.ex2; + } + + public invokeManagement_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2) { + this.ex2 = ex2; + return this; + } + + public void unsetEx2() { + this.ex2 = null; + } + + /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ + public boolean isSetEx2() { + return this.ex2 != null; + } + + public void setEx2IsSet(boolean value) { + if (!value) { + this.ex2 = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); + } + break; + + case EX: + if (value == null) { + unsetEx(); + } else { + setEx((com.cinchapi.concourse.thrift.SecurityException)value); + } + break; + + case EX2: + if (value == null) { + unsetEx2(); + } else { + setEx2((com.cinchapi.concourse.thrift.ManagementException)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case EX: + return getEx(); + + case EX2: + return getEx2(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case EX: + return isSetEx(); + case EX2: + return isSetEx2(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof invokeManagement_result) + return this.equals((invokeManagement_result)that); + return false; + } + + public boolean equals(invokeManagement_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_ex = true && this.isSetEx(); + boolean that_present_ex = true && that.isSetEx(); + if (this_present_ex || that_present_ex) { + if (!(this_present_ex && that_present_ex)) + return false; + if (!this.ex.equals(that.ex)) + return false; + } + + boolean this_present_ex2 = true && this.isSetEx2(); + boolean that_present_ex2 = true && that.isSetEx2(); + if (this_present_ex2 || that_present_ex2) { + if (!(this_present_ex2 && that_present_ex2)) + return false; + if (!this.ex2.equals(that.ex2)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); + if (isSetEx()) + hashCode = hashCode * 8191 + ex.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); + if (isSetEx2()) + hashCode = hashCode * 8191 + ex2.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(invokeManagement_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEx2()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex:"); + if (this.ex == null) { + sb.append("null"); + } else { + sb.append(this.ex); + } + first = false; + if (!first) sb.append(", "); + sb.append("ex2:"); + if (this.ex2 == null) { + sb.append("null"); + } else { + sb.append(this.ex2); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class invokeManagement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public invokeManagement_resultStandardScheme getScheme() { + return new invokeManagement_resultStandardScheme(); + } + } + + private static class invokeManagement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // EX + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // EX2 + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex != null) { + oprot.writeFieldBegin(EX_FIELD_DESC); + struct.ex.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.ex2 != null) { + oprot.writeFieldBegin(EX2_FIELD_DESC); + struct.ex2.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class invokeManagement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override + public invokeManagement_resultTupleScheme getScheme() { + return new invokeManagement_resultTupleScheme(); + } + } + + private static class invokeManagement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEx()) { + optionals.set(1); + } + if (struct.isSetEx2()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEx()) { + struct.ex.write(oprot); + } + if (struct.isSetEx2()) { + struct.ex2.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); + struct.ex.read(iprot); + struct.setExIsSet(true); + } + if (incoming.get(2)) { + struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); + struct.ex2.read(iprot); + struct.setEx2IsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class ping_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args"); + + private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ping_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ping_argsTupleSchemeFactory(); + + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required + public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + CREDS((short)1, "creds"), + TRANSACTION((short)2, "transaction"), + ENVIRONMENT((short)3, "environment"); + + private static final java.util.Map byName = new java.util.LinkedHashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // CREDS + return CREDS; + case 2: // TRANSACTION + return TRANSACTION; + case 3: // ENVIRONMENT + return ENVIRONMENT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + @Override + public short getThriftFieldId() { + return _thriftId; + } + + @Override + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); + tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); + tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap); + } + + public ping_args() { + } + + public ping_args( + com.cinchapi.concourse.thrift.AccessToken creds, + com.cinchapi.concourse.thrift.TransactionToken transaction, + java.lang.String environment) + { + this(); + this.creds = creds; + this.transaction = transaction; + this.environment = environment; + } + + /** + * Performs a deep copy on other. + */ + public ping_args(ping_args other) { + if (other.isSetCreds()) { + this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); + } + if (other.isSetTransaction()) { + this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); + } + if (other.isSetEnvironment()) { + this.environment = other.environment; + } + } + + @Override + public ping_args deepCopy() { + return new ping_args(this); + } + + @Override + public void clear() { + this.creds = null; + this.transaction = null; + this.environment = null; + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.AccessToken getCreds() { + return this.creds; + } + + public ping_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { + this.creds = creds; + return this; + } + + public void unsetCreds() { + this.creds = null; + } + + /** Returns true if field creds is set (has been assigned a value) and false otherwise */ + public boolean isSetCreds() { + return this.creds != null; + } + + public void setCredsIsSet(boolean value) { + if (!value) { + this.creds = null; + } + } + + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { + return this.transaction; + } + + public ping_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { + this.transaction = transaction; + return this; + } + + public void unsetTransaction() { + this.transaction = null; + } + + /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ + public boolean isSetTransaction() { + return this.transaction != null; + } + + public void setTransactionIsSet(boolean value) { + if (!value) { + this.transaction = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getEnvironment() { + return this.environment; + } + + public ping_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { + this.environment = environment; + return this; + } + + public void unsetEnvironment() { + this.environment = null; + } + + /** Returns true if field environment is set (has been assigned a value) and false otherwise */ + public boolean isSetEnvironment() { + return this.environment != null; + } + + public void setEnvironmentIsSet(boolean value) { + if (!value) { + this.environment = null; + } + } + + @Override + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case CREDS: + if (value == null) { + unsetCreds(); + } else { + setCreds((com.cinchapi.concourse.thrift.AccessToken)value); + } + break; + + case TRANSACTION: + if (value == null) { + unsetTransaction(); + } else { + setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); + } + break; + + case ENVIRONMENT: + if (value == null) { + unsetEnvironment(); + } else { + setEnvironment((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + @Override + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case CREDS: + return getCreds(); + + case TRANSACTION: + return getTransaction(); + + case ENVIRONMENT: + return getEnvironment(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case CREDS: + return isSetCreds(); + case TRANSACTION: + return isSetTransaction(); + case ENVIRONMENT: + return isSetEnvironment(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that instanceof ping_args) + return this.equals((ping_args)that); + return false; + } + + public boolean equals(ping_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_creds = true && this.isSetCreds(); + boolean that_present_creds = true && that.isSetCreds(); + if (this_present_creds || that_present_creds) { + if (!(this_present_creds && that_present_creds)) + return false; + if (!this.creds.equals(that.creds)) + return false; + } + + boolean this_present_transaction = true && this.isSetTransaction(); + boolean that_present_transaction = true && that.isSetTransaction(); + if (this_present_transaction || that_present_transaction) { + if (!(this_present_transaction && that_present_transaction)) + return false; + if (!this.transaction.equals(that.transaction)) + return false; + } + + boolean this_present_environment = true && this.isSetEnvironment(); + boolean that_present_environment = true && that.isSetEnvironment(); + if (this_present_environment || that_present_environment) { + if (!(this_present_environment && that_present_environment)) + return false; + if (!this.environment.equals(that.environment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); + if (isSetCreds()) + hashCode = hashCode * 8191 + creds.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); + if (isSetTransaction()) + hashCode = hashCode * 8191 + transaction.hashCode(); + + hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); + if (isSetEnvironment()) + hashCode = hashCode * 8191 + environment.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(ping_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCreds()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTransaction()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEnvironment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + @Override + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + @Override + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ping_args("); boolean first = true; - sb.append("method:"); - if (this.method == null) { + sb.append("creds:"); + if (this.creds == null) { sb.append("null"); } else { - sb.append(this.method); + sb.append(this.creds); } first = false; if (!first) sb.append(", "); - sb.append("params:"); - if (this.params == null) { + sb.append("transaction:"); + if (this.transaction == null) { sb.append("null"); } else { - sb.append(this.params); + sb.append(this.transaction); } first = false; if (!first) sb.append(", "); - sb.append("creds:"); - if (this.creds == null) { + sb.append("environment:"); + if (this.environment == null) { sb.append("null"); } else { - sb.append(this.creds); + sb.append(this.environment); } first = false; sb.append(")"); @@ -703671,6 +705084,9 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } + if (transaction != null) { + transaction.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -703689,17 +705105,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class invokeManagement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ping_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public invokeManagement_argsStandardScheme getScheme() { - return new invokeManagement_argsStandardScheme(); + public ping_argsStandardScheme getScheme() { + return new ping_argsStandardScheme(); } } - private static class invokeManagement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class ping_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -703709,38 +705125,28 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_ar break; } switch (schemeField.id) { - case 2: // METHOD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.method = iprot.readString(); - struct.setMethodIsSet(true); + case 1: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // PARAMS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); - struct.params = new java.util.ArrayList(_list7210.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7211; - for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) - { - _elem7211 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7211.read(iprot); - struct.params.add(_elem7211); - } - iprot.readListEnd(); - } - struct.setParamsIsSet(true); + case 2: // TRANSACTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // CREDS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); + case 3: // ENVIRONMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -703757,30 +705163,23 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_ar } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.method != null) { - oprot.writeFieldBegin(METHOD_FIELD_DESC); - oprot.writeString(struct.method); + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); oprot.writeFieldEnd(); } - if (struct.params != null) { - oprot.writeFieldBegin(PARAMS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7213 : struct.params) - { - _iter7213.write(oprot); - } - oprot.writeListEnd(); - } + if (struct.transaction != null) { + oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); + struct.transaction.write(oprot); oprot.writeFieldEnd(); } - if (struct.creds != null) { - oprot.writeFieldBegin(CREDS_FIELD_DESC); - struct.creds.write(oprot); + if (struct.environment != null) { + oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); + oprot.writeString(struct.environment); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -703789,72 +705188,57 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_a } - private static class invokeManagement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ping_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public invokeManagement_argsTupleScheme getScheme() { - return new invokeManagement_argsTupleScheme(); + public ping_argsTupleScheme getScheme() { + return new ping_argsTupleScheme(); } } - private static class invokeManagement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class ping_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetMethod()) { + if (struct.isSetCreds()) { optionals.set(0); } - if (struct.isSetParams()) { + if (struct.isSetTransaction()) { optionals.set(1); } - if (struct.isSetCreds()) { + if (struct.isSetEnvironment()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); - if (struct.isSetMethod()) { - oprot.writeString(struct.method); - } - if (struct.isSetParams()) { - { - oprot.writeI32(struct.params.size()); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7214 : struct.params) - { - _iter7214.write(oprot); - } - } - } if (struct.isSetCreds()) { struct.creds.write(oprot); } + if (struct.isSetTransaction()) { + struct.transaction.write(oprot); + } + if (struct.isSetEnvironment()) { + oprot.writeString(struct.environment); + } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - struct.method = iprot.readString(); - struct.setMethodIsSet(true); + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); } if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.params = new java.util.ArrayList(_list7215.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7216; - for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) - { - _elem7216 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7216.read(iprot); - struct.params.add(_elem7216); - } - } - struct.setParamsIsSet(true); + struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); + struct.transaction.read(iprot); + struct.setTransactionIsSet(true); } if (incoming.get(2)) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); + struct.environment = iprot.readString(); + struct.setEnvironmentIsSet(true); } } } @@ -703864,19 +705248,19 @@ private static S scheme(org.apache. } } - public static class invokeManagement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("invokeManagement_result"); + public static class ping_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new invokeManagement_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new invokeManagement_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ping_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ping_resultTupleSchemeFactory(); - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required + public boolean success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex2; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -703947,29 +705331,32 @@ public java.lang.String getFieldName() { } // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ManagementException.class))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(invokeManagement_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap); } - public invokeManagement_result() { + public ping_result() { } - public invokeManagement_result( - com.cinchapi.concourse.thrift.ComplexTObject success, + public ping_result( + boolean success, com.cinchapi.concourse.thrift.SecurityException ex, - com.cinchapi.concourse.thrift.ManagementException ex2) + com.cinchapi.concourse.thrift.PermissionException ex2) { this(); this.success = success; + setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; } @@ -703977,53 +705364,51 @@ public invokeManagement_result( /** * Performs a deep copy on other. */ - public invokeManagement_result(invokeManagement_result other) { - if (other.isSetSuccess()) { - this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); - } + public ping_result(ping_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } if (other.isSetEx2()) { - this.ex2 = new com.cinchapi.concourse.thrift.ManagementException(other.ex2); + this.ex2 = new com.cinchapi.concourse.thrift.PermissionException(other.ex2); } } @Override - public invokeManagement_result deepCopy() { - return new invokeManagement_result(this); + public ping_result deepCopy() { + return new ping_result(this); } @Override public void clear() { - this.success = null; + setSuccessIsSet(false); + this.success = false; this.ex = null; this.ex2 = null; } - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { + public boolean isSuccess() { return this.success; } - public invokeManagement_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { + public ping_result setSuccess(boolean success) { this.success = success; + setSuccessIsSet(true); return this; } public void unsetSuccess() { - this.success = null; + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return this.success != null; + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } @org.apache.thrift.annotation.Nullable @@ -704031,7 +705416,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public invokeManagement_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public ping_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -704052,11 +705437,11 @@ public void setExIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ManagementException getEx2() { + public com.cinchapi.concourse.thrift.PermissionException getEx2() { return this.ex2; } - public invokeManagement_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2) { + public ping_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex2) { this.ex2 = ex2; return this; } @@ -704083,7 +705468,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); + setSuccess((java.lang.Boolean)value); } break; @@ -704099,7 +705484,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx2(); } else { - setEx2((com.cinchapi.concourse.thrift.ManagementException)value); + setEx2((com.cinchapi.concourse.thrift.PermissionException)value); } break; @@ -704111,7 +705496,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return getSuccess(); + return isSuccess(); case EX: return getEx(); @@ -704143,23 +705528,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof invokeManagement_result) - return this.equals((invokeManagement_result)that); + if (that instanceof ping_result) + return this.equals((ping_result)that); return false; } - public boolean equals(invokeManagement_result that) { + public boolean equals(ping_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); + boolean this_present_success = true; + boolean that_present_success = true; if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (!this.success.equals(that.success)) + if (this.success != that.success) return false; } @@ -704188,9 +705573,7 @@ public boolean equals(invokeManagement_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -704204,7 +705587,7 @@ public int hashCode() { } @Override - public int compareTo(invokeManagement_result other) { + public int compareTo(ping_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -704261,15 +705644,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("ping_result("); boolean first = true; sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } + sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -704294,9 +705673,6 @@ public java.lang.String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity - if (success != null) { - success.validate(); - } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -704309,23 +705685,25 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class invokeManagement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ping_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public invokeManagement_resultStandardScheme getScheme() { - return new invokeManagement_resultStandardScheme(); + public ping_resultStandardScheme getScheme() { + return new ping_resultStandardScheme(); } } - private static class invokeManagement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class ping_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -704336,9 +705714,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_re } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); - struct.success.read(iprot); + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -704355,7 +705732,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_re break; case 2: // EX2 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); + struct.ex2 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex2.read(iprot); struct.setEx2IsSet(true); } else { @@ -704374,13 +705751,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_re } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { + if (struct.isSetSuccess()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); + oprot.writeBool(struct.success); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -704399,17 +705776,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_r } - private static class invokeManagement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ping_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public invokeManagement_resultTupleScheme getScheme() { - return new invokeManagement_resultTupleScheme(); + public ping_resultTupleScheme getScheme() { + return new ping_resultTupleScheme(); } } - private static class invokeManagement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class ping_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { @@ -704423,7 +705800,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_re } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { - struct.success.write(oprot); + oprot.writeBool(struct.success); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -704434,12 +705811,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_re } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); - struct.success.read(iprot); + struct.success = iprot.readBool(); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -704448,7 +705824,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_res struct.setExIsSet(true); } if (incoming.get(2)) { - struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); + struct.ex2 = new com.cinchapi.concourse.thrift.PermissionException(); struct.ex2.read(iprot); struct.setEx2IsSet(true); } diff --git a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java index 09a7feb24..675626e64 100644 --- a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java +++ b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java @@ -3177,6 +3177,10 @@ public boolean consolidateRecords(List records) { throw new UnsupportedOperationException(); } + public boolean ping() { + throw new UnsupportedOperationException(); + } + public Object sumKeyRecord(String key, long record) { throw new UnsupportedOperationException(); } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index ddbaccf43..629d01928 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -4273,6 +4273,15 @@ public AccessToken newServiceToken() { return users.tokens.issueServiceToken(); } + @Override + @TranslateClientExceptions + @VerifyAccessToken + @VerifyReadPermission + public boolean ping(AccessToken creds, TransactionToken transaction, + String environment) throws TException { + return true; + } + @Override @TranslateClientExceptions @VerifyAccessToken From 8ade00afe97993e6e961b446538fb4e3a24a86ae Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:18:25 -0400 Subject: [PATCH 4/7] unit test --- .../com/cinchapi/concourse/ete/PingTest.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java diff --git a/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java b/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java new file mode 100644 index 000000000..972d548b4 --- /dev/null +++ b/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2013-2024 Cinchapi Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.cinchapi.concourse.ete; + +import org.junit.Assert; +import org.junit.Test; + +import com.cinchapi.concourse.test.ClientServerTest; +import com.google.common.collect.ImmutableSet; + + +/** + * Unit tests for the ping functionality in Concourse + * + * @author Jeff Nelson + */ +public class PingTest extends ClientServerTest { + + @Test + public void testPingWhenRunning() { + Assert.assertTrue(client.ping()); + } + + @Test + public void testPingWhenStopped() { + Assert.assertTrue(client.ping()); + server.stop(); + Assert.assertFalse(client.ping()); + } + + @Test + public void testPingWhenRestarted() { + Assert.assertTrue(client.ping()); + server.restart(); + Assert.assertFalse(client.ping()); + } + + @Test + public void testPingWhenRestartedAndReconnected() { + Assert.assertTrue(client.ping()); + server.restart(); + Assert.assertFalse(client.ping()); + client = server.connect(); + Assert.assertTrue(client.ping()); + } + + @Test + public void testPingExemptFromExceptions() { + Assert.assertTrue(client.ping()); + Assert.assertEquals(ImmutableSet.of(), client.inventory()); + server.stop(); + try { + client.inventory(); + Assert.fail(); + } + catch(Exception e) { + Assert.assertTrue(true); + } + Assert.assertFalse(client.ping()); + } + + @Override + protected String getServerVersion() { + return ClientServerTest.LATEST_SNAPSHOT_VERSION; + } + +} From 88ff8653c21d3dc9e9c16827e13d5d88efb5aceb Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:18:55 -0400 Subject: [PATCH 5/7] Revert "add the thrift interface definition" This reverts commit 86f13bb005230f71c79bdebcbfc7d3ea8cd150d3. --- interface/concourse.thrift | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/interface/concourse.thrift b/interface/concourse.thrift index 13c87d2a7..3eaa15501 100644 --- a/interface/concourse.thrift +++ b/interface/concourse.thrift @@ -6556,14 +6556,4 @@ service ConcourseService { 1: exceptions.SecurityException ex, 2: exceptions.ManagementException ex2, ); - - bool ping( - 1: shared.AccessToken creds, - 2: shared.TransactionToken transaction, - 3: string environment - ) - throws ( - 1: exceptions.SecurityException ex - 2: exceptions.PermissionException ex2 - ) } From 35b67e2c461a545baae61876c9b8e4c4d4f1fa9f Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:19:04 -0400 Subject: [PATCH 6/7] Revert "implement the ping method" This reverts commit 6a0fec3e75379624ef6eb05a6368141501a167f7. --- .../server/ManagedConcourseServer.java | 5 - .../com/cinchapi/concourse/Concourse.java | 12 - .../concourse/ConcourseThriftDriver.java | 10 - .../concourse/ForwardingConcourse.java | 5 - .../com/cinchapi/concourse/NoOpConcourse.java | 5 - .../concourse/thrift/ConcourseService.java | 1720 ++--------------- .../plugin/StatefulConcourseService.java | 4 - .../concourse/server/ConcourseServer.java | 9 - 8 files changed, 172 insertions(+), 1598 deletions(-) diff --git a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java index 285c39dfa..9fd29bf19 100644 --- a/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java +++ b/concourse-automation/src/main/java/com/cinchapi/concourse/automation/server/ManagedConcourseServer.java @@ -2291,11 +2291,6 @@ public Map> navigate(String key, String ccl, return invoke("navigate", String.class, String.class, Timestamp.class).with(key, ccl, timestamp); } - - @Override - public boolean ping() { - return invoke("ping").with(); - } @Override public Map ping(Collection records) { diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java index 551b6f02e..8733a7944 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/Concourse.java @@ -5123,18 +5123,6 @@ public final Map> navigate(String key, Long record, public abstract Map> navigate(String key, String ccl, Timestamp timestamp); - /** - * Test the connection to the server. - *

- * Check if this client is still connected to the server by sending an echo - * request and awaiting a response. This can be used to ensure subsequent - * communication with the server is possible. If the connection is broken, - * it will be necessary to establish a new connection. - * - * @return boolean - {@code true} if the connection is still alive - */ - public abstract boolean ping(); - /** * Atomically check to see if each of the {@code records} currently contains * any data. diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java index 517b14657..03b8b05e8 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ConcourseThriftDriver.java @@ -2472,16 +2472,6 @@ public Map> navigate(final String key, final String ccl, }); } - @Override - public boolean ping() { - try { - return execute(() -> core.ping(creds, transaction, environment)); - } - catch (Exception e) { - return false; - } - } - @Override public Map ping(Collection records) { return execute(() -> core.pingRecords(Collections.toLongList(records), diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java index 8d493c41b..e1bab8c09 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/ForwardingConcourse.java @@ -1091,11 +1091,6 @@ public Map> navigate(String key, String ccl, return concourse.navigate(key, ccl, timestamp); } - @Override - public boolean ping() { - return concourse.ping(); - } - @Override public Map ping(Collection records) { return concourse.ping(records); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java index 70bb94702..c07a15862 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/NoOpConcourse.java @@ -1068,11 +1068,6 @@ public Map> navigate(String key, String ccl, throw new UnsupportedOperationException(); } - @Override - public boolean ping() { - throw new UnsupportedOperationException(); - } - @Override public Map ping(Collection records) { throw new UnsupportedOperationException(); diff --git a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java index 04abe0ea6..1cf594cc8 100644 --- a/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java +++ b/concourse-driver-java/src/main/java/com/cinchapi/concourse/thrift/ConcourseService.java @@ -6,7 +6,7 @@ */ package com.cinchapi.concourse.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-05-02") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.20.0)", date = "2024-05-01") @SuppressWarnings({ "unchecked", "rawtypes", "serial", "unused" }) public class ConcourseService { @@ -2287,8 +2287,6 @@ public interface Iface { public com.cinchapi.concourse.thrift.ComplexTObject invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.ManagementException, org.apache.thrift.TException; - public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException; - } public interface AsyncIface { @@ -2997,8 +2995,6 @@ public interface AsyncIface { public void invokeManagement(java.lang.String method, java.util.List params, com.cinchapi.concourse.thrift.AccessToken creds, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -16885,38 +16881,6 @@ public com.cinchapi.concourse.thrift.ComplexTObject recv_invokeManagement() thro throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "invokeManagement failed: unknown result"); } - @Override - public boolean ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException - { - send_ping(creds, transaction, environment); - return recv_ping(); - } - - public void send_ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment) throws org.apache.thrift.TException - { - ping_args args = new ping_args(); - args.setCreds(creds); - args.setTransaction(transaction); - args.setEnvironment(environment); - sendBase("ping", args); - } - - public boolean recv_ping() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException - { - ping_result result = new ping_result(); - receiveBase(result, "ping"); - if (result.isSetSuccess()) { - return result.success; - } - if (result.ex != null) { - throw result.ex; - } - if (result.ex2 != null) { - throw result.ex2; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result"); - } - } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { @@ -34574,47 +34538,6 @@ public com.cinchapi.concourse.thrift.ComplexTObject getResult() throws com.cinch } } - @Override - public void ping(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - ping_call method_call = new ping_call(creds, transaction, environment, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall { - private com.cinchapi.concourse.thrift.AccessToken creds; - private com.cinchapi.concourse.thrift.TransactionToken transaction; - private java.lang.String environment; - public ping_call(com.cinchapi.concourse.thrift.AccessToken creds, com.cinchapi.concourse.thrift.TransactionToken transaction, java.lang.String environment, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.creds = creds; - this.transaction = transaction; - this.environment = environment; - } - - @Override - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ping_args args = new ping_args(); - args.setCreds(creds); - args.setTransaction(transaction); - args.setEnvironment(environment); - args.write(prot); - prot.writeMessageEnd(); - } - - @Override - public java.lang.Boolean getResult() throws com.cinchapi.concourse.thrift.SecurityException, com.cinchapi.concourse.thrift.PermissionException, org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_ping(); - } - } - } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -34980,7 +34903,6 @@ protected Processor(I iface, java.util.Map extends org.apache.thrift.ProcessFunction { - public ping() { - super("ping"); - } - - @Override - public ping_args getEmptyArgsInstance() { - return new ping_args(); - } - - @Override - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - @Override - public ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException { - ping_result result = new ping_result(); - try { - result.success = iface.ping(args.creds, args.transaction, args.environment); - result.setSuccessIsSet(true); - } catch (com.cinchapi.concourse.thrift.SecurityException ex) { - result.ex = ex; - } catch (com.cinchapi.concourse.thrift.PermissionException ex2) { - result.ex2 = ex2; - } - return result; - } - } - } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -48433,7 +48320,6 @@ protected AsyncProcessor(I iface, java.util.Map extends org.apache.thrift.AsyncProcessFunction { - public ping() { - super("ping"); - } - - @Override - public ping_args getEmptyArgsInstance() { - return new ping_args(); - } - - @Override - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - @Override - public void onComplete(java.lang.Boolean o) { - ping_result result = new ping_result(); - result.success = o; - result.setSuccessIsSet(true); - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - @Override - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - ping_result result = new ping_result(); - if (e instanceof com.cinchapi.concourse.thrift.SecurityException) { - result.ex = (com.cinchapi.concourse.thrift.SecurityException) e; - result.setExIsSet(true); - msg = result; - } else if (e instanceof com.cinchapi.concourse.thrift.PermissionException) { - result.ex2 = (com.cinchapi.concourse.thrift.PermissionException) e; - result.setEx2IsSet(true); - msg = result; - } else if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - @Override - protected boolean isOneway() { - return false; - } - - @Override - public void start(I iface, ping_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.ping(args.creds, args.transaction, args.environment,resultHandler); - } - } - } public static class abort_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -703825,1253 +703635,30 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_args("); - boolean first = true; - - sb.append("method:"); - if (this.method == null) { - sb.append("null"); - } else { - sb.append(this.method); - } - first = false; - if (!first) sb.append(", "); - sb.append("params:"); - if (this.params == null) { - sb.append("null"); - } else { - sb.append(this.params); - } - first = false; - if (!first) sb.append(", "); - sb.append("creds:"); - if (this.creds == null) { - sb.append("null"); - } else { - sb.append(this.creds); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (creds != null) { - creds.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class invokeManagement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public invokeManagement_argsStandardScheme getScheme() { - return new invokeManagement_argsStandardScheme(); - } - } - - private static class invokeManagement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 2: // METHOD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.method = iprot.readString(); - struct.setMethodIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PARAMS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); - struct.params = new java.util.ArrayList(_list7210.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7211; - for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) - { - _elem7211 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7211.read(iprot); - struct.params.add(_elem7211); - } - iprot.readListEnd(); - } - struct.setParamsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CREDS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.method != null) { - oprot.writeFieldBegin(METHOD_FIELD_DESC); - oprot.writeString(struct.method); - oprot.writeFieldEnd(); - } - if (struct.params != null) { - oprot.writeFieldBegin(PARAMS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7213 : struct.params) - { - _iter7213.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.creds != null) { - oprot.writeFieldBegin(CREDS_FIELD_DESC); - struct.creds.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class invokeManagement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public invokeManagement_argsTupleScheme getScheme() { - return new invokeManagement_argsTupleScheme(); - } - } - - private static class invokeManagement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetMethod()) { - optionals.set(0); - } - if (struct.isSetParams()) { - optionals.set(1); - } - if (struct.isSetCreds()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetMethod()) { - oprot.writeString(struct.method); - } - if (struct.isSetParams()) { - { - oprot.writeI32(struct.params.size()); - for (com.cinchapi.concourse.thrift.ComplexTObject _iter7214 : struct.params) - { - _iter7214.write(oprot); - } - } - } - if (struct.isSetCreds()) { - struct.creds.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.method = iprot.readString(); - struct.setMethodIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); - struct.params = new java.util.ArrayList(_list7215.size); - @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7216; - for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) - { - _elem7216 = new com.cinchapi.concourse.thrift.ComplexTObject(); - _elem7216.read(iprot); - struct.params.add(_elem7216); - } - } - struct.setParamsIsSet(true); - } - if (incoming.get(2)) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class invokeManagement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("invokeManagement_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new invokeManagement_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new invokeManagement_resultTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - EX((short)1, "ex"), - EX2((short)2, "ex2"); - - private static final java.util.Map byName = new java.util.LinkedHashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - case 1: // EX - return EX; - case 2: // EX2 - return EX2; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - @Override - public short getThriftFieldId() { - return _thriftId; - } - - @Override - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); - tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); - tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ManagementException.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(invokeManagement_result.class, metaDataMap); - } - - public invokeManagement_result() { - } - - public invokeManagement_result( - com.cinchapi.concourse.thrift.ComplexTObject success, - com.cinchapi.concourse.thrift.SecurityException ex, - com.cinchapi.concourse.thrift.ManagementException ex2) - { - this(); - this.success = success; - this.ex = ex; - this.ex2 = ex2; - } - - /** - * Performs a deep copy on other. - */ - public invokeManagement_result(invokeManagement_result other) { - if (other.isSetSuccess()) { - this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); - } - if (other.isSetEx()) { - this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); - } - if (other.isSetEx2()) { - this.ex2 = new com.cinchapi.concourse.thrift.ManagementException(other.ex2); - } - } - - @Override - public invokeManagement_result deepCopy() { - return new invokeManagement_result(this); - } - - @Override - public void clear() { - this.success = null; - this.ex = null; - this.ex2 = null; - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { - return this.success; - } - - public invokeManagement_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.SecurityException getEx() { - return this.ex; - } - - public invokeManagement_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { - this.ex = ex; - return this; - } - - public void unsetEx() { - this.ex = null; - } - - /** Returns true if field ex is set (has been assigned a value) and false otherwise */ - public boolean isSetEx() { - return this.ex != null; - } - - public void setExIsSet(boolean value) { - if (!value) { - this.ex = null; - } - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.ManagementException getEx2() { - return this.ex2; - } - - public invokeManagement_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2) { - this.ex2 = ex2; - return this; - } - - public void unsetEx2() { - this.ex2 = null; - } - - /** Returns true if field ex2 is set (has been assigned a value) and false otherwise */ - public boolean isSetEx2() { - return this.ex2 != null; - } - - public void setEx2IsSet(boolean value) { - if (!value) { - this.ex2 = null; - } - } - - @Override - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); - } - break; - - case EX: - if (value == null) { - unsetEx(); - } else { - setEx((com.cinchapi.concourse.thrift.SecurityException)value); - } - break; - - case EX2: - if (value == null) { - unsetEx2(); - } else { - setEx2((com.cinchapi.concourse.thrift.ManagementException)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - @Override - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - case EX: - return getEx(); - - case EX2: - return getEx2(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - @Override - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - case EX: - return isSetEx(); - case EX2: - return isSetEx2(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof invokeManagement_result) - return this.equals((invokeManagement_result)that); - return false; - } - - public boolean equals(invokeManagement_result that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - boolean this_present_ex = true && this.isSetEx(); - boolean that_present_ex = true && that.isSetEx(); - if (this_present_ex || that_present_ex) { - if (!(this_present_ex && that_present_ex)) - return false; - if (!this.ex.equals(that.ex)) - return false; - } - - boolean this_present_ex2 = true && this.isSetEx2(); - boolean that_present_ex2 = true && that.isSetEx2(); - if (this_present_ex2 || that_present_ex2) { - if (!(this_present_ex2 && that_present_ex2)) - return false; - if (!this.ex2.equals(that.ex2)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); - if (isSetEx()) - hashCode = hashCode * 8191 + ex.hashCode(); - - hashCode = hashCode * 8191 + ((isSetEx2()) ? 131071 : 524287); - if (isSetEx2()) - hashCode = hashCode * 8191 + ex2.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(invokeManagement_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetEx(), other.isSetEx()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex, other.ex); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetEx2(), other.isSetEx2()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEx2()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ex2, other.ex2); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - @Override - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - if (!first) sb.append(", "); - sb.append("ex:"); - if (this.ex == null) { - sb.append("null"); - } else { - sb.append(this.ex); - } - first = false; - if (!first) sb.append(", "); - sb.append("ex2:"); - if (this.ex2 == null) { - sb.append("null"); - } else { - sb.append(this.ex2); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class invokeManagement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public invokeManagement_resultStandardScheme getScheme() { - return new invokeManagement_resultStandardScheme(); - } - } - - private static class invokeManagement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 1: // EX - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); - struct.ex.read(iprot); - struct.setExIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // EX2 - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); - struct.ex2.read(iprot); - struct.setEx2IsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.ex != null) { - oprot.writeFieldBegin(EX_FIELD_DESC); - struct.ex.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.ex2 != null) { - oprot.writeFieldBegin(EX2_FIELD_DESC); - struct.ex2.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class invokeManagement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - @Override - public invokeManagement_resultTupleScheme getScheme() { - return new invokeManagement_resultTupleScheme(); - } - } - - private static class invokeManagement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - if (struct.isSetEx()) { - optionals.set(1); - } - if (struct.isSetEx2()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - if (struct.isSetEx()) { - struct.ex.write(oprot); - } - if (struct.isSetEx2()) { - struct.ex2.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - if (incoming.get(1)) { - struct.ex = new com.cinchapi.concourse.thrift.SecurityException(); - struct.ex.read(iprot); - struct.setExIsSet(true); - } - if (incoming.get(2)) { - struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); - struct.ex2.read(iprot); - struct.setEx2IsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class ping_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args"); - - private static final org.apache.thrift.protocol.TField CREDS_FIELD_DESC = new org.apache.thrift.protocol.TField("creds", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField TRANSACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("transaction", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("environment", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ping_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ping_argsTupleSchemeFactory(); - - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction; // required - public @org.apache.thrift.annotation.Nullable java.lang.String environment; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - CREDS((short)1, "creds"), - TRANSACTION((short)2, "transaction"), - ENVIRONMENT((short)3, "environment"); - - private static final java.util.Map byName = new java.util.LinkedHashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // CREDS - return CREDS; - case 2: // TRANSACTION - return TRANSACTION; - case 3: // ENVIRONMENT - return ENVIRONMENT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - @Override - public short getThriftFieldId() { - return _thriftId; - } - - @Override - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.CREDS, new org.apache.thrift.meta_data.FieldMetaData("creds", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.AccessToken.class))); - tmpMap.put(_Fields.TRANSACTION, new org.apache.thrift.meta_data.FieldMetaData("transaction", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.TransactionToken.class))); - tmpMap.put(_Fields.ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("environment", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap); - } - - public ping_args() { - } - - public ping_args( - com.cinchapi.concourse.thrift.AccessToken creds, - com.cinchapi.concourse.thrift.TransactionToken transaction, - java.lang.String environment) - { - this(); - this.creds = creds; - this.transaction = transaction; - this.environment = environment; - } - - /** - * Performs a deep copy on other. - */ - public ping_args(ping_args other) { - if (other.isSetCreds()) { - this.creds = new com.cinchapi.concourse.thrift.AccessToken(other.creds); - } - if (other.isSetTransaction()) { - this.transaction = new com.cinchapi.concourse.thrift.TransactionToken(other.transaction); - } - if (other.isSetEnvironment()) { - this.environment = other.environment; - } - } - - @Override - public ping_args deepCopy() { - return new ping_args(this); - } - - @Override - public void clear() { - this.creds = null; - this.transaction = null; - this.environment = null; - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.AccessToken getCreds() { - return this.creds; - } - - public ping_args setCreds(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.AccessToken creds) { - this.creds = creds; - return this; - } - - public void unsetCreds() { - this.creds = null; - } - - /** Returns true if field creds is set (has been assigned a value) and false otherwise */ - public boolean isSetCreds() { - return this.creds != null; - } - - public void setCredsIsSet(boolean value) { - if (!value) { - this.creds = null; - } - } - - @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.TransactionToken getTransaction() { - return this.transaction; - } - - public ping_args setTransaction(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.TransactionToken transaction) { - this.transaction = transaction; - return this; - } - - public void unsetTransaction() { - this.transaction = null; - } - - /** Returns true if field transaction is set (has been assigned a value) and false otherwise */ - public boolean isSetTransaction() { - return this.transaction != null; - } - - public void setTransactionIsSet(boolean value) { - if (!value) { - this.transaction = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getEnvironment() { - return this.environment; - } - - public ping_args setEnvironment(@org.apache.thrift.annotation.Nullable java.lang.String environment) { - this.environment = environment; - return this; - } - - public void unsetEnvironment() { - this.environment = null; - } - - /** Returns true if field environment is set (has been assigned a value) and false otherwise */ - public boolean isSetEnvironment() { - return this.environment != null; - } - - public void setEnvironmentIsSet(boolean value) { - if (!value) { - this.environment = null; - } - } - - @Override - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case CREDS: - if (value == null) { - unsetCreds(); - } else { - setCreds((com.cinchapi.concourse.thrift.AccessToken)value); - } - break; - - case TRANSACTION: - if (value == null) { - unsetTransaction(); - } else { - setTransaction((com.cinchapi.concourse.thrift.TransactionToken)value); - } - break; - - case ENVIRONMENT: - if (value == null) { - unsetEnvironment(); - } else { - setEnvironment((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - @Override - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case CREDS: - return getCreds(); - - case TRANSACTION: - return getTransaction(); - - case ENVIRONMENT: - return getEnvironment(); - - } - throw new java.lang.IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - @Override - public boolean isSet(_Fields field) { - if (field == null) { - throw new java.lang.IllegalArgumentException(); - } - - switch (field) { - case CREDS: - return isSetCreds(); - case TRANSACTION: - return isSetTransaction(); - case ENVIRONMENT: - return isSetEnvironment(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that instanceof ping_args) - return this.equals((ping_args)that); - return false; - } - - public boolean equals(ping_args that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_creds = true && this.isSetCreds(); - boolean that_present_creds = true && that.isSetCreds(); - if (this_present_creds || that_present_creds) { - if (!(this_present_creds && that_present_creds)) - return false; - if (!this.creds.equals(that.creds)) - return false; - } - - boolean this_present_transaction = true && this.isSetTransaction(); - boolean that_present_transaction = true && that.isSetTransaction(); - if (this_present_transaction || that_present_transaction) { - if (!(this_present_transaction && that_present_transaction)) - return false; - if (!this.transaction.equals(that.transaction)) - return false; - } - - boolean this_present_environment = true && this.isSetEnvironment(); - boolean that_present_environment = true && that.isSetEnvironment(); - if (this_present_environment || that_present_environment) { - if (!(this_present_environment && that_present_environment)) - return false; - if (!this.environment.equals(that.environment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetCreds()) ? 131071 : 524287); - if (isSetCreds()) - hashCode = hashCode * 8191 + creds.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTransaction()) ? 131071 : 524287); - if (isSetTransaction()) - hashCode = hashCode * 8191 + transaction.hashCode(); - - hashCode = hashCode * 8191 + ((isSetEnvironment()) ? 131071 : 524287); - if (isSetEnvironment()) - hashCode = hashCode * 8191 + environment.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ping_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.compare(isSetCreds(), other.isSetCreds()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCreds()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creds, other.creds); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetTransaction(), other.isSetTransaction()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTransaction()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transaction, other.transaction); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.compare(isSetEnvironment(), other.isSetEnvironment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEnvironment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.environment, other.environment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - @Override - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - @Override - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ping_args("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_args("); boolean first = true; - sb.append("creds:"); - if (this.creds == null) { + sb.append("method:"); + if (this.method == null) { sb.append("null"); } else { - sb.append(this.creds); + sb.append(this.method); } first = false; if (!first) sb.append(", "); - sb.append("transaction:"); - if (this.transaction == null) { + sb.append("params:"); + if (this.params == null) { sb.append("null"); } else { - sb.append(this.transaction); + sb.append(this.params); } first = false; if (!first) sb.append(", "); - sb.append("environment:"); - if (this.environment == null) { + sb.append("creds:"); + if (this.creds == null) { sb.append("null"); } else { - sb.append(this.environment); + sb.append(this.creds); } first = false; sb.append(")"); @@ -705084,9 +703671,6 @@ public void validate() throws org.apache.thrift.TException { if (creds != null) { creds.validate(); } - if (transaction != null) { - transaction.validate(); - } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -705105,17 +703689,17 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class ping_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class invokeManagement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public ping_argsStandardScheme getScheme() { - return new ping_argsStandardScheme(); + public invokeManagement_argsStandardScheme getScheme() { + return new invokeManagement_argsStandardScheme(); } } - private static class ping_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class invokeManagement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -705125,28 +703709,38 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) t break; } switch (schemeField.id) { - case 1: // CREDS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); + case 2: // METHOD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.method = iprot.readString(); + struct.setMethodIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TRANSACTION - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.transaction.read(iprot); - struct.setTransactionIsSet(true); + case 3: // PARAMS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list7210 = iprot.readListBegin(); + struct.params = new java.util.ArrayList(_list7210.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7211; + for (int _i7212 = 0; _i7212 < _list7210.size; ++_i7212) + { + _elem7211 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7211.read(iprot); + struct.params.add(_elem7211); + } + iprot.readListEnd(); + } + struct.setParamsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // ENVIRONMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.environment = iprot.readString(); - struct.setEnvironmentIsSet(true); + case 4: // CREDS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -705163,23 +703757,30 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) t } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.creds != null) { - oprot.writeFieldBegin(CREDS_FIELD_DESC); - struct.creds.write(oprot); + if (struct.method != null) { + oprot.writeFieldBegin(METHOD_FIELD_DESC); + oprot.writeString(struct.method); oprot.writeFieldEnd(); } - if (struct.transaction != null) { - oprot.writeFieldBegin(TRANSACTION_FIELD_DESC); - struct.transaction.write(oprot); + if (struct.params != null) { + oprot.writeFieldBegin(PARAMS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.params.size())); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7213 : struct.params) + { + _iter7213.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } - if (struct.environment != null) { - oprot.writeFieldBegin(ENVIRONMENT_FIELD_DESC); - oprot.writeString(struct.environment); + if (struct.creds != null) { + oprot.writeFieldBegin(CREDS_FIELD_DESC); + struct.creds.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -705188,57 +703789,72 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) } - private static class ping_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class invokeManagement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public ping_argsTupleScheme getScheme() { - return new ping_argsTupleScheme(); + public invokeManagement_argsTupleScheme getScheme() { + return new invokeManagement_argsTupleScheme(); } } - private static class ping_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class invokeManagement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCreds()) { + if (struct.isSetMethod()) { optionals.set(0); } - if (struct.isSetTransaction()) { + if (struct.isSetParams()) { optionals.set(1); } - if (struct.isSetEnvironment()) { + if (struct.isSetCreds()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); - if (struct.isSetCreds()) { - struct.creds.write(oprot); + if (struct.isSetMethod()) { + oprot.writeString(struct.method); } - if (struct.isSetTransaction()) { - struct.transaction.write(oprot); + if (struct.isSetParams()) { + { + oprot.writeI32(struct.params.size()); + for (com.cinchapi.concourse.thrift.ComplexTObject _iter7214 : struct.params) + { + _iter7214.write(oprot); + } + } } - if (struct.isSetEnvironment()) { - oprot.writeString(struct.environment); + if (struct.isSetCreds()) { + struct.creds.write(oprot); } } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); - struct.creds.read(iprot); - struct.setCredsIsSet(true); + struct.method = iprot.readString(); + struct.setMethodIsSet(true); } if (incoming.get(1)) { - struct.transaction = new com.cinchapi.concourse.thrift.TransactionToken(); - struct.transaction.read(iprot); - struct.setTransactionIsSet(true); + { + org.apache.thrift.protocol.TList _list7215 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT); + struct.params = new java.util.ArrayList(_list7215.size); + @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject _elem7216; + for (int _i7217 = 0; _i7217 < _list7215.size; ++_i7217) + { + _elem7216 = new com.cinchapi.concourse.thrift.ComplexTObject(); + _elem7216.read(iprot); + struct.params.add(_elem7216); + } + } + struct.setParamsIsSet(true); } if (incoming.get(2)) { - struct.environment = iprot.readString(); - struct.setEnvironmentIsSet(true); + struct.creds = new com.cinchapi.concourse.thrift.AccessToken(); + struct.creds.read(iprot); + struct.setCredsIsSet(true); } } } @@ -705248,19 +703864,19 @@ private static S scheme(org.apache. } } - public static class ping_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_result"); + public static class invokeManagement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("invokeManagement_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField EX_FIELD_DESC = new org.apache.thrift.protocol.TField("ex", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField EX2_FIELD_DESC = new org.apache.thrift.protocol.TField("ex2", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ping_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ping_resultTupleSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new invokeManagement_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new invokeManagement_resultTupleSchemeFactory(); - public boolean success; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success; // required public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex; // required - public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex2; // required + public @org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -705331,32 +703947,29 @@ public java.lang.String getFieldName() { } // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ComplexTObject.class))); tmpMap.put(_Fields.EX, new org.apache.thrift.meta_data.FieldMetaData("ex", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.SecurityException.class))); tmpMap.put(_Fields.EX2, new org.apache.thrift.meta_data.FieldMetaData("ex2", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.PermissionException.class))); + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, com.cinchapi.concourse.thrift.ManagementException.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(invokeManagement_result.class, metaDataMap); } - public ping_result() { + public invokeManagement_result() { } - public ping_result( - boolean success, + public invokeManagement_result( + com.cinchapi.concourse.thrift.ComplexTObject success, com.cinchapi.concourse.thrift.SecurityException ex, - com.cinchapi.concourse.thrift.PermissionException ex2) + com.cinchapi.concourse.thrift.ManagementException ex2) { this(); this.success = success; - setSuccessIsSet(true); this.ex = ex; this.ex2 = ex2; } @@ -705364,51 +703977,53 @@ public ping_result( /** * Performs a deep copy on other. */ - public ping_result(ping_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; + public invokeManagement_result(invokeManagement_result other) { + if (other.isSetSuccess()) { + this.success = new com.cinchapi.concourse.thrift.ComplexTObject(other.success); + } if (other.isSetEx()) { this.ex = new com.cinchapi.concourse.thrift.SecurityException(other.ex); } if (other.isSetEx2()) { - this.ex2 = new com.cinchapi.concourse.thrift.PermissionException(other.ex2); + this.ex2 = new com.cinchapi.concourse.thrift.ManagementException(other.ex2); } } @Override - public ping_result deepCopy() { - return new ping_result(this); + public invokeManagement_result deepCopy() { + return new invokeManagement_result(this); } @Override public void clear() { - setSuccessIsSet(false); - this.success = false; + this.success = null; this.ex = null; this.ex2 = null; } - public boolean isSuccess() { + @org.apache.thrift.annotation.Nullable + public com.cinchapi.concourse.thrift.ComplexTObject getSuccess() { return this.success; } - public ping_result setSuccess(boolean success) { + public invokeManagement_result setSuccess(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ComplexTObject success) { this.success = success; - setSuccessIsSet(true); return this; } public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + return this.success != null; } public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + if (!value) { + this.success = null; + } } @org.apache.thrift.annotation.Nullable @@ -705416,7 +704031,7 @@ public com.cinchapi.concourse.thrift.SecurityException getEx() { return this.ex; } - public ping_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { + public invokeManagement_result setEx(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.SecurityException ex) { this.ex = ex; return this; } @@ -705437,11 +704052,11 @@ public void setExIsSet(boolean value) { } @org.apache.thrift.annotation.Nullable - public com.cinchapi.concourse.thrift.PermissionException getEx2() { + public com.cinchapi.concourse.thrift.ManagementException getEx2() { return this.ex2; } - public ping_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.PermissionException ex2) { + public invokeManagement_result setEx2(@org.apache.thrift.annotation.Nullable com.cinchapi.concourse.thrift.ManagementException ex2) { this.ex2 = ex2; return this; } @@ -705468,7 +704083,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSuccess(); } else { - setSuccess((java.lang.Boolean)value); + setSuccess((com.cinchapi.concourse.thrift.ComplexTObject)value); } break; @@ -705484,7 +704099,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetEx2(); } else { - setEx2((com.cinchapi.concourse.thrift.PermissionException)value); + setEx2((com.cinchapi.concourse.thrift.ManagementException)value); } break; @@ -705496,7 +704111,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: - return isSuccess(); + return getSuccess(); case EX: return getEx(); @@ -705528,23 +704143,23 @@ public boolean isSet(_Fields field) { @Override public boolean equals(java.lang.Object that) { - if (that instanceof ping_result) - return this.equals((ping_result)that); + if (that instanceof invokeManagement_result) + return this.equals((invokeManagement_result)that); return false; } - public boolean equals(ping_result that) { + public boolean equals(invokeManagement_result that) { if (that == null) return false; if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = true; + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; - if (this.success != that.success) + if (!this.success.equals(that.success)) return false; } @@ -705573,7 +704188,9 @@ public boolean equals(ping_result that) { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); hashCode = hashCode * 8191 + ((isSetEx()) ? 131071 : 524287); if (isSetEx()) @@ -705587,7 +704204,7 @@ public int hashCode() { } @Override - public int compareTo(ping_result other) { + public int compareTo(invokeManagement_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -705644,11 +704261,15 @@ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache. @Override public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ping_result("); + java.lang.StringBuilder sb = new java.lang.StringBuilder("invokeManagement_result("); boolean first = true; sb.append("success:"); - sb.append(this.success); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } first = false; if (!first) sb.append(", "); sb.append("ex:"); @@ -705673,6 +704294,9 @@ public java.lang.String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -705685,25 +704309,23 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - private static class ping_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class invokeManagement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public ping_resultStandardScheme getScheme() { - return new ping_resultStandardScheme(); + public invokeManagement_resultStandardScheme getScheme() { + return new invokeManagement_resultStandardScheme(); } } - private static class ping_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class invokeManagement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { @Override - public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol iprot, invokeManagement_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) @@ -705714,8 +704336,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) } switch (schemeField.id) { case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.success = iprot.readBool(); + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -705732,7 +704355,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) break; case 2: // EX2 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.ex2 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); struct.ex2.read(iprot); struct.setEx2IsSet(true); } else { @@ -705751,13 +704374,13 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) } @Override - public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol oprot, invokeManagement_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { + if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(struct.success); + struct.success.write(oprot); oprot.writeFieldEnd(); } if (struct.ex != null) { @@ -705776,17 +704399,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct } - private static class ping_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class invokeManagement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { @Override - public ping_resultTupleScheme getScheme() { - return new ping_resultTupleScheme(); + public invokeManagement_resultTupleScheme getScheme() { + return new invokeManagement_resultTupleScheme(); } } - private static class ping_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class invokeManagement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { + public void write(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { @@ -705800,7 +704423,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) } oprot.writeBitSet(optionals, 3); if (struct.isSetSuccess()) { - oprot.writeBool(struct.success); + struct.success.write(oprot); } if (struct.isSetEx()) { struct.ex.write(oprot); @@ -705811,11 +704434,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) } @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException { + public void read(org.apache.thrift.protocol.TProtocol prot, invokeManagement_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { - struct.success = iprot.readBool(); + struct.success = new com.cinchapi.concourse.thrift.ComplexTObject(); + struct.success.read(iprot); struct.setSuccessIsSet(true); } if (incoming.get(1)) { @@ -705824,7 +704448,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) struct.setExIsSet(true); } if (incoming.get(2)) { - struct.ex2 = new com.cinchapi.concourse.thrift.PermissionException(); + struct.ex2 = new com.cinchapi.concourse.thrift.ManagementException(); struct.ex2.read(iprot); struct.setEx2IsSet(true); } diff --git a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java index 675626e64..09a7feb24 100644 --- a/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java +++ b/concourse-plugin-core/src/main/java/com/cinchapi/concourse/server/plugin/StatefulConcourseService.java @@ -3177,10 +3177,6 @@ public boolean consolidateRecords(List records) { throw new UnsupportedOperationException(); } - public boolean ping() { - throw new UnsupportedOperationException(); - } - public Object sumKeyRecord(String key, long record) { throw new UnsupportedOperationException(); } diff --git a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java index 629d01928..ddbaccf43 100644 --- a/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java +++ b/concourse-server/src/main/java/com/cinchapi/concourse/server/ConcourseServer.java @@ -4273,15 +4273,6 @@ public AccessToken newServiceToken() { return users.tokens.issueServiceToken(); } - @Override - @TranslateClientExceptions - @VerifyAccessToken - @VerifyReadPermission - public boolean ping(AccessToken creds, TransactionToken transaction, - String environment) throws TException { - return true; - } - @Override @TranslateClientExceptions @VerifyAccessToken From 3b806fda547e6565104cb6c7a3cdffa2465d4aa0 Mon Sep 17 00:00:00 2001 From: Jeff Nelson Date: Thu, 2 May 2024 14:19:13 -0400 Subject: [PATCH 7/7] Revert "unit test" This reverts commit 8ade00afe97993e6e961b446538fb4e3a24a86ae. --- .../com/cinchapi/concourse/ete/PingTest.java | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java diff --git a/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java b/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java deleted file mode 100644 index 972d548b4..000000000 --- a/concourse-ete-tests/src/test/java/com/cinchapi/concourse/ete/PingTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2013-2024 Cinchapi Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.cinchapi.concourse.ete; - -import org.junit.Assert; -import org.junit.Test; - -import com.cinchapi.concourse.test.ClientServerTest; -import com.google.common.collect.ImmutableSet; - - -/** - * Unit tests for the ping functionality in Concourse - * - * @author Jeff Nelson - */ -public class PingTest extends ClientServerTest { - - @Test - public void testPingWhenRunning() { - Assert.assertTrue(client.ping()); - } - - @Test - public void testPingWhenStopped() { - Assert.assertTrue(client.ping()); - server.stop(); - Assert.assertFalse(client.ping()); - } - - @Test - public void testPingWhenRestarted() { - Assert.assertTrue(client.ping()); - server.restart(); - Assert.assertFalse(client.ping()); - } - - @Test - public void testPingWhenRestartedAndReconnected() { - Assert.assertTrue(client.ping()); - server.restart(); - Assert.assertFalse(client.ping()); - client = server.connect(); - Assert.assertTrue(client.ping()); - } - - @Test - public void testPingExemptFromExceptions() { - Assert.assertTrue(client.ping()); - Assert.assertEquals(ImmutableSet.of(), client.inventory()); - server.stop(); - try { - client.inventory(); - Assert.fail(); - } - catch(Exception e) { - Assert.assertTrue(true); - } - Assert.assertFalse(client.ping()); - } - - @Override - protected String getServerVersion() { - return ClientServerTest.LATEST_SNAPSHOT_VERSION; - } - -}