/*
* 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 cgl.iotcloud.core.sensorsite.thrift;
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 TSensorSiteService {
public interface Iface {
public cgl.iotcloud.core.master.thrift.THeartBeatResponse hearbeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse deploySensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse unDeploySensor(String id) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse startSensor(String id) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse stopSensor(String id) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void hearbeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void deploySensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unDeploySensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void startSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void stopSensor(String id, 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 cgl.iotcloud.core.master.thrift.THeartBeatResponse hearbeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat) throws org.apache.thrift.TException
{
send_hearbeat(heartBeat);
return recv_hearbeat();
}
public void send_hearbeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat) throws org.apache.thrift.TException
{
hearbeat_args args = new hearbeat_args();
args.setHeartBeat(heartBeat);
sendBase("hearbeat", args);
}
public cgl.iotcloud.core.master.thrift.THeartBeatResponse recv_hearbeat() throws org.apache.thrift.TException
{
hearbeat_result result = new hearbeat_result();
receiveBase(result, "hearbeat");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "hearbeat failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse deploySensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException
{
send_deploySensor(sensor);
return recv_deploySensor();
}
public void send_deploySensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException
{
deploySensor_args args = new deploySensor_args();
args.setSensor(sensor);
sendBase("deploySensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_deploySensor() throws org.apache.thrift.TException
{
deploySensor_result result = new deploySensor_result();
receiveBase(result, "deploySensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deploySensor failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse unDeploySensor(String id) throws org.apache.thrift.TException
{
send_unDeploySensor(id);
return recv_unDeploySensor();
}
public void send_unDeploySensor(String id) throws org.apache.thrift.TException
{
unDeploySensor_args args = new unDeploySensor_args();
args.setId(id);
sendBase("unDeploySensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_unDeploySensor() throws org.apache.thrift.TException
{
unDeploySensor_result result = new unDeploySensor_result();
receiveBase(result, "unDeploySensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "unDeploySensor failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse startSensor(String id) throws org.apache.thrift.TException
{
send_startSensor(id);
return recv_startSensor();
}
public void send_startSensor(String id) throws org.apache.thrift.TException
{
startSensor_args args = new startSensor_args();
args.setId(id);
sendBase("startSensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_startSensor() throws org.apache.thrift.TException
{
startSensor_result result = new startSensor_result();
receiveBase(result, "startSensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startSensor failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse stopSensor(String id) throws org.apache.thrift.TException
{
send_stopSensor(id);
return recv_stopSensor();
}
public void send_stopSensor(String id) throws org.apache.thrift.TException
{
stopSensor_args args = new stopSensor_args();
args.setId(id);
sendBase("stopSensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_stopSensor() throws org.apache.thrift.TException
{
stopSensor_result result = new stopSensor_result();
receiveBase(result, "stopSensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "stopSensor 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 hearbeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
hearbeat_call method_call = new hearbeat_call(heartBeat, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class hearbeat_call extends org.apache.thrift.async.TAsyncMethodCall {
private cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat;
public hearbeat_call(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat, 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.heartBeat = heartBeat;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("hearbeat", org.apache.thrift.protocol.TMessageType.CALL, 0));
hearbeat_args args = new hearbeat_args();
args.setHeartBeat(heartBeat);
args.write(prot);
prot.writeMessageEnd();
}
public cgl.iotcloud.core.master.thrift.THeartBeatResponse 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_hearbeat();
}
}
public void deploySensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
deploySensor_call method_call = new deploySensor_call(sensor, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class deploySensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor;
public deploySensor_call(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor, 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.sensor = sensor;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deploySensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
deploySensor_args args = new deploySensor_args();
args.setSensor(sensor);
args.write(prot);
prot.writeMessageEnd();
}
public cgl.iotcloud.core.api.thrift.TResponse 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_deploySensor();
}
}
public void unDeploySensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unDeploySensor_call method_call = new unDeploySensor_call(id, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class unDeploySensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String id;
public unDeploySensor_call(String id, 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.id = id;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unDeploySensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
unDeploySensor_args args = new unDeploySensor_args();
args.setId(id);
args.write(prot);
prot.writeMessageEnd();
}
public cgl.iotcloud.core.api.thrift.TResponse 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_unDeploySensor();
}
}
public void startSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
startSensor_call method_call = new startSensor_call(id, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class startSensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String id;
public startSensor_call(String id, 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.id = id;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startSensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
startSensor_args args = new startSensor_args();
args.setId(id);
args.write(prot);
prot.writeMessageEnd();
}
public cgl.iotcloud.core.api.thrift.TResponse 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_startSensor();
}
}
public void stopSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
stopSensor_call method_call = new stopSensor_call(id, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class stopSensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String id;
public stopSensor_call(String id, 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.id = id;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("stopSensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
stopSensor_args args = new stopSensor_args();
args.setId(id);
args.write(prot);
prot.writeMessageEnd();
}
public cgl.iotcloud.core.api.thrift.TResponse 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_stopSensor();
}
}
}
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("hearbeat", new hearbeat());
processMap.put("deploySensor", new deploySensor());
processMap.put("unDeploySensor", new unDeploySensor());
processMap.put("startSensor", new startSensor());
processMap.put("stopSensor", new stopSensor());
return processMap;
}
public static class hearbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, hearbeat_args> {
public hearbeat() {
super("hearbeat");
}
public hearbeat_args getEmptyArgsInstance() {
return new hearbeat_args();
}
protected boolean isOneway() {
return false;
}
public hearbeat_result getResult(I iface, hearbeat_args args) throws org.apache.thrift.TException {
hearbeat_result result = new hearbeat_result();
result.success = iface.hearbeat(args.heartBeat);
return result;
}
}
public static class deploySensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deploySensor_args> {
public deploySensor() {
super("deploySensor");
}
public deploySensor_args getEmptyArgsInstance() {
return new deploySensor_args();
}
protected boolean isOneway() {
return false;
}
public deploySensor_result getResult(I iface, deploySensor_args args) throws org.apache.thrift.TException {
deploySensor_result result = new deploySensor_result();
result.success = iface.deploySensor(args.sensor);
return result;
}
}
public static class unDeploySensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unDeploySensor_args> {
public unDeploySensor() {
super("unDeploySensor");
}
public unDeploySensor_args getEmptyArgsInstance() {
return new unDeploySensor_args();
}
protected boolean isOneway() {
return false;
}
public unDeploySensor_result getResult(I iface, unDeploySensor_args args) throws org.apache.thrift.TException {
unDeploySensor_result result = new unDeploySensor_result();
result.success = iface.unDeploySensor(args.id);
return result;
}
}
public static class startSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startSensor_args> {
public startSensor() {
super("startSensor");
}
public startSensor_args getEmptyArgsInstance() {
return new startSensor_args();
}
protected boolean isOneway() {
return false;
}
public startSensor_result getResult(I iface, startSensor_args args) throws org.apache.thrift.TException {
startSensor_result result = new startSensor_result();
result.success = iface.startSensor(args.id);
return result;
}
}
public static class stopSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, stopSensor_args> {
public stopSensor() {
super("stopSensor");
}
public stopSensor_args getEmptyArgsInstance() {
return new stopSensor_args();
}
protected boolean isOneway() {
return false;
}
public stopSensor_result getResult(I iface, stopSensor_args args) throws org.apache.thrift.TException {
stopSensor_result result = new stopSensor_result();
result.success = iface.stopSensor(args.id);
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("hearbeat", new hearbeat());
processMap.put("deploySensor", new deploySensor());
processMap.put("unDeploySensor", new unDeploySensor());
processMap.put("startSensor", new startSensor());
processMap.put("stopSensor", new stopSensor());
return processMap;
}
public static class hearbeat<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, hearbeat_args, cgl.iotcloud.core.master.thrift.THeartBeatResponse> {
public hearbeat() {
super("hearbeat");
}
public hearbeat_args getEmptyArgsInstance() {
return new hearbeat_args();
}
public AsyncMethodCallback<cgl.iotcloud.core.master.thrift.THeartBeatResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<cgl.iotcloud.core.master.thrift.THeartBeatResponse>() {
public void onComplete(cgl.iotcloud.core.master.thrift.THeartBeatResponse o) {
hearbeat_result result = new hearbeat_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;
hearbeat_result result = new hearbeat_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, hearbeat_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.master.thrift.THeartBeatResponse> resultHandler) throws TException {
iface.hearbeat(args.heartBeat,resultHandler);
}
}
public static class deploySensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deploySensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public deploySensor() {
super("deploySensor");
}
public deploySensor_args getEmptyArgsInstance() {
return new deploySensor_args();
}
public AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse>() {
public void onComplete(cgl.iotcloud.core.api.thrift.TResponse o) {
deploySensor_result result = new deploySensor_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;
deploySensor_result result = new deploySensor_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, deploySensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.deploySensor(args.sensor,resultHandler);
}
}
public static class unDeploySensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unDeploySensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public unDeploySensor() {
super("unDeploySensor");
}
public unDeploySensor_args getEmptyArgsInstance() {
return new unDeploySensor_args();
}
public AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse>() {
public void onComplete(cgl.iotcloud.core.api.thrift.TResponse o) {
unDeploySensor_result result = new unDeploySensor_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;
unDeploySensor_result result = new unDeploySensor_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, unDeploySensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.unDeploySensor(args.id,resultHandler);
}
}
public static class startSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startSensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public startSensor() {
super("startSensor");
}
public startSensor_args getEmptyArgsInstance() {
return new startSensor_args();
}
public AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse>() {
public void onComplete(cgl.iotcloud.core.api.thrift.TResponse o) {
startSensor_result result = new startSensor_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;
startSensor_result result = new startSensor_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, startSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.startSensor(args.id,resultHandler);
}
}
public static class stopSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, stopSensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public stopSensor() {
super("stopSensor");
}
public stopSensor_args getEmptyArgsInstance() {
return new stopSensor_args();
}
public AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse>() {
public void onComplete(cgl.iotcloud.core.api.thrift.TResponse o) {
stopSensor_result result = new stopSensor_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;
stopSensor_result result = new stopSensor_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, stopSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.stopSensor(args.id,resultHandler);
}
}
}
public static class hearbeat_args implements org.apache.thrift.TBase<hearbeat_args, hearbeat_args._Fields>, java.io.Serializable, Cloneable, Comparable<hearbeat_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("hearbeat_args");
private static final org.apache.thrift.protocol.TField HEART_BEAT_FIELD_DESC = new org.apache.thrift.protocol.TField("heartBeat", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new hearbeat_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new hearbeat_argsTupleSchemeFactory());
}
public cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat; // 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 {
HEART_BEAT((short)1, "heartBeat");
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: // HEART_BEAT
return HEART_BEAT;
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.HEART_BEAT, new org.apache.thrift.meta_data.FieldMetaData("heartBeat", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.master.thrift.THeartBeatRequest.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(hearbeat_args.class, metaDataMap);
}
public hearbeat_args() {
}
public hearbeat_args(
cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat)
{
this();
this.heartBeat = heartBeat;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public hearbeat_args(hearbeat_args other) {
if (other.isSetHeartBeat()) {
this.heartBeat = new cgl.iotcloud.core.master.thrift.THeartBeatRequest(other.heartBeat);
}
}
public hearbeat_args deepCopy() {
return new hearbeat_args(this);
}
@Override
public void clear() {
this.heartBeat = null;
}
public cgl.iotcloud.core.master.thrift.THeartBeatRequest getHeartBeat() {
return this.heartBeat;
}
public hearbeat_args setHeartBeat(cgl.iotcloud.core.master.thrift.THeartBeatRequest heartBeat) {
this.heartBeat = heartBeat;
return this;
}
public void unsetHeartBeat() {
this.heartBeat = null;
}
/** Returns true if field heartBeat is set (has been assigned a value) and false otherwise */
public boolean isSetHeartBeat() {
return this.heartBeat != null;
}
public void setHeartBeatIsSet(boolean value) {
if (!value) {
this.heartBeat = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case HEART_BEAT:
if (value == null) {
unsetHeartBeat();
} else {
setHeartBeat((cgl.iotcloud.core.master.thrift.THeartBeatRequest)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case HEART_BEAT:
return getHeartBeat();
}
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 HEART_BEAT:
return isSetHeartBeat();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof hearbeat_args)
return this.equals((hearbeat_args)that);
return false;
}
public boolean equals(hearbeat_args that) {
if (that == null)
return false;
boolean this_present_heartBeat = true && this.isSetHeartBeat();
boolean that_present_heartBeat = true && that.isSetHeartBeat();
if (this_present_heartBeat || that_present_heartBeat) {
if (!(this_present_heartBeat && that_present_heartBeat))
return false;
if (!this.heartBeat.equals(that.heartBeat))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(hearbeat_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetHeartBeat()).compareTo(other.isSetHeartBeat());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetHeartBeat()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.heartBeat, other.heartBeat);
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("hearbeat_args(");
boolean first = true;
sb.append("heartBeat:");
if (this.heartBeat == null) {
sb.append("null");
} else {
sb.append(this.heartBeat);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (heartBeat != null) {
heartBeat.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 hearbeat_argsStandardSchemeFactory implements SchemeFactory {
public hearbeat_argsStandardScheme getScheme() {
return new hearbeat_argsStandardScheme();
}
}
private static class hearbeat_argsStandardScheme extends StandardScheme<hearbeat_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, hearbeat_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: // HEART_BEAT
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.heartBeat = new cgl.iotcloud.core.master.thrift.THeartBeatRequest();
struct.heartBeat.read(iprot);
struct.setHeartBeatIsSet(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, hearbeat_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.heartBeat != null) {
oprot.writeFieldBegin(HEART_BEAT_FIELD_DESC);
struct.heartBeat.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class hearbeat_argsTupleSchemeFactory implements SchemeFactory {
public hearbeat_argsTupleScheme getScheme() {
return new hearbeat_argsTupleScheme();
}
}
private static class hearbeat_argsTupleScheme extends TupleScheme<hearbeat_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, hearbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetHeartBeat()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetHeartBeat()) {
struct.heartBeat.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, hearbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.heartBeat = new cgl.iotcloud.core.master.thrift.THeartBeatRequest();
struct.heartBeat.read(iprot);
struct.setHeartBeatIsSet(true);
}
}
}
}
public static class hearbeat_result implements org.apache.thrift.TBase<hearbeat_result, hearbeat_result._Fields>, java.io.Serializable, Cloneable, Comparable<hearbeat_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("hearbeat_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new hearbeat_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new hearbeat_resultTupleSchemeFactory());
}
public cgl.iotcloud.core.master.thrift.THeartBeatResponse 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.master.thrift.THeartBeatResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(hearbeat_result.class, metaDataMap);
}
public hearbeat_result() {
}
public hearbeat_result(
cgl.iotcloud.core.master.thrift.THeartBeatResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public hearbeat_result(hearbeat_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.master.thrift.THeartBeatResponse(other.success);
}
}
public hearbeat_result deepCopy() {
return new hearbeat_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.master.thrift.THeartBeatResponse getSuccess() {
return this.success;
}
public hearbeat_result setSuccess(cgl.iotcloud.core.master.thrift.THeartBeatResponse 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((cgl.iotcloud.core.master.thrift.THeartBeatResponse)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 hearbeat_result)
return this.equals((hearbeat_result)that);
return false;
}
public boolean equals(hearbeat_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(hearbeat_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("hearbeat_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
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 hearbeat_resultStandardSchemeFactory implements SchemeFactory {
public hearbeat_resultStandardScheme getScheme() {
return new hearbeat_resultStandardScheme();
}
}
private static class hearbeat_resultStandardScheme extends StandardScheme<hearbeat_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, hearbeat_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new cgl.iotcloud.core.master.thrift.THeartBeatResponse();
struct.success.read(iprot);
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, hearbeat_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class hearbeat_resultTupleSchemeFactory implements SchemeFactory {
public hearbeat_resultTupleScheme getScheme() {
return new hearbeat_resultTupleScheme();
}
}
private static class hearbeat_resultTupleScheme extends TupleScheme<hearbeat_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, hearbeat_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, hearbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new cgl.iotcloud.core.master.thrift.THeartBeatResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class deploySensor_args implements org.apache.thrift.TBase<deploySensor_args, deploySensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<deploySensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deploySensor_args");
private static final org.apache.thrift.protocol.TField SENSOR_FIELD_DESC = new org.apache.thrift.protocol.TField("sensor", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new deploySensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new deploySensor_argsTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor; // 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 {
SENSOR((short)1, "sensor");
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: // SENSOR
return SENSOR;
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.SENSOR, new org.apache.thrift.meta_data.FieldMetaData("sensor", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deploySensor_args.class, metaDataMap);
}
public deploySensor_args() {
}
public deploySensor_args(
cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor)
{
this();
this.sensor = sensor;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deploySensor_args(deploySensor_args other) {
if (other.isSetSensor()) {
this.sensor = new cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor(other.sensor);
}
}
public deploySensor_args deepCopy() {
return new deploySensor_args(this);
}
@Override
public void clear() {
this.sensor = null;
}
public cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor getSensor() {
return this.sensor;
}
public deploySensor_args setSensor(cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) {
this.sensor = sensor;
return this;
}
public void unsetSensor() {
this.sensor = null;
}
/** Returns true if field sensor is set (has been assigned a value) and false otherwise */
public boolean isSetSensor() {
return this.sensor != null;
}
public void setSensorIsSet(boolean value) {
if (!value) {
this.sensor = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SENSOR:
if (value == null) {
unsetSensor();
} else {
setSensor((cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SENSOR:
return getSensor();
}
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 SENSOR:
return isSetSensor();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof deploySensor_args)
return this.equals((deploySensor_args)that);
return false;
}
public boolean equals(deploySensor_args that) {
if (that == null)
return false;
boolean this_present_sensor = true && this.isSetSensor();
boolean that_present_sensor = true && that.isSetSensor();
if (this_present_sensor || that_present_sensor) {
if (!(this_present_sensor && that_present_sensor))
return false;
if (!this.sensor.equals(that.sensor))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(deploySensor_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSensor()).compareTo(other.isSetSensor());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSensor()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sensor, other.sensor);
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("deploySensor_args(");
boolean first = true;
sb.append("sensor:");
if (this.sensor == null) {
sb.append("null");
} else {
sb.append(this.sensor);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (sensor != null) {
sensor.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 deploySensor_argsStandardSchemeFactory implements SchemeFactory {
public deploySensor_argsStandardScheme getScheme() {
return new deploySensor_argsStandardScheme();
}
}
private static class deploySensor_argsStandardScheme extends StandardScheme<deploySensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deploySensor_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: // SENSOR
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor();
struct.sensor.read(iprot);
struct.setSensorIsSet(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, deploySensor_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.sensor != null) {
oprot.writeFieldBegin(SENSOR_FIELD_DESC);
struct.sensor.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deploySensor_argsTupleSchemeFactory implements SchemeFactory {
public deploySensor_argsTupleScheme getScheme() {
return new deploySensor_argsTupleScheme();
}
}
private static class deploySensor_argsTupleScheme extends TupleScheme<deploySensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deploySensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSensor()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSensor()) {
struct.sensor.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deploySensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor();
struct.sensor.read(iprot);
struct.setSensorIsSet(true);
}
}
}
}
public static class deploySensor_result implements org.apache.thrift.TBase<deploySensor_result, deploySensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<deploySensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deploySensor_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new deploySensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new deploySensor_resultTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TResponse 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deploySensor_result.class, metaDataMap);
}
public deploySensor_result() {
}
public deploySensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deploySensor_result(deploySensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public deploySensor_result deepCopy() {
return new deploySensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public deploySensor_result setSuccess(cgl.iotcloud.core.api.thrift.TResponse 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((cgl.iotcloud.core.api.thrift.TResponse)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 deploySensor_result)
return this.equals((deploySensor_result)that);
return false;
}
public boolean equals(deploySensor_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(deploySensor_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("deploySensor_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
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 deploySensor_resultStandardSchemeFactory implements SchemeFactory {
public deploySensor_resultStandardScheme getScheme() {
return new deploySensor_resultStandardScheme();
}
}
private static class deploySensor_resultStandardScheme extends StandardScheme<deploySensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deploySensor_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
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, deploySensor_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deploySensor_resultTupleSchemeFactory implements SchemeFactory {
public deploySensor_resultTupleScheme getScheme() {
return new deploySensor_resultTupleScheme();
}
}
private static class deploySensor_resultTupleScheme extends TupleScheme<deploySensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deploySensor_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deploySensor_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class unDeploySensor_args implements org.apache.thrift.TBase<unDeploySensor_args, unDeploySensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<unDeploySensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unDeploySensor_args");
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new unDeploySensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new unDeploySensor_argsTupleSchemeFactory());
}
public String id; // 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 {
ID((short)1, "id");
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: // ID
return 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 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(unDeploySensor_args.class, metaDataMap);
}
public unDeploySensor_args() {
}
public unDeploySensor_args(
String id)
{
this();
this.id = id;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unDeploySensor_args(unDeploySensor_args other) {
if (other.isSetId()) {
this.id = other.id;
}
}
public unDeploySensor_args deepCopy() {
return new unDeploySensor_args(this);
}
@Override
public void clear() {
this.id = null;
}
public String getId() {
return this.id;
}
public unDeploySensor_args setId(String id) {
this.id = id;
return this;
}
public void unsetId() {
this.id = null;
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return this.id != null;
}
public void setIdIsSet(boolean value) {
if (!value) {
this.id = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
}
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 ID:
return isSetId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof unDeploySensor_args)
return this.equals((unDeploySensor_args)that);
return false;
}
public boolean equals(unDeploySensor_args that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (!this.id.equals(that.id))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(unDeploySensor_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
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("unDeploySensor_args(");
boolean first = true;
sb.append("id:");
if (this.id == null) {
sb.append("null");
} else {
sb.append(this.id);
}
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 unDeploySensor_argsStandardSchemeFactory implements SchemeFactory {
public unDeploySensor_argsStandardScheme getScheme() {
return new unDeploySensor_argsStandardScheme();
}
}
private static class unDeploySensor_argsStandardScheme extends StandardScheme<unDeploySensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unDeploySensor_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: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(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, unDeploySensor_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.id != null) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeString(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unDeploySensor_argsTupleSchemeFactory implements SchemeFactory {
public unDeploySensor_argsTupleScheme getScheme() {
return new unDeploySensor_argsTupleScheme();
}
}
private static class unDeploySensor_argsTupleScheme extends TupleScheme<unDeploySensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unDeploySensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetId()) {
oprot.writeString(struct.id);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unDeploySensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
}
}
}
public static class unDeploySensor_result implements org.apache.thrift.TBase<unDeploySensor_result, unDeploySensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<unDeploySensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unDeploySensor_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new unDeploySensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new unDeploySensor_resultTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TResponse 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unDeploySensor_result.class, metaDataMap);
}
public unDeploySensor_result() {
}
public unDeploySensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unDeploySensor_result(unDeploySensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public unDeploySensor_result deepCopy() {
return new unDeploySensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public unDeploySensor_result setSuccess(cgl.iotcloud.core.api.thrift.TResponse 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((cgl.iotcloud.core.api.thrift.TResponse)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 unDeploySensor_result)
return this.equals((unDeploySensor_result)that);
return false;
}
public boolean equals(unDeploySensor_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(unDeploySensor_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("unDeploySensor_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
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 unDeploySensor_resultStandardSchemeFactory implements SchemeFactory {
public unDeploySensor_resultStandardScheme getScheme() {
return new unDeploySensor_resultStandardScheme();
}
}
private static class unDeploySensor_resultStandardScheme extends StandardScheme<unDeploySensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unDeploySensor_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
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, unDeploySensor_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unDeploySensor_resultTupleSchemeFactory implements SchemeFactory {
public unDeploySensor_resultTupleScheme getScheme() {
return new unDeploySensor_resultTupleScheme();
}
}
private static class unDeploySensor_resultTupleScheme extends TupleScheme<unDeploySensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unDeploySensor_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unDeploySensor_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class startSensor_args implements org.apache.thrift.TBase<startSensor_args, startSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<startSensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startSensor_args");
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new startSensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new startSensor_argsTupleSchemeFactory());
}
public String id; // 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 {
ID((short)1, "id");
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: // ID
return 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 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(startSensor_args.class, metaDataMap);
}
public startSensor_args() {
}
public startSensor_args(
String id)
{
this();
this.id = id;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public startSensor_args(startSensor_args other) {
if (other.isSetId()) {
this.id = other.id;
}
}
public startSensor_args deepCopy() {
return new startSensor_args(this);
}
@Override
public void clear() {
this.id = null;
}
public String getId() {
return this.id;
}
public startSensor_args setId(String id) {
this.id = id;
return this;
}
public void unsetId() {
this.id = null;
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return this.id != null;
}
public void setIdIsSet(boolean value) {
if (!value) {
this.id = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
}
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 ID:
return isSetId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof startSensor_args)
return this.equals((startSensor_args)that);
return false;
}
public boolean equals(startSensor_args that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (!this.id.equals(that.id))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(startSensor_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
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("startSensor_args(");
boolean first = true;
sb.append("id:");
if (this.id == null) {
sb.append("null");
} else {
sb.append(this.id);
}
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 startSensor_argsStandardSchemeFactory implements SchemeFactory {
public startSensor_argsStandardScheme getScheme() {
return new startSensor_argsStandardScheme();
}
}
private static class startSensor_argsStandardScheme extends StandardScheme<startSensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, startSensor_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: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(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, startSensor_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.id != null) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeString(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class startSensor_argsTupleSchemeFactory implements SchemeFactory {
public startSensor_argsTupleScheme getScheme() {
return new startSensor_argsTupleScheme();
}
}
private static class startSensor_argsTupleScheme extends TupleScheme<startSensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, startSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetId()) {
oprot.writeString(struct.id);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, startSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
}
}
}
public static class startSensor_result implements org.apache.thrift.TBase<startSensor_result, startSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<startSensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startSensor_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new startSensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new startSensor_resultTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TResponse 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startSensor_result.class, metaDataMap);
}
public startSensor_result() {
}
public startSensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public startSensor_result(startSensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public startSensor_result deepCopy() {
return new startSensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public startSensor_result setSuccess(cgl.iotcloud.core.api.thrift.TResponse 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((cgl.iotcloud.core.api.thrift.TResponse)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 startSensor_result)
return this.equals((startSensor_result)that);
return false;
}
public boolean equals(startSensor_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(startSensor_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("startSensor_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
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 startSensor_resultStandardSchemeFactory implements SchemeFactory {
public startSensor_resultStandardScheme getScheme() {
return new startSensor_resultStandardScheme();
}
}
private static class startSensor_resultStandardScheme extends StandardScheme<startSensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, startSensor_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
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, startSensor_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class startSensor_resultTupleSchemeFactory implements SchemeFactory {
public startSensor_resultTupleScheme getScheme() {
return new startSensor_resultTupleScheme();
}
}
private static class startSensor_resultTupleScheme extends TupleScheme<startSensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, startSensor_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, startSensor_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class stopSensor_args implements org.apache.thrift.TBase<stopSensor_args, stopSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<stopSensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopSensor_args");
private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new stopSensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new stopSensor_argsTupleSchemeFactory());
}
public String id; // 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 {
ID((short)1, "id");
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: // ID
return 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 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(stopSensor_args.class, metaDataMap);
}
public stopSensor_args() {
}
public stopSensor_args(
String id)
{
this();
this.id = id;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public stopSensor_args(stopSensor_args other) {
if (other.isSetId()) {
this.id = other.id;
}
}
public stopSensor_args deepCopy() {
return new stopSensor_args(this);
}
@Override
public void clear() {
this.id = null;
}
public String getId() {
return this.id;
}
public stopSensor_args setId(String id) {
this.id = id;
return this;
}
public void unsetId() {
this.id = null;
}
/** Returns true if field id is set (has been assigned a value) and false otherwise */
public boolean isSetId() {
return this.id != null;
}
public void setIdIsSet(boolean value) {
if (!value) {
this.id = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ID:
if (value == null) {
unsetId();
} else {
setId((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ID:
return getId();
}
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 ID:
return isSetId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof stopSensor_args)
return this.equals((stopSensor_args)that);
return false;
}
public boolean equals(stopSensor_args that) {
if (that == null)
return false;
boolean this_present_id = true && this.isSetId();
boolean that_present_id = true && that.isSetId();
if (this_present_id || that_present_id) {
if (!(this_present_id && that_present_id))
return false;
if (!this.id.equals(that.id))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(stopSensor_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
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("stopSensor_args(");
boolean first = true;
sb.append("id:");
if (this.id == null) {
sb.append("null");
} else {
sb.append(this.id);
}
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 stopSensor_argsStandardSchemeFactory implements SchemeFactory {
public stopSensor_argsStandardScheme getScheme() {
return new stopSensor_argsStandardScheme();
}
}
private static class stopSensor_argsStandardScheme extends StandardScheme<stopSensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, stopSensor_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: // ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.id = iprot.readString();
struct.setIdIsSet(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, stopSensor_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.id != null) {
oprot.writeFieldBegin(ID_FIELD_DESC);
oprot.writeString(struct.id);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class stopSensor_argsTupleSchemeFactory implements SchemeFactory {
public stopSensor_argsTupleScheme getScheme() {
return new stopSensor_argsTupleScheme();
}
}
private static class stopSensor_argsTupleScheme extends TupleScheme<stopSensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, stopSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetId()) {
oprot.writeString(struct.id);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, stopSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.id = iprot.readString();
struct.setIdIsSet(true);
}
}
}
}
public static class stopSensor_result implements org.apache.thrift.TBase<stopSensor_result, stopSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<stopSensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopSensor_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new stopSensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new stopSensor_resultTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TResponse 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TResponse.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(stopSensor_result.class, metaDataMap);
}
public stopSensor_result() {
}
public stopSensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public stopSensor_result(stopSensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public stopSensor_result deepCopy() {
return new stopSensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public stopSensor_result setSuccess(cgl.iotcloud.core.api.thrift.TResponse 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((cgl.iotcloud.core.api.thrift.TResponse)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 stopSensor_result)
return this.equals((stopSensor_result)that);
return false;
}
public boolean equals(stopSensor_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(stopSensor_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("stopSensor_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
if (success != null) {
success.validate();
}
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 stopSensor_resultStandardSchemeFactory implements SchemeFactory {
public stopSensor_resultStandardScheme getScheme() {
return new stopSensor_resultStandardScheme();
}
}
private static class stopSensor_resultStandardScheme extends StandardScheme<stopSensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, stopSensor_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
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, stopSensor_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class stopSensor_resultTupleSchemeFactory implements SchemeFactory {
public stopSensor_resultTupleScheme getScheme() {
return new stopSensor_resultTupleScheme();
}
}
private static class stopSensor_resultTupleScheme extends TupleScheme<stopSensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, stopSensor_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, stopSensor_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new cgl.iotcloud.core.api.thrift.TResponse();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
}