You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sm...@apache.org on 2014/02/21 14:55:34 UTC
[1/3] Registry thrift CPI Service - AIRAVATA-1006
Repository: airavata
Updated Branches:
refs/heads/master 362812602 -> 757fbb64a
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/registryCPIConstants.java
----------------------------------------------------------------------
diff --git a/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/registryCPIConstants.java b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/registryCPIConstants.java
new file mode 100644
index 0000000..8895494
--- /dev/null
+++ b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/registryCPIConstants.java
@@ -0,0 +1,55 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.registry.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class registryCPIConstants {
+
+ public static final String REGISTRY_CPI_VERSION = "0.12.0";
+
+}
[2/3] Registry thrift CPI Service - AIRAVATA-1006
Posted by sm...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/RegistryCPIService.java
----------------------------------------------------------------------
diff --git a/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/RegistryCPIService.java b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/RegistryCPIService.java
new file mode 100644
index 0000000..ebe16f9
--- /dev/null
+++ b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/RegistryCPIService.java
@@ -0,0 +1,2797 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.registry.cpi;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class RegistryCPIService {
+
+ public interface Iface {
+
+ /**
+ * Query registry server to fetch the CPI version
+ */
+ public String getRegistryCPIVersion() throws org.apache.thrift.TException;
+
+ public String createParentObject(ParentDataType parentDataType, ByteBuffer objectToCreate) throws org.apache.thrift.TException;
+
+ public boolean isExists(DataType dataType, String objectId) throws org.apache.thrift.TException;
+
+ }
+
+ public interface AsyncIface {
+
+ public void getRegistryCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void createParentObject(ParentDataType parentDataType, ByteBuffer objectToCreate, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ public void isExists(DataType dataType, String objectId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+ }
+
+ public static class Client extends org.apache.thrift.TServiceClient implements Iface {
+ public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
+ public Factory() {}
+ public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
+ return new Client(prot);
+ }
+ public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ return new Client(iprot, oprot);
+ }
+ }
+
+ public Client(org.apache.thrift.protocol.TProtocol prot)
+ {
+ super(prot, prot);
+ }
+
+ public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
+ super(iprot, oprot);
+ }
+
+ public String getRegistryCPIVersion() throws org.apache.thrift.TException
+ {
+ send_getRegistryCPIVersion();
+ return recv_getRegistryCPIVersion();
+ }
+
+ public void send_getRegistryCPIVersion() throws org.apache.thrift.TException
+ {
+ getRegistryCPIVersion_args args = new getRegistryCPIVersion_args();
+ sendBase("getRegistryCPIVersion", args);
+ }
+
+ public String recv_getRegistryCPIVersion() throws org.apache.thrift.TException
+ {
+ getRegistryCPIVersion_result result = new getRegistryCPIVersion_result();
+ receiveBase(result, "getRegistryCPIVersion");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getRegistryCPIVersion failed: unknown result");
+ }
+
+ public String createParentObject(ParentDataType parentDataType, ByteBuffer objectToCreate) throws org.apache.thrift.TException
+ {
+ send_createParentObject(parentDataType, objectToCreate);
+ return recv_createParentObject();
+ }
+
+ public void send_createParentObject(ParentDataType parentDataType, ByteBuffer objectToCreate) throws org.apache.thrift.TException
+ {
+ createParentObject_args args = new createParentObject_args();
+ args.setParentDataType(parentDataType);
+ args.setObjectToCreate(objectToCreate);
+ sendBase("createParentObject", args);
+ }
+
+ public String recv_createParentObject() throws org.apache.thrift.TException
+ {
+ createParentObject_result result = new createParentObject_result();
+ receiveBase(result, "createParentObject");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createParentObject failed: unknown result");
+ }
+
+ public boolean isExists(DataType dataType, String objectId) throws org.apache.thrift.TException
+ {
+ send_isExists(dataType, objectId);
+ return recv_isExists();
+ }
+
+ public void send_isExists(DataType dataType, String objectId) throws org.apache.thrift.TException
+ {
+ isExists_args args = new isExists_args();
+ args.setDataType(dataType);
+ args.setObjectId(objectId);
+ sendBase("isExists", args);
+ }
+
+ public boolean recv_isExists() throws org.apache.thrift.TException
+ {
+ isExists_result result = new isExists_result();
+ receiveBase(result, "isExists");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isExists 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<AsyncClient> {
+ private org.apache.thrift.async.TAsyncClientManager clientManager;
+ private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
+ public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
+ this.clientManager = clientManager;
+ this.protocolFactory = protocolFactory;
+ }
+ public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
+ return new AsyncClient(protocolFactory, clientManager, transport);
+ }
+ }
+
+ public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
+ super(protocolFactory, clientManager, transport);
+ }
+
+ public void getRegistryCPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getRegistryCPIVersion_call method_call = new getRegistryCPIVersion_call(resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getRegistryCPIVersion_call extends org.apache.thrift.async.TAsyncMethodCall {
+ public getRegistryCPIVersion_call(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);
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getRegistryCPIVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getRegistryCPIVersion_args args = new getRegistryCPIVersion_args();
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public String getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new 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_getRegistryCPIVersion();
+ }
+ }
+
+ public void createParentObject(ParentDataType parentDataType, ByteBuffer objectToCreate, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ createParentObject_call method_call = new createParentObject_call(parentDataType, objectToCreate, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class createParentObject_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private ParentDataType parentDataType;
+ private ByteBuffer objectToCreate;
+ public createParentObject_call(ParentDataType parentDataType, ByteBuffer objectToCreate, 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.parentDataType = parentDataType;
+ this.objectToCreate = objectToCreate;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createParentObject", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ createParentObject_args args = new createParentObject_args();
+ args.setParentDataType(parentDataType);
+ args.setObjectToCreate(objectToCreate);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public String getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new 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_createParentObject();
+ }
+ }
+
+ public void isExists(DataType dataType, String objectId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ isExists_call method_call = new isExists_call(dataType, objectId, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class isExists_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private DataType dataType;
+ private String objectId;
+ public isExists_call(DataType dataType, String objectId, 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.dataType = dataType;
+ this.objectId = objectId;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isExists", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ isExists_args args = new isExists_args();
+ args.setDataType(dataType);
+ args.setObjectId(objectId);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public boolean getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new 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_isExists();
+ }
+ }
+
+ }
+
+ public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
+ public Processor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
+ }
+
+ protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ super(iface, getProcessMap(processMap));
+ }
+
+ private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
+ processMap.put("getRegistryCPIVersion", new getRegistryCPIVersion());
+ processMap.put("createParentObject", new createParentObject());
+ processMap.put("isExists", new isExists());
+ return processMap;
+ }
+
+ public static class getRegistryCPIVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getRegistryCPIVersion_args> {
+ public getRegistryCPIVersion() {
+ super("getRegistryCPIVersion");
+ }
+
+ public getRegistryCPIVersion_args getEmptyArgsInstance() {
+ return new getRegistryCPIVersion_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getRegistryCPIVersion_result getResult(I iface, getRegistryCPIVersion_args args) throws org.apache.thrift.TException {
+ getRegistryCPIVersion_result result = new getRegistryCPIVersion_result();
+ result.success = iface.getRegistryCPIVersion();
+ return result;
+ }
+ }
+
+ public static class createParentObject<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createParentObject_args> {
+ public createParentObject() {
+ super("createParentObject");
+ }
+
+ public createParentObject_args getEmptyArgsInstance() {
+ return new createParentObject_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public createParentObject_result getResult(I iface, createParentObject_args args) throws org.apache.thrift.TException {
+ createParentObject_result result = new createParentObject_result();
+ result.success = iface.createParentObject(args.parentDataType, args.objectToCreate);
+ return result;
+ }
+ }
+
+ public static class isExists<I extends Iface> extends org.apache.thrift.ProcessFunction<I, isExists_args> {
+ public isExists() {
+ super("isExists");
+ }
+
+ public isExists_args getEmptyArgsInstance() {
+ return new isExists_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public isExists_result getResult(I iface, isExists_args args) throws org.apache.thrift.TException {
+ isExists_result result = new isExists_result();
+ result.success = iface.isExists(args.dataType, args.objectId);
+ result.setSuccessIsSet(true);
+ return result;
+ }
+ }
+
+ }
+
+ public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
+ public AsyncProcessor(I iface) {
+ super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
+ }
+
+ protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ super(iface, getProcessMap(processMap));
+ }
+
+ private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
+ processMap.put("getRegistryCPIVersion", new getRegistryCPIVersion());
+ processMap.put("createParentObject", new createParentObject());
+ processMap.put("isExists", new isExists());
+ return processMap;
+ }
+
+ public static class getRegistryCPIVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getRegistryCPIVersion_args, String> {
+ public getRegistryCPIVersion() {
+ super("getRegistryCPIVersion");
+ }
+
+ public getRegistryCPIVersion_args getEmptyArgsInstance() {
+ return new getRegistryCPIVersion_args();
+ }
+
+ public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<String>() {
+ public void onComplete(String o) {
+ getRegistryCPIVersion_result result = new getRegistryCPIVersion_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ getRegistryCPIVersion_result result = new getRegistryCPIVersion_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, getRegistryCPIVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.getRegistryCPIVersion(resultHandler);
+ }
+ }
+
+ public static class createParentObject<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createParentObject_args, String> {
+ public createParentObject() {
+ super("createParentObject");
+ }
+
+ public createParentObject_args getEmptyArgsInstance() {
+ return new createParentObject_args();
+ }
+
+ public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<String>() {
+ public void onComplete(String o) {
+ createParentObject_result result = new createParentObject_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ createParentObject_result result = new createParentObject_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, createParentObject_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
+ iface.createParentObject(args.parentDataType, args.objectToCreate,resultHandler);
+ }
+ }
+
+ public static class isExists<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, isExists_args, Boolean> {
+ public isExists() {
+ super("isExists");
+ }
+
+ public isExists_args getEmptyArgsInstance() {
+ return new isExists_args();
+ }
+
+ public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Boolean>() {
+ public void onComplete(Boolean o) {
+ isExists_result result = new isExists_result();
+ result.success = o;
+ result.setSuccessIsSet(true);
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ isExists_result result = new isExists_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, isExists_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
+ iface.isExists(args.dataType, args.objectId,resultHandler);
+ }
+ }
+
+ }
+
+ public static class getRegistryCPIVersion_args implements org.apache.thrift.TBase<getRegistryCPIVersion_args, getRegistryCPIVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getRegistryCPIVersion_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegistryCPIVersion_args");
+
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getRegistryCPIVersion_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getRegistryCPIVersion_argsTupleSchemeFactory());
+ }
+
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+;
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegistryCPIVersion_args.class, metaDataMap);
+ }
+
+ public getRegistryCPIVersion_args() {
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getRegistryCPIVersion_args(getRegistryCPIVersion_args other) {
+ }
+
+ public getRegistryCPIVersion_args deepCopy() {
+ return new getRegistryCPIVersion_args(this);
+ }
+
+ @Override
+ public void clear() {
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getRegistryCPIVersion_args)
+ return this.equals((getRegistryCPIVersion_args)that);
+ return false;
+ }
+
+ public boolean equals(getRegistryCPIVersion_args that) {
+ if (that == null)
+ return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getRegistryCPIVersion_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getRegistryCPIVersion_args(");
+ boolean first = true;
+
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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, 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 getRegistryCPIVersion_argsStandardSchemeFactory implements SchemeFactory {
+ public getRegistryCPIVersion_argsStandardScheme getScheme() {
+ return new getRegistryCPIVersion_argsStandardScheme();
+ }
+ }
+
+ private static class getRegistryCPIVersion_argsStandardScheme extends StandardScheme<getRegistryCPIVersion_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getRegistryCPIVersion_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) {
+ 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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getRegistryCPIVersion_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getRegistryCPIVersion_argsTupleSchemeFactory implements SchemeFactory {
+ public getRegistryCPIVersion_argsTupleScheme getScheme() {
+ return new getRegistryCPIVersion_argsTupleScheme();
+ }
+ }
+
+ private static class getRegistryCPIVersion_argsTupleScheme extends TupleScheme<getRegistryCPIVersion_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getRegistryCPIVersion_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getRegistryCPIVersion_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ }
+ }
+
+ }
+
+ public static class getRegistryCPIVersion_result implements org.apache.thrift.TBase<getRegistryCPIVersion_result, getRegistryCPIVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<getRegistryCPIVersion_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getRegistryCPIVersion_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getRegistryCPIVersion_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getRegistryCPIVersion_resultTupleSchemeFactory());
+ }
+
+ public String success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getRegistryCPIVersion_result.class, metaDataMap);
+ }
+
+ public getRegistryCPIVersion_result() {
+ }
+
+ public getRegistryCPIVersion_result(
+ String success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getRegistryCPIVersion_result(getRegistryCPIVersion_result other) {
+ if (other.isSetSuccess()) {
+ this.success = other.success;
+ }
+ }
+
+ public getRegistryCPIVersion_result deepCopy() {
+ return new getRegistryCPIVersion_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public String getSuccess() {
+ return this.success;
+ }
+
+ public getRegistryCPIVersion_result setSuccess(String 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;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getRegistryCPIVersion_result)
+ return this.equals((getRegistryCPIVersion_result)that);
+ return false;
+ }
+
+ public boolean equals(getRegistryCPIVersion_result that) {
+ if (that == null)
+ return false;
+
+ 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;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getRegistryCPIVersion_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("getRegistryCPIVersion_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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, 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 getRegistryCPIVersion_resultStandardSchemeFactory implements SchemeFactory {
+ public getRegistryCPIVersion_resultStandardScheme getScheme() {
+ return new getRegistryCPIVersion_resultStandardScheme();
+ }
+ }
+
+ private static class getRegistryCPIVersion_resultStandardScheme extends StandardScheme<getRegistryCPIVersion_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getRegistryCPIVersion_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.STRING) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getRegistryCPIVersion_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeString(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getRegistryCPIVersion_resultTupleSchemeFactory implements SchemeFactory {
+ public getRegistryCPIVersion_resultTupleScheme getScheme() {
+ return new getRegistryCPIVersion_resultTupleScheme();
+ }
+ }
+
+ private static class getRegistryCPIVersion_resultTupleScheme extends TupleScheme<getRegistryCPIVersion_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getRegistryCPIVersion_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeString(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getRegistryCPIVersion_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class createParentObject_args implements org.apache.thrift.TBase<createParentObject_args, createParentObject_args._Fields>, java.io.Serializable, Cloneable, Comparable<createParentObject_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createParentObject_args");
+
+ private static final org.apache.thrift.protocol.TField PARENT_DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("parentDataType", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField OBJECT_TO_CREATE_FIELD_DESC = new org.apache.thrift.protocol.TField("objectToCreate", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new createParentObject_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new createParentObject_argsTupleSchemeFactory());
+ }
+
+ /**
+ *
+ * @see ParentDataType
+ */
+ public ParentDataType parentDataType; // required
+ public ByteBuffer objectToCreate; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see ParentDataType
+ */
+ PARENT_DATA_TYPE((short)1, "parentDataType"),
+ OBJECT_TO_CREATE((short)2, "objectToCreate");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // PARENT_DATA_TYPE
+ return PARENT_DATA_TYPE;
+ case 2: // OBJECT_TO_CREATE
+ return OBJECT_TO_CREATE;
+ 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.PARENT_DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("parentDataType", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ParentDataType.class)));
+ tmpMap.put(_Fields.OBJECT_TO_CREATE, new org.apache.thrift.meta_data.FieldMetaData("objectToCreate", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createParentObject_args.class, metaDataMap);
+ }
+
+ public createParentObject_args() {
+ }
+
+ public createParentObject_args(
+ ParentDataType parentDataType,
+ ByteBuffer objectToCreate)
+ {
+ this();
+ this.parentDataType = parentDataType;
+ this.objectToCreate = objectToCreate;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public createParentObject_args(createParentObject_args other) {
+ if (other.isSetParentDataType()) {
+ this.parentDataType = other.parentDataType;
+ }
+ if (other.isSetObjectToCreate()) {
+ this.objectToCreate = org.apache.thrift.TBaseHelper.copyBinary(other.objectToCreate);
+;
+ }
+ }
+
+ public createParentObject_args deepCopy() {
+ return new createParentObject_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.parentDataType = null;
+ this.objectToCreate = null;
+ }
+
+ /**
+ *
+ * @see ParentDataType
+ */
+ public ParentDataType getParentDataType() {
+ return this.parentDataType;
+ }
+
+ /**
+ *
+ * @see ParentDataType
+ */
+ public createParentObject_args setParentDataType(ParentDataType parentDataType) {
+ this.parentDataType = parentDataType;
+ return this;
+ }
+
+ public void unsetParentDataType() {
+ this.parentDataType = null;
+ }
+
+ /** Returns true if field parentDataType is set (has been assigned a value) and false otherwise */
+ public boolean isSetParentDataType() {
+ return this.parentDataType != null;
+ }
+
+ public void setParentDataTypeIsSet(boolean value) {
+ if (!value) {
+ this.parentDataType = null;
+ }
+ }
+
+ public byte[] getObjectToCreate() {
+ setObjectToCreate(org.apache.thrift.TBaseHelper.rightSize(objectToCreate));
+ return objectToCreate == null ? null : objectToCreate.array();
+ }
+
+ public ByteBuffer bufferForObjectToCreate() {
+ return objectToCreate;
+ }
+
+ public createParentObject_args setObjectToCreate(byte[] objectToCreate) {
+ setObjectToCreate(objectToCreate == null ? (ByteBuffer)null : ByteBuffer.wrap(objectToCreate));
+ return this;
+ }
+
+ public createParentObject_args setObjectToCreate(ByteBuffer objectToCreate) {
+ this.objectToCreate = objectToCreate;
+ return this;
+ }
+
+ public void unsetObjectToCreate() {
+ this.objectToCreate = null;
+ }
+
+ /** Returns true if field objectToCreate is set (has been assigned a value) and false otherwise */
+ public boolean isSetObjectToCreate() {
+ return this.objectToCreate != null;
+ }
+
+ public void setObjectToCreateIsSet(boolean value) {
+ if (!value) {
+ this.objectToCreate = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case PARENT_DATA_TYPE:
+ if (value == null) {
+ unsetParentDataType();
+ } else {
+ setParentDataType((ParentDataType)value);
+ }
+ break;
+
+ case OBJECT_TO_CREATE:
+ if (value == null) {
+ unsetObjectToCreate();
+ } else {
+ setObjectToCreate((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case PARENT_DATA_TYPE:
+ return getParentDataType();
+
+ case OBJECT_TO_CREATE:
+ return getObjectToCreate();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case PARENT_DATA_TYPE:
+ return isSetParentDataType();
+ case OBJECT_TO_CREATE:
+ return isSetObjectToCreate();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof createParentObject_args)
+ return this.equals((createParentObject_args)that);
+ return false;
+ }
+
+ public boolean equals(createParentObject_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_parentDataType = true && this.isSetParentDataType();
+ boolean that_present_parentDataType = true && that.isSetParentDataType();
+ if (this_present_parentDataType || that_present_parentDataType) {
+ if (!(this_present_parentDataType && that_present_parentDataType))
+ return false;
+ if (!this.parentDataType.equals(that.parentDataType))
+ return false;
+ }
+
+ boolean this_present_objectToCreate = true && this.isSetObjectToCreate();
+ boolean that_present_objectToCreate = true && that.isSetObjectToCreate();
+ if (this_present_objectToCreate || that_present_objectToCreate) {
+ if (!(this_present_objectToCreate && that_present_objectToCreate))
+ return false;
+ if (!this.objectToCreate.equals(that.objectToCreate))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(createParentObject_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetParentDataType()).compareTo(other.isSetParentDataType());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetParentDataType()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentDataType, other.parentDataType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetObjectToCreate()).compareTo(other.isSetObjectToCreate());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetObjectToCreate()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectToCreate, other.objectToCreate);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("createParentObject_args(");
+ boolean first = true;
+
+ sb.append("parentDataType:");
+ if (this.parentDataType == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.parentDataType);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("objectToCreate:");
+ if (this.objectToCreate == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.objectToCreate, sb);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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, 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 createParentObject_argsStandardSchemeFactory implements SchemeFactory {
+ public createParentObject_argsStandardScheme getScheme() {
+ return new createParentObject_argsStandardScheme();
+ }
+ }
+
+ private static class createParentObject_argsStandardScheme extends StandardScheme<createParentObject_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, createParentObject_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 1: // PARENT_DATA_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.parentDataType = ParentDataType.findByValue(iprot.readI32());
+ struct.setParentDataTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // OBJECT_TO_CREATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.objectToCreate = iprot.readBinary();
+ struct.setObjectToCreateIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, createParentObject_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.parentDataType != null) {
+ oprot.writeFieldBegin(PARENT_DATA_TYPE_FIELD_DESC);
+ oprot.writeI32(struct.parentDataType.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.objectToCreate != null) {
+ oprot.writeFieldBegin(OBJECT_TO_CREATE_FIELD_DESC);
+ oprot.writeBinary(struct.objectToCreate);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class createParentObject_argsTupleSchemeFactory implements SchemeFactory {
+ public createParentObject_argsTupleScheme getScheme() {
+ return new createParentObject_argsTupleScheme();
+ }
+ }
+
+ private static class createParentObject_argsTupleScheme extends TupleScheme<createParentObject_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, createParentObject_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetParentDataType()) {
+ optionals.set(0);
+ }
+ if (struct.isSetObjectToCreate()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetParentDataType()) {
+ oprot.writeI32(struct.parentDataType.getValue());
+ }
+ if (struct.isSetObjectToCreate()) {
+ oprot.writeBinary(struct.objectToCreate);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, createParentObject_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(2);
+ if (incoming.get(0)) {
+ struct.parentDataType = ParentDataType.findByValue(iprot.readI32());
+ struct.setParentDataTypeIsSet(true);
+ }
+ if (incoming.get(1)) {
+ struct.objectToCreate = iprot.readBinary();
+ struct.setObjectToCreateIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class createParentObject_result implements org.apache.thrift.TBase<createParentObject_result, createParentObject_result._Fields>, java.io.Serializable, Cloneable, Comparable<createParentObject_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createParentObject_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new createParentObject_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new createParentObject_resultTupleSchemeFactory());
+ }
+
+ public String success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new 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.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createParentObject_result.class, metaDataMap);
+ }
+
+ public createParentObject_result() {
+ }
+
+ public createParentObject_result(
+ String success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public createParentObject_result(createParentObject_result other) {
+ if (other.isSetSuccess()) {
+ this.success = other.success;
+ }
+ }
+
+ public createParentObject_result deepCopy() {
+ return new createParentObject_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public String getSuccess() {
+ return this.success;
+ }
+
+ public createParentObject_result setSuccess(String 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;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof createParentObject_result)
+ return this.equals((createParentObject_result)that);
+ return false;
+ }
+
+ public boolean equals(createParentObject_result that) {
+ if (that == null)
+ return false;
+
+ 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;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(createParentObject_result other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetSuccess()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("createParentObject_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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, 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 createParentObject_resultStandardSchemeFactory implements SchemeFactory {
+ public createParentObject_resultStandardScheme getScheme() {
+ return new createParentObject_resultStandardScheme();
+ }
+ }
+
+ private static class createParentObject_resultStandardScheme extends StandardScheme<createParentObject_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, createParentObject_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.STRING) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, createParentObject_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ oprot.writeString(struct.success);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class createParentObject_resultTupleSchemeFactory implements SchemeFactory {
+ public createParentObject_resultTupleScheme getScheme() {
+ return new createParentObject_resultTupleScheme();
+ }
+ }
+
+ private static class createParentObject_resultTupleScheme extends TupleScheme<createParentObject_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, createParentObject_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ oprot.writeString(struct.success);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, createParentObject_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.success = iprot.readString();
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class isExists_args implements org.apache.thrift.TBase<isExists_args, isExists_args._Fields>, java.io.Serializable, Cloneable, Comparable<isExists_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("isExists_args");
+
+ private static final org.apache.thrift.protocol.TField DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dataType", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField OBJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("objectId", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new isExists_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new isExists_argsTupleSchemeFactory());
+ }
+
+ /**
+ *
+ * @see DataType
+ */
+ public DataType dataType; // required
+ public String objectId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see DataType
+ */
+ DATA_TYPE((short)1, "dataType"),
+ OBJECT_ID((short)2, "objectId");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // DATA_TYPE
+ return DATA_TYPE;
+ case 2: // OBJECT_ID
+ return OBJECT_ID;
+ 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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dataType", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DataType.class)));
+ tmpMap.put(_Fields.OBJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("objectId", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(isExists_args.class, metaDataMap);
+ }
+
+ public isExists_args() {
+ }
+
+ public isExists_args(
+ DataType dataType,
+ String objectId)
+ {
+ this();
+ this.dataType = dataType;
+ this.objectId = objectId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public isExists_args(isExists_args other) {
+ if (other.isSetDataType()) {
+ this.dataType = other.dataType;
+ }
+ if (other.isSetObjectId()) {
+ this.objectId = other.objectId;
+ }
+ }
+
+ public isExists_args deepCopy() {
+ return new isExists_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.dataType = null;
+ this.objectId = null;
+ }
+
+ /**
+ *
+ * @see DataType
+ */
+ public DataType getDataType() {
+ return this.dataType;
+ }
+
+ /**
+ *
+ * @see DataType
+ */
+ public isExists_args setDataType(DataType dataType) {
+ this.dataType = dataType;
+ return this;
+ }
+
+ public void unsetDataType() {
+ this.dataType = null;
+ }
+
+ /** Returns true if field dataType is set (has been assigned a value) and false otherwise */
+ public boolean isSetDataType() {
+ return this.dataType != null;
+ }
+
+ public void setDataTypeIsSet(boolean value) {
+ if (!value) {
+ this.dataType = null;
+ }
+ }
+
+ public String getObjectId() {
+ return this.objectId;
+ }
+
+ public isExists_args setObjectId(String objectId) {
+ this.objectId = objectId;
+ return this;
+ }
+
+ public void unsetObjectId() {
+ this.objectId = null;
+ }
+
+ /** Returns true if field objectId is set (has been assigned a value) and false otherwise */
+ public boolean isSetObjectId() {
+ return this.objectId != null;
+ }
+
+ public void setObjectIdIsSet(boolean value) {
+ if (!value) {
+ this.objectId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case DATA_TYPE:
+ if (value == null) {
+ unsetDataType();
+ } else {
+ setDataType((DataType)value);
+ }
+ break;
+
+ case OBJECT_ID:
+ if (value == null) {
+ unsetObjectId();
+ } else {
+ setObjectId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case DATA_TYPE:
+ return getDataType();
+
+ case OBJECT_ID:
+ return getObjectId();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case DATA_TYPE:
+ return isSetDataType();
+ case OBJECT_ID:
+ return isSetObjectId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof isExists_args)
+ return this.equals((isExists_args)that);
+ return false;
+ }
+
+ public boolean equals(isExists_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_dataType = true && this.isSetDataType();
+ boolean that_present_dataType = true && that.isSetDataType();
+ if (this_present_dataType || that_present_dataType) {
+ if (!(this_present_dataType && that_present_dataType))
+ return false;
+ if (!this.dataType.equals(that.dataType))
+ return false;
+ }
+
+ boolean this_present_objectId = true && this.isSetObjectId();
+ boolean that_present_objectId = true && that.isSetObjectId();
+ if (this_present_objectId || that_present_objectId) {
+ if (!(this_present_objectId && that_present_objectId))
+ return false;
+ if (!this.objectId.equals(that.objectId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(isExists_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetDataType()).compareTo(other.isSetDataType());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetDataType()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataType, other.dataType);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetObjectId()).compareTo(other.isSetObjectId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetObjectId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectId, other.objectId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("isExists_args(");
+ boolean first = true;
+
+ sb.append("dataType:");
+ if (this.dataType == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.dataType);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("objectId:");
+ if (this.objectId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.objectId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ 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, 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 isExists_argsStandardSchemeFactory implements SchemeFactory {
+ public isExists_argsStandardScheme getScheme() {
+ return new isExists_argsStandardScheme();
+ }
+ }
+
+ private static class isExists_argsStandardScheme extends StandardScheme<isExists_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, isExists_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 1: // DATA_TYPE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.dataType = DataType.findByValue(iprot.readI32());
+ struct.setDataTypeIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // OBJECT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.objectId = iprot.readString();
+ struct.setObjectIdIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, isExists_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.dataType != null) {
+ oprot.writeFieldBegin(DATA_TYPE_FIELD_DESC);
+ oprot.writeI32(struct.dataType.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.objectId != null) {
+ oprot.writeFieldBegin(OBJECT_ID_FIELD_DESC);
+ oprot.writeString(struct.objectId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class isExists_argsTupleSchemeFactory implements SchemeFactory {
+ public isExists_argsTupleScheme getScheme() {
+ return new isExists_argsTupleScheme();
+ }
+ }
+
+ private static class isExists_argsTupleScheme extends TupleScheme<isExists_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, isExists_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetDataType()) {
+ optionals.set(0);
+ }
+ if (struct.isSetObjectId()) {
+ optionals.set(1);
+ }
+ oprot.writeBitSet(optionals, 2);
+ if (struct.isSetDataType()) {
+ oprot.writeI32(struct.dataType.getValue());
+ }
+ if (struct.isSetObjectId()) {
+ oprot.writeString(struct.objectId);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, isExists_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTuple
<TRUNCATED>
[3/3] git commit: Registry thrift CPI Service - AIRAVATA-1006
Posted by sm...@apache.org.
Registry thrift CPI Service - AIRAVATA-1006
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/757fbb64
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/757fbb64
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/757fbb64
Branch: refs/heads/master
Commit: 757fbb64aca7af1b4465807bac32485bb94403a0
Parents: 3628126
Author: Suresh Marru <sm...@apache.org>
Authored: Fri Feb 21 08:55:25 2014 -0500
Committer: Suresh Marru <sm...@apache.org>
Committed: Fri Feb 21 08:55:25 2014 -0500
----------------------------------------------------------------------
.../generate-cpi-stubs.sh | 133 +
.../cpi-thrift-descriptions/registryCPI.thrift | 94 +
.../airavata/registry/cpi/ChildDataType.java | 106 +
.../apache/airavata/registry/cpi/DataType.java | 121 +
.../airavata/registry/cpi/ParentDataType.java | 70 +
.../registry/cpi/RegistryCPIService.java | 2797 ++++++++++++++++++
.../registry/cpi/registryCPIConstants.java | 55 +
7 files changed, 3376 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/cpi-thrift-descriptions/generate-cpi-stubs.sh
----------------------------------------------------------------------
diff --git a/component-services/cpi-thrift-descriptions/generate-cpi-stubs.sh b/component-services/cpi-thrift-descriptions/generate-cpi-stubs.sh
new file mode 100755
index 0000000..da15244
--- /dev/null
+++ b/component-services/cpi-thrift-descriptions/generate-cpi-stubs.sh
@@ -0,0 +1,133 @@
+#! /usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# This script will regenerate the thrift code for Airavata Server Skeltons, Client Stubs and Data Model java beans.
+#
+# Credit: This script was created referring to Apache Accumulo project and tuned to Airavata Needs.
+
+# Global Constants used across the script
+REQUIRED_THRIFT_VERSION='0.9.1'
+BASE_TARGET_DIR='target'
+REGISTRY_CPI_DIR='../registry-cpi-service/src/main/java'
+
+# The Funcation fail prints error messages on failure and quits the script.
+fail() {
+ echo $@
+ exit 1
+}
+
+# The funcation add_license_header adds the ASF V2 license header to all java files within the specified generated
+# directory. The funcation also adds suppress all warnings annotation to all public classes and enum's
+# To Call:
+# add_license_header $generated_code_directory
+add_license_header() {
+
+ # Fetch the generated code directory passed as the argument
+ GENERATED_CODE_DIR=$1
+
+ # For all generated thrift code, add the suppress all warnings annotation
+ # NOTE: In order to save the orginal file as a backup, use sed -i.orig in place of sed -i ''
+ find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public class /@SuppressWarnings("all") public class /'
+ find ${GENERATED_CODE_DIR} -name '*.java' -print0 | xargs -0 sed -i '' -e 's/public enum /@SuppressWarnings("all") public enum /'
+
+ # For each java file within the genrated directory, add the ASF V2 LICENSE header
+ for f in $(find ${GENERATED_CODE_DIR} -name '*.java'); do
+ cat - ${f} >${f}-with-license <<EOF
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+EOF
+ mv ${f}-with-license ${f}
+ done
+}
+
+# The funcation compares every generated java file with the one in specified existing source location. If the comparision
+# shows a difference, then it replaces with the newly generated file (with added license header).
+# To Call:
+# copy_changed_files $generated_code_directory $existing_source_directory
+copy_changed_files() {
+
+ # Read all the funcation arguments
+ GENERATED_CODE_DIR=$1
+ WORKSPACE_SRC_DIR=$2
+
+ echo "Generated sources are in ${GENERATED_CODE_DIR}"
+ echo "Destination workspace is in ${WORKSPACE_SRC_DIR}"
+
+ # Check if the newly generated files exist in the targetted workspace, if not copy. Only changed files will be synced.
+ # the extra slash to GENERATED_CODE_DIR is needed to ensure the parent directory itself is not copied.
+ rsync -auv ${GENERATED_CODE_DIR}/ ${WORKSPACE_SRC_DIR}
+}
+
+# Generation of thrift files will require installing Apache Thrift. Please add thrift to your path.
+# Verify is thrift is installed, is in the path is at a specified version.
+VERSION=$(thrift -version 2>/dev/null | grep -F "${REQUIRED_THRIFT_VERSION}" | wc -l)
+if [ "$VERSION" -ne 1 ] ; then
+ echo "****************************************************"
+ echo "*** thrift is not installed or is not in the path"
+ echo "*** expecting 'thrift -version' to return ${REQUIRED_THRIFT_VERSION}"
+ echo "*** generated code will not be updated"
+ fail "****************************************************"
+fi
+
+# Initialize the thrift arguements.
+# Since most of the Airavata API and Data Models have includes, use recursive option by defualt.
+# Generate all the files in target directory
+THRIFT_ARGS="-r -o ${BASE_TARGET_DIR}"
+# Ensure the required target directories exists, if not create.
+mkdir -p ${BASE_TARGET_DIR}
+
+#######################################################################
+# Generate/Update the registry CPI service stubs
+# To start with both the servicer and client are in same package, but
+# needs to be split using a common generated api-boilerplate-code
+#######################################################################
+
+#Java generation directory
+JAVA_GEN_DIR=${BASE_TARGET_DIR}/gen-java
+
+# As a precausion remove and previously generated files if exists
+rm -rf ${JAVA_GEN_DIR}
+
+# Using thrify Java generator, generate the java classes based on Airavata API. This
+# The airavataAPI.thrift includes rest of data models.
+thrift ${THRIFT_ARGS} --gen java registryCPI.thrift || fail unable to generate java thrift classes
+
+# For the generated java classes add the ASF V2 License header
+add_license_header $JAVA_GEN_DIR
+
+# Compare the newly generated classes with existing java generated skelton/stub sources and replace the changed ones.
+copy_changed_files ${JAVA_GEN_DIR} ${REGISTRY_CPI_DIR}
+
+# CleanUp: Delete the base target build directory
+#rm -rf ${BASE_TARGET_DIR}
+
+echo "Successfully generated new sources, compared against exiting code and replaced the changed files"
+exit 0
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/cpi-thrift-descriptions/registryCPI.thrift
----------------------------------------------------------------------
diff --git a/component-services/cpi-thrift-descriptions/registryCPI.thrift b/component-services/cpi-thrift-descriptions/registryCPI.thrift
new file mode 100644
index 0000000..89060b4
--- /dev/null
+++ b/component-services/cpi-thrift-descriptions/registryCPI.thrift
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ *
+ */
+
+/*
+ * Component Programming Interface definition for Apache Airavata Registry Service.
+ *
+*/
+
+
+namespace java org.apache.airavata.registry.cpi
+
+const string REGISTRY_CPI_VERSION = "0.12.0"
+
+enum ParentDataType {
+ APPLiCATION_CATALOG,
+ GROUP,
+ USER,
+ PROJECT,
+ EXPERIMENT
+}
+
+enum ChildDataType {
+ EXPERIMENT_INPUT,
+ EXPERIMENT_OUTPUT,
+ WORKFLOW_NODE_DETAIL,
+ TASK_DETAIL,
+ ERROR_DETAIL,
+ APPLICATION_INPUT,
+ APPLICATION_OUTPUT,
+ NODE_INPUT,
+ NODE_OUTPUT,
+ JOB_DETAIL,
+ DATA_TRANSFER_DETAIL,
+ STATUS,
+ EXPERIMENT_CONFIGURATION_DATA,
+ COMPUTATIONAL_RESOURCE_SCHEDULING,
+ ADVANCE_INPUT_DATA_HANDLING,
+ ADVANCE_OUTPUT_DATA_HANDLING,
+ QOS_PARAM
+}
+
+enum DataType {
+ APPLiCATION_CATALOG,
+ GROUP,
+ USER,
+ PROJECT,
+ EXPERIMENT,
+ EXPERIMENT_INPUT,
+ EXPERIMENT_OUTPUT,
+ WORKFLOW_NODE_DETAIL,
+ TASK_DETAIL,
+ ERROR_DETAIL,
+ APPLICATION_INPUT,
+ APPLICATION_OUTPUT,
+ NODE_INPUT,
+ NODE_OUTPUT,
+ JOB_DETAIL,
+ DATA_TRANSFER_DETAIL,
+ STATUS,
+ EXPERIMENT_CONFIGURATION_DATA,
+ COMPUTATIONAL_RESOURCE_SCHEDULING,
+ ADVANCE_INPUT_DATA_HANDLING,
+ ADVANCE_OUTPUT_DATA_HANDLING,
+ QOS_PARAM
+}
+
+service RegistryCPIService {
+
+ /** Query registry server to fetch the CPI version */
+ string getRegistryCPIVersion(),
+
+ string createParentObject (1: ParentDataType parentDataType
+ 2: binary objectToCreate)
+
+ bool isExists (1: DataType dataType
+ 2: string objectId)
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
----------------------------------------------------------------------
diff --git a/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
new file mode 100644
index 0000000..f6fe86f
--- /dev/null
+++ b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ChildDataType.java
@@ -0,0 +1,106 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.registry.cpi;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+@SuppressWarnings("all") public enum ChildDataType implements org.apache.thrift.TEnum {
+ EXPERIMENT_INPUT(0),
+ EXPERIMENT_OUTPUT(1),
+ WORKFLOW_NODE_DETAIL(2),
+ TASK_DETAIL(3),
+ ERROR_DETAIL(4),
+ APPLICATION_INPUT(5),
+ APPLICATION_OUTPUT(6),
+ NODE_INPUT(7),
+ NODE_OUTPUT(8),
+ JOB_DETAIL(9),
+ DATA_TRANSFER_DETAIL(10),
+ STATUS(11),
+ EXPERIMENT_CONFIGURATION_DATA(12),
+ COMPUTATIONAL_RESOURCE_SCHEDULING(13),
+ ADVANCE_INPUT_DATA_HANDLING(14),
+ ADVANCE_OUTPUT_DATA_HANDLING(15),
+ QOS_PARAM(16);
+
+ private final int value;
+
+ private ChildDataType(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static ChildDataType findByValue(int value) {
+ switch (value) {
+ case 0:
+ return EXPERIMENT_INPUT;
+ case 1:
+ return EXPERIMENT_OUTPUT;
+ case 2:
+ return WORKFLOW_NODE_DETAIL;
+ case 3:
+ return TASK_DETAIL;
+ case 4:
+ return ERROR_DETAIL;
+ case 5:
+ return APPLICATION_INPUT;
+ case 6:
+ return APPLICATION_OUTPUT;
+ case 7:
+ return NODE_INPUT;
+ case 8:
+ return NODE_OUTPUT;
+ case 9:
+ return JOB_DETAIL;
+ case 10:
+ return DATA_TRANSFER_DETAIL;
+ case 11:
+ return STATUS;
+ case 12:
+ return EXPERIMENT_CONFIGURATION_DATA;
+ case 13:
+ return COMPUTATIONAL_RESOURCE_SCHEDULING;
+ case 14:
+ return ADVANCE_INPUT_DATA_HANDLING;
+ case 15:
+ return ADVANCE_OUTPUT_DATA_HANDLING;
+ case 16:
+ return QOS_PARAM;
+ default:
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/DataType.java
----------------------------------------------------------------------
diff --git a/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/DataType.java b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/DataType.java
new file mode 100644
index 0000000..7c14e6b
--- /dev/null
+++ b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/DataType.java
@@ -0,0 +1,121 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.registry.cpi;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+@SuppressWarnings("all") public enum DataType implements org.apache.thrift.TEnum {
+ APPLiCATION_CATALOG(0),
+ GROUP(1),
+ USER(2),
+ PROJECT(3),
+ EXPERIMENT(4),
+ EXPERIMENT_INPUT(5),
+ EXPERIMENT_OUTPUT(6),
+ WORKFLOW_NODE_DETAIL(7),
+ TASK_DETAIL(8),
+ ERROR_DETAIL(9),
+ APPLICATION_INPUT(10),
+ APPLICATION_OUTPUT(11),
+ NODE_INPUT(12),
+ NODE_OUTPUT(13),
+ JOB_DETAIL(14),
+ DATA_TRANSFER_DETAIL(15),
+ STATUS(16),
+ EXPERIMENT_CONFIGURATION_DATA(17),
+ COMPUTATIONAL_RESOURCE_SCHEDULING(18),
+ ADVANCE_INPUT_DATA_HANDLING(19),
+ ADVANCE_OUTPUT_DATA_HANDLING(20),
+ QOS_PARAM(21);
+
+ private final int value;
+
+ private DataType(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static DataType findByValue(int value) {
+ switch (value) {
+ case 0:
+ return APPLiCATION_CATALOG;
+ case 1:
+ return GROUP;
+ case 2:
+ return USER;
+ case 3:
+ return PROJECT;
+ case 4:
+ return EXPERIMENT;
+ case 5:
+ return EXPERIMENT_INPUT;
+ case 6:
+ return EXPERIMENT_OUTPUT;
+ case 7:
+ return WORKFLOW_NODE_DETAIL;
+ case 8:
+ return TASK_DETAIL;
+ case 9:
+ return ERROR_DETAIL;
+ case 10:
+ return APPLICATION_INPUT;
+ case 11:
+ return APPLICATION_OUTPUT;
+ case 12:
+ return NODE_INPUT;
+ case 13:
+ return NODE_OUTPUT;
+ case 14:
+ return JOB_DETAIL;
+ case 15:
+ return DATA_TRANSFER_DETAIL;
+ case 16:
+ return STATUS;
+ case 17:
+ return EXPERIMENT_CONFIGURATION_DATA;
+ case 18:
+ return COMPUTATIONAL_RESOURCE_SCHEDULING;
+ case 19:
+ return ADVANCE_INPUT_DATA_HANDLING;
+ case 20:
+ return ADVANCE_OUTPUT_DATA_HANDLING;
+ case 21:
+ return QOS_PARAM;
+ default:
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/757fbb64/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ParentDataType.java
----------------------------------------------------------------------
diff --git a/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ParentDataType.java b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ParentDataType.java
new file mode 100644
index 0000000..a7074a5
--- /dev/null
+++ b/component-services/registry-cpi-service/src/main/java/org/apache/airavata/registry/cpi/ParentDataType.java
@@ -0,0 +1,70 @@
+ /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.registry.cpi;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+@SuppressWarnings("all") public enum ParentDataType implements org.apache.thrift.TEnum {
+ APPLiCATION_CATALOG(0),
+ GROUP(1),
+ USER(2),
+ PROJECT(3),
+ EXPERIMENT(4);
+
+ private final int value;
+
+ private ParentDataType(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static ParentDataType findByValue(int value) {
+ switch (value) {
+ case 0:
+ return APPLiCATION_CATALOG;
+ case 1:
+ return GROUP;
+ case 2:
+ return USER;
+ case 3:
+ return PROJECT;
+ case 4:
+ return EXPERIMENT;
+ default:
+ return null;
+ }
+ }
+}