/* * 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.api.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 TMasterAPIService { public interface Iface { public List<String> getSites() throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse getSite(String siteId) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse deploySensor(List<String> sites, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse unDeploySensor(List<String> sites, String id) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse unDeployAllSensor(String id) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse startSensor(List<String> sites, String id) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse startAllSensor(String id) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse stopSiteSensors(List<String> sites, String id) throws org.apache.thrift.TException; public cgl.iotcloud.core.api.thrift.TResponse stopAllSensors(String id) throws org.apache.thrift.TException; public List<cgl.iotcloud.core.api.thrift.TSensor> getSensors(String siteId) throws org.apache.thrift.TException; public List<cgl.iotcloud.core.api.thrift.TSensor> getAllSensors() throws org.apache.thrift.TException; } public interface AsyncIface { public void getSites(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getSite(String siteId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deploySensor(List<String> sites, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void unDeploySensor(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void unDeployAllSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void startSensor(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void startAllSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void stopSiteSensors(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void stopAllSensors(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getSensors(String siteId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getAllSensors(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 List<String> getSites() throws org.apache.thrift.TException { send_getSites(); return recv_getSites(); } public void send_getSites() throws org.apache.thrift.TException { getSites_args args = new getSites_args(); sendBase("getSites", args); } public List<String> recv_getSites() throws org.apache.thrift.TException { getSites_result result = new getSites_result(); receiveBase(result, "getSites"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSites failed: unknown result"); } public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse getSite(String siteId) throws org.apache.thrift.TException { send_getSite(siteId); return recv_getSite(); } public void send_getSite(String siteId) throws org.apache.thrift.TException { getSite_args args = new getSite_args(); args.setSiteId(siteId); sendBase("getSite", args); } public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse recv_getSite() throws org.apache.thrift.TException { getSite_result result = new getSite_result(); receiveBase(result, "getSite"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSite failed: unknown result"); } public cgl.iotcloud.core.api.thrift.TResponse deploySensor(List<String> sites, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException { send_deploySensor(sites, sensor); return recv_deploySensor(); } public void send_deploySensor(List<String> sites, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) throws org.apache.thrift.TException { deploySensor_args args = new deploySensor_args(); args.setSites(sites); 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(List<String> sites, String id) throws org.apache.thrift.TException { send_unDeploySensor(sites, id); return recv_unDeploySensor(); } public void send_unDeploySensor(List<String> sites, String id) throws org.apache.thrift.TException { unDeploySensor_args args = new unDeploySensor_args(); args.setSites(sites); 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 unDeployAllSensor(String id) throws org.apache.thrift.TException { send_unDeployAllSensor(id); return recv_unDeployAllSensor(); } public void send_unDeployAllSensor(String id) throws org.apache.thrift.TException { unDeployAllSensor_args args = new unDeployAllSensor_args(); args.setId(id); sendBase("unDeployAllSensor", args); } public cgl.iotcloud.core.api.thrift.TResponse recv_unDeployAllSensor() throws org.apache.thrift.TException { unDeployAllSensor_result result = new unDeployAllSensor_result(); receiveBase(result, "unDeployAllSensor"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "unDeployAllSensor failed: unknown result"); } public cgl.iotcloud.core.api.thrift.TResponse startSensor(List<String> sites, String id) throws org.apache.thrift.TException { send_startSensor(sites, id); return recv_startSensor(); } public void send_startSensor(List<String> sites, String id) throws org.apache.thrift.TException { startSensor_args args = new startSensor_args(); args.setSites(sites); 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 startAllSensor(String id) throws org.apache.thrift.TException { send_startAllSensor(id); return recv_startAllSensor(); } public void send_startAllSensor(String id) throws org.apache.thrift.TException { startAllSensor_args args = new startAllSensor_args(); args.setId(id); sendBase("startAllSensor", args); } public cgl.iotcloud.core.api.thrift.TResponse recv_startAllSensor() throws org.apache.thrift.TException { startAllSensor_result result = new startAllSensor_result(); receiveBase(result, "startAllSensor"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startAllSensor failed: unknown result"); } public cgl.iotcloud.core.api.thrift.TResponse stopSiteSensors(List<String> sites, String id) throws org.apache.thrift.TException { send_stopSiteSensors(sites, id); return recv_stopSiteSensors(); } public void send_stopSiteSensors(List<String> sites, String id) throws org.apache.thrift.TException { stopSiteSensors_args args = new stopSiteSensors_args(); args.setSites(sites); args.setId(id); sendBase("stopSiteSensors", args); } public cgl.iotcloud.core.api.thrift.TResponse recv_stopSiteSensors() throws org.apache.thrift.TException { stopSiteSensors_result result = new stopSiteSensors_result(); receiveBase(result, "stopSiteSensors"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "stopSiteSensors failed: unknown result"); } public cgl.iotcloud.core.api.thrift.TResponse stopAllSensors(String id) throws org.apache.thrift.TException { send_stopAllSensors(id); return recv_stopAllSensors(); } public void send_stopAllSensors(String id) throws org.apache.thrift.TException { stopAllSensors_args args = new stopAllSensors_args(); args.setId(id); sendBase("stopAllSensors", args); } public cgl.iotcloud.core.api.thrift.TResponse recv_stopAllSensors() throws org.apache.thrift.TException { stopAllSensors_result result = new stopAllSensors_result(); receiveBase(result, "stopAllSensors"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "stopAllSensors failed: unknown result"); } public List<cgl.iotcloud.core.api.thrift.TSensor> getSensors(String siteId) throws org.apache.thrift.TException { send_getSensors(siteId); return recv_getSensors(); } public void send_getSensors(String siteId) throws org.apache.thrift.TException { getSensors_args args = new getSensors_args(); args.setSiteId(siteId); sendBase("getSensors", args); } public List<cgl.iotcloud.core.api.thrift.TSensor> recv_getSensors() throws org.apache.thrift.TException { getSensors_result result = new getSensors_result(); receiveBase(result, "getSensors"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getSensors failed: unknown result"); } public List<cgl.iotcloud.core.api.thrift.TSensor> getAllSensors() throws org.apache.thrift.TException { send_getAllSensors(); return recv_getAllSensors(); } public void send_getAllSensors() throws org.apache.thrift.TException { getAllSensors_args args = new getAllSensors_args(); sendBase("getAllSensors", args); } public List<cgl.iotcloud.core.api.thrift.TSensor> recv_getAllSensors() throws org.apache.thrift.TException { getAllSensors_result result = new getAllSensors_result(); receiveBase(result, "getAllSensors"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllSensors 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 getSites(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getSites_call method_call = new getSites_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSites_call extends org.apache.thrift.async.TAsyncMethodCall { public getSites_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSites", org.apache.thrift.protocol.TMessageType.CALL, 0)); getSites_args args = new getSites_args(); args.write(prot); prot.writeMessageEnd(); } public List<String> getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_getSites(); } } public void getSite(String siteId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getSite_call method_call = new getSite_call(siteId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSite_call extends org.apache.thrift.async.TAsyncMethodCall { private String siteId; public getSite_call(String siteId, 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.siteId = siteId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSite", org.apache.thrift.protocol.TMessageType.CALL, 0)); getSite_args args = new getSite_args(); args.setSiteId(siteId); args.write(prot); prot.writeMessageEnd(); } public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse 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_getSite(); } } public void deploySensor(List<String> sites, 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(sites, 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 List<String> sites; private cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor; public deploySensor_call(List<String> sites, 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.sites = sites; 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.setSites(sites); 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(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); unDeploySensor_call method_call = new unDeploySensor_call(sites, 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 List<String> sites; private String id; public unDeploySensor_call(List<String> sites, 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.sites = sites; 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.setSites(sites); 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 unDeployAllSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); unDeployAllSensor_call method_call = new unDeployAllSensor_call(id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class unDeployAllSensor_call extends org.apache.thrift.async.TAsyncMethodCall { private String id; public unDeployAllSensor_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("unDeployAllSensor", org.apache.thrift.protocol.TMessageType.CALL, 0)); unDeployAllSensor_args args = new unDeployAllSensor_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_unDeployAllSensor(); } } public void startSensor(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); startSensor_call method_call = new startSensor_call(sites, 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 List<String> sites; private String id; public startSensor_call(List<String> sites, 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.sites = sites; 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.setSites(sites); 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 startAllSensor(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); startAllSensor_call method_call = new startAllSensor_call(id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class startAllSensor_call extends org.apache.thrift.async.TAsyncMethodCall { private String id; public startAllSensor_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("startAllSensor", org.apache.thrift.protocol.TMessageType.CALL, 0)); startAllSensor_args args = new startAllSensor_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_startAllSensor(); } } public void stopSiteSensors(List<String> sites, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); stopSiteSensors_call method_call = new stopSiteSensors_call(sites, id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class stopSiteSensors_call extends org.apache.thrift.async.TAsyncMethodCall { private List<String> sites; private String id; public stopSiteSensors_call(List<String> sites, 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.sites = sites; 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("stopSiteSensors", org.apache.thrift.protocol.TMessageType.CALL, 0)); stopSiteSensors_args args = new stopSiteSensors_args(); args.setSites(sites); 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_stopSiteSensors(); } } public void stopAllSensors(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); stopAllSensors_call method_call = new stopAllSensors_call(id, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class stopAllSensors_call extends org.apache.thrift.async.TAsyncMethodCall { private String id; public stopAllSensors_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("stopAllSensors", org.apache.thrift.protocol.TMessageType.CALL, 0)); stopAllSensors_args args = new stopAllSensors_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_stopAllSensors(); } } public void getSensors(String siteId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getSensors_call method_call = new getSensors_call(siteId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getSensors_call extends org.apache.thrift.async.TAsyncMethodCall { private String siteId; public getSensors_call(String siteId, 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.siteId = siteId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getSensors", org.apache.thrift.protocol.TMessageType.CALL, 0)); getSensors_args args = new getSensors_args(); args.setSiteId(siteId); args.write(prot); prot.writeMessageEnd(); } public List<cgl.iotcloud.core.api.thrift.TSensor> 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_getSensors(); } } public void getAllSensors(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); getAllSensors_call method_call = new getAllSensors_call(resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getAllSensors_call extends org.apache.thrift.async.TAsyncMethodCall { public getAllSensors_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllSensors", org.apache.thrift.protocol.TMessageType.CALL, 0)); getAllSensors_args args = new getAllSensors_args(); args.write(prot); prot.writeMessageEnd(); } public List<cgl.iotcloud.core.api.thrift.TSensor> 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_getAllSensors(); } } } 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("getSites", new getSites()); processMap.put("getSite", new getSite()); processMap.put("deploySensor", new deploySensor()); processMap.put("unDeploySensor", new unDeploySensor()); processMap.put("unDeployAllSensor", new unDeployAllSensor()); processMap.put("startSensor", new startSensor()); processMap.put("startAllSensor", new startAllSensor()); processMap.put("stopSiteSensors", new stopSiteSensors()); processMap.put("stopAllSensors", new stopAllSensors()); processMap.put("getSensors", new getSensors()); processMap.put("getAllSensors", new getAllSensors()); return processMap; } public static class getSites<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSites_args> { public getSites() { super("getSites"); } public getSites_args getEmptyArgsInstance() { return new getSites_args(); } protected boolean isOneway() { return false; } public getSites_result getResult(I iface, getSites_args args) throws org.apache.thrift.TException { getSites_result result = new getSites_result(); result.success = iface.getSites(); return result; } } public static class getSite<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSite_args> { public getSite() { super("getSite"); } public getSite_args getEmptyArgsInstance() { return new getSite_args(); } protected boolean isOneway() { return false; } public getSite_result getResult(I iface, getSite_args args) throws org.apache.thrift.TException { getSite_result result = new getSite_result(); result.success = iface.getSite(args.siteId); 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.sites, 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.sites, args.id); return result; } } public static class unDeployAllSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unDeployAllSensor_args> { public unDeployAllSensor() { super("unDeployAllSensor"); } public unDeployAllSensor_args getEmptyArgsInstance() { return new unDeployAllSensor_args(); } protected boolean isOneway() { return false; } public unDeployAllSensor_result getResult(I iface, unDeployAllSensor_args args) throws org.apache.thrift.TException { unDeployAllSensor_result result = new unDeployAllSensor_result(); result.success = iface.unDeployAllSensor(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.sites, args.id); return result; } } public static class startAllSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startAllSensor_args> { public startAllSensor() { super("startAllSensor"); } public startAllSensor_args getEmptyArgsInstance() { return new startAllSensor_args(); } protected boolean isOneway() { return false; } public startAllSensor_result getResult(I iface, startAllSensor_args args) throws org.apache.thrift.TException { startAllSensor_result result = new startAllSensor_result(); result.success = iface.startAllSensor(args.id); return result; } } public static class stopSiteSensors<I extends Iface> extends org.apache.thrift.ProcessFunction<I, stopSiteSensors_args> { public stopSiteSensors() { super("stopSiteSensors"); } public stopSiteSensors_args getEmptyArgsInstance() { return new stopSiteSensors_args(); } protected boolean isOneway() { return false; } public stopSiteSensors_result getResult(I iface, stopSiteSensors_args args) throws org.apache.thrift.TException { stopSiteSensors_result result = new stopSiteSensors_result(); result.success = iface.stopSiteSensors(args.sites, args.id); return result; } } public static class stopAllSensors<I extends Iface> extends org.apache.thrift.ProcessFunction<I, stopAllSensors_args> { public stopAllSensors() { super("stopAllSensors"); } public stopAllSensors_args getEmptyArgsInstance() { return new stopAllSensors_args(); } protected boolean isOneway() { return false; } public stopAllSensors_result getResult(I iface, stopAllSensors_args args) throws org.apache.thrift.TException { stopAllSensors_result result = new stopAllSensors_result(); result.success = iface.stopAllSensors(args.id); return result; } } public static class getSensors<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getSensors_args> { public getSensors() { super("getSensors"); } public getSensors_args getEmptyArgsInstance() { return new getSensors_args(); } protected boolean isOneway() { return false; } public getSensors_result getResult(I iface, getSensors_args args) throws org.apache.thrift.TException { getSensors_result result = new getSensors_result(); result.success = iface.getSensors(args.siteId); return result; } } public static class getAllSensors<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllSensors_args> { public getAllSensors() { super("getAllSensors"); } public getAllSensors_args getEmptyArgsInstance() { return new getAllSensors_args(); } protected boolean isOneway() { return false; } public getAllSensors_result getResult(I iface, getAllSensors_args args) throws org.apache.thrift.TException { getAllSensors_result result = new getAllSensors_result(); result.success = iface.getAllSensors(); 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("getSites", new getSites()); processMap.put("getSite", new getSite()); processMap.put("deploySensor", new deploySensor()); processMap.put("unDeploySensor", new unDeploySensor()); processMap.put("unDeployAllSensor", new unDeployAllSensor()); processMap.put("startSensor", new startSensor()); processMap.put("startAllSensor", new startAllSensor()); processMap.put("stopSiteSensors", new stopSiteSensors()); processMap.put("stopAllSensors", new stopAllSensors()); processMap.put("getSensors", new getSensors()); processMap.put("getAllSensors", new getAllSensors()); return processMap; } public static class getSites<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSites_args, List<String>> { public getSites() { super("getSites"); } public getSites_args getEmptyArgsInstance() { return new getSites_args(); } public AsyncMethodCallback<List<String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<String>>() { public void onComplete(List<String> o) { getSites_result result = new getSites_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; getSites_result result = new getSites_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, getSites_args args, org.apache.thrift.async.AsyncMethodCallback<List<String>> resultHandler) throws TException { iface.getSites(resultHandler); } } public static class getSite<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSite_args, cgl.iotcloud.core.api.thrift.TSiteDetailsResponse> { public getSite() { super("getSite"); } public getSite_args getEmptyArgsInstance() { return new getSite_args(); } public AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TSiteDetailsResponse> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TSiteDetailsResponse>() { public void onComplete(cgl.iotcloud.core.api.thrift.TSiteDetailsResponse o) { getSite_result result = new getSite_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; getSite_result result = new getSite_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, getSite_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TSiteDetailsResponse> resultHandler) throws TException { iface.getSite(args.siteId,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.sites, 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.sites, args.id,resultHandler); } } public static class unDeployAllSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unDeployAllSensor_args, cgl.iotcloud.core.api.thrift.TResponse> { public unDeployAllSensor() { super("unDeployAllSensor"); } public unDeployAllSensor_args getEmptyArgsInstance() { return new unDeployAllSensor_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) { unDeployAllSensor_result result = new unDeployAllSensor_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; unDeployAllSensor_result result = new unDeployAllSensor_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, unDeployAllSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException { iface.unDeployAllSensor(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.sites, args.id,resultHandler); } } public static class startAllSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startAllSensor_args, cgl.iotcloud.core.api.thrift.TResponse> { public startAllSensor() { super("startAllSensor"); } public startAllSensor_args getEmptyArgsInstance() { return new startAllSensor_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) { startAllSensor_result result = new startAllSensor_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; startAllSensor_result result = new startAllSensor_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, startAllSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException { iface.startAllSensor(args.id,resultHandler); } } public static class stopSiteSensors<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, stopSiteSensors_args, cgl.iotcloud.core.api.thrift.TResponse> { public stopSiteSensors() { super("stopSiteSensors"); } public stopSiteSensors_args getEmptyArgsInstance() { return new stopSiteSensors_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) { stopSiteSensors_result result = new stopSiteSensors_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; stopSiteSensors_result result = new stopSiteSensors_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, stopSiteSensors_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException { iface.stopSiteSensors(args.sites, args.id,resultHandler); } } public static class stopAllSensors<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, stopAllSensors_args, cgl.iotcloud.core.api.thrift.TResponse> { public stopAllSensors() { super("stopAllSensors"); } public stopAllSensors_args getEmptyArgsInstance() { return new stopAllSensors_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) { stopAllSensors_result result = new stopAllSensors_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; stopAllSensors_result result = new stopAllSensors_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, stopAllSensors_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException { iface.stopAllSensors(args.id,resultHandler); } } public static class getSensors<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getSensors_args, List<cgl.iotcloud.core.api.thrift.TSensor>> { public getSensors() { super("getSensors"); } public getSensors_args getEmptyArgsInstance() { return new getSensors_args(); } public AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>>() { public void onComplete(List<cgl.iotcloud.core.api.thrift.TSensor> o) { getSensors_result result = new getSensors_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; getSensors_result result = new getSensors_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, getSensors_args args, org.apache.thrift.async.AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>> resultHandler) throws TException { iface.getSensors(args.siteId,resultHandler); } } public static class getAllSensors<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllSensors_args, List<cgl.iotcloud.core.api.thrift.TSensor>> { public getAllSensors() { super("getAllSensors"); } public getAllSensors_args getEmptyArgsInstance() { return new getAllSensors_args(); } public AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>>() { public void onComplete(List<cgl.iotcloud.core.api.thrift.TSensor> o) { getAllSensors_result result = new getAllSensors_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; getAllSensors_result result = new getAllSensors_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, getAllSensors_args args, org.apache.thrift.async.AsyncMethodCallback<List<cgl.iotcloud.core.api.thrift.TSensor>> resultHandler) throws TException { iface.getAllSensors(resultHandler); } } } public static class getSites_args implements org.apache.thrift.TBase<getSites_args, getSites_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSites_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSites_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getSites_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSites_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSites_args.class, metaDataMap); } public getSites_args() { } /** * Performs a deep copy on <i>other</i>. */ public getSites_args(getSites_args other) { } public getSites_args deepCopy() { return new getSites_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSites_args) return this.equals((getSites_args)that); return false; } public boolean equals(getSites_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getSites_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getSites_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getSites_argsStandardSchemeFactory implements SchemeFactory { public getSites_argsStandardScheme getScheme() { return new getSites_argsStandardScheme(); } } private static class getSites_argsStandardScheme extends StandardScheme<getSites_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSites_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getSites_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSites_argsTupleSchemeFactory implements SchemeFactory { public getSites_argsTupleScheme getScheme() { return new getSites_argsTupleScheme(); } } private static class getSites_argsTupleScheme extends TupleScheme<getSites_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSites_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSites_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class getSites_result implements org.apache.thrift.TBase<getSites_result, getSites_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSites_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSites_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getSites_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSites_resultTupleSchemeFactory()); } public List<String> success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { SUCCESS((short)0, "success"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSites_result.class, metaDataMap); } public getSites_result() { } public getSites_result( List<String> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getSites_result(getSites_result other) { if (other.isSetSuccess()) { List<String> __this__success = new ArrayList<String>(other.success); this.success = __this__success; } } public getSites_result deepCopy() { return new getSites_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<String> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(String elem) { if (this.success == null) { this.success = new ArrayList<String>(); } this.success.add(elem); } public List<String> getSuccess() { return this.success; } public getSites_result setSuccess(List<String> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<String>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSites_result) return this.equals((getSites_result)that); return false; } public boolean equals(getSites_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(getSites_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("getSites_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getSites_resultStandardSchemeFactory implements SchemeFactory { public getSites_resultStandardScheme getScheme() { return new getSites_resultStandardScheme(); } } private static class getSites_resultStandardScheme extends StandardScheme<getSites_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSites_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.LIST) { { org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); struct.success = new ArrayList<String>(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { String _elem2; _elem2 = iprot.readString(); struct.success.add(_elem2); } iprot.readListEnd(); } 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, getSites_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); for (String _iter3 : struct.success) { oprot.writeString(_iter3); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSites_resultTupleSchemeFactory implements SchemeFactory { public getSites_resultTupleScheme getScheme() { return new getSites_resultTupleScheme(); } } private static class getSites_resultTupleScheme extends TupleScheme<getSites_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSites_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (String _iter4 : struct.success) { oprot.writeString(_iter4); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSites_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.success = new ArrayList<String>(_list5.size); for (int _i6 = 0; _i6 < _list5.size; ++_i6) { String _elem7; _elem7 = iprot.readString(); struct.success.add(_elem7); } } struct.setSuccessIsSet(true); } } } } public static class getSite_args implements org.apache.thrift.TBase<getSite_args, getSite_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSite_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSite_args"); private static final org.apache.thrift.protocol.TField SITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("siteId", 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 getSite_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSite_argsTupleSchemeFactory()); } public String siteId; // 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 { SITE_ID((short)1, "siteId"); 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: // SITE_ID return SITE_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.SITE_ID, new org.apache.thrift.meta_data.FieldMetaData("siteId", 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(getSite_args.class, metaDataMap); } public getSite_args() { } public getSite_args( String siteId) { this(); this.siteId = siteId; } /** * Performs a deep copy on <i>other</i>. */ public getSite_args(getSite_args other) { if (other.isSetSiteId()) { this.siteId = other.siteId; } } public getSite_args deepCopy() { return new getSite_args(this); } @Override public void clear() { this.siteId = null; } public String getSiteId() { return this.siteId; } public getSite_args setSiteId(String siteId) { this.siteId = siteId; return this; } public void unsetSiteId() { this.siteId = null; } /** Returns true if field siteId is set (has been assigned a value) and false otherwise */ public boolean isSetSiteId() { return this.siteId != null; } public void setSiteIdIsSet(boolean value) { if (!value) { this.siteId = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SITE_ID: if (value == null) { unsetSiteId(); } else { setSiteId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITE_ID: return getSiteId(); } 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 SITE_ID: return isSetSiteId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSite_args) return this.equals((getSite_args)that); return false; } public boolean equals(getSite_args that) { if (that == null) return false; boolean this_present_siteId = true && this.isSetSiteId(); boolean that_present_siteId = true && that.isSetSiteId(); if (this_present_siteId || that_present_siteId) { if (!(this_present_siteId && that_present_siteId)) return false; if (!this.siteId.equals(that.siteId)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getSite_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSiteId()).compareTo(other.isSetSiteId()); if (lastComparison != 0) { return lastComparison; } if (isSetSiteId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.siteId, other.siteId); 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("getSite_args("); boolean first = true; sb.append("siteId:"); if (this.siteId == null) { sb.append("null"); } else { sb.append(this.siteId); } 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 getSite_argsStandardSchemeFactory implements SchemeFactory { public getSite_argsStandardScheme getScheme() { return new getSite_argsStandardScheme(); } } private static class getSite_argsStandardScheme extends StandardScheme<getSite_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSite_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: // SITE_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.siteId = iprot.readString(); struct.setSiteIdIsSet(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, getSite_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.siteId != null) { oprot.writeFieldBegin(SITE_ID_FIELD_DESC); oprot.writeString(struct.siteId); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSite_argsTupleSchemeFactory implements SchemeFactory { public getSite_argsTupleScheme getScheme() { return new getSite_argsTupleScheme(); } } private static class getSite_argsTupleScheme extends TupleScheme<getSite_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSite_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSiteId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSiteId()) { oprot.writeString(struct.siteId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSite_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.siteId = iprot.readString(); struct.setSiteIdIsSet(true); } } } } public static class getSite_result implements org.apache.thrift.TBase<getSite_result, getSite_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSite_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSite_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 getSite_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSite_resultTupleSchemeFactory()); } public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse 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.TSiteDetailsResponse.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSite_result.class, metaDataMap); } public getSite_result() { } public getSite_result( cgl.iotcloud.core.api.thrift.TSiteDetailsResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getSite_result(getSite_result other) { if (other.isSetSuccess()) { this.success = new cgl.iotcloud.core.api.thrift.TSiteDetailsResponse(other.success); } } public getSite_result deepCopy() { return new getSite_result(this); } @Override public void clear() { this.success = null; } public cgl.iotcloud.core.api.thrift.TSiteDetailsResponse getSuccess() { return this.success; } public getSite_result setSuccess(cgl.iotcloud.core.api.thrift.TSiteDetailsResponse 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.TSiteDetailsResponse)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 getSite_result) return this.equals((getSite_result)that); return false; } public boolean equals(getSite_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(getSite_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("getSite_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 getSite_resultStandardSchemeFactory implements SchemeFactory { public getSite_resultStandardScheme getScheme() { return new getSite_resultStandardScheme(); } } private static class getSite_resultStandardScheme extends StandardScheme<getSite_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSite_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.TSiteDetailsResponse(); 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, getSite_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 getSite_resultTupleSchemeFactory implements SchemeFactory { public getSite_resultTupleScheme getScheme() { return new getSite_resultTupleScheme(); } } private static class getSite_resultTupleScheme extends TupleScheme<getSite_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSite_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, getSite_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.TSiteDetailsResponse(); 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 SITES_FIELD_DESC = new org.apache.thrift.protocol.TField("sites", org.apache.thrift.protocol.TType.LIST, (short)1); 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)2); 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 List<String> sites; // required 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 { SITES((short)1, "sites"), SENSOR((short)2, "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: // SITES return SITES; case 2: // 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.SITES, new org.apache.thrift.meta_data.FieldMetaData("sites", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); 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( List<String> sites, cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor sensor) { this(); this.sites = sites; this.sensor = sensor; } /** * Performs a deep copy on <i>other</i>. */ public deploySensor_args(deploySensor_args other) { if (other.isSetSites()) { List<String> __this__sites = new ArrayList<String>(other.sites); this.sites = __this__sites; } 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.sites = null; this.sensor = null; } public int getSitesSize() { return (this.sites == null) ? 0 : this.sites.size(); } public java.util.Iterator<String> getSitesIterator() { return (this.sites == null) ? null : this.sites.iterator(); } public void addToSites(String elem) { if (this.sites == null) { this.sites = new ArrayList<String>(); } this.sites.add(elem); } public List<String> getSites() { return this.sites; } public deploySensor_args setSites(List<String> sites) { this.sites = sites; return this; } public void unsetSites() { this.sites = null; } /** Returns true if field sites is set (has been assigned a value) and false otherwise */ public boolean isSetSites() { return this.sites != null; } public void setSitesIsSet(boolean value) { if (!value) { this.sites = 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 SITES: if (value == null) { unsetSites(); } else { setSites((List<String>)value); } break; case SENSOR: if (value == null) { unsetSensor(); } else { setSensor((cgl.iotcloud.core.api.thrift.TSensorDeployDescriptor)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITES: return getSites(); 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 SITES: return isSetSites(); 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_sites = true && this.isSetSites(); boolean that_present_sites = true && that.isSetSites(); if (this_present_sites || that_present_sites) { if (!(this_present_sites && that_present_sites)) return false; if (!this.sites.equals(that.sites)) 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(isSetSites()).compareTo(other.isSetSites()); if (lastComparison != 0) { return lastComparison; } if (isSetSites()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sites, other.sites); if (lastComparison != 0) { return lastComparison; } } 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("sites:"); if (this.sites == null) { sb.append("null"); } else { sb.append(this.sites); } first = false; if (!first) sb.append(", "); 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: // SITES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); struct.sites = new ArrayList<String>(_list8.size); for (int _i9 = 0; _i9 < _list8.size; ++_i9) { String _elem10; _elem10 = iprot.readString(); struct.sites.add(_elem10); } iprot.readListEnd(); } struct.setSitesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // 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.sites != null) { oprot.writeFieldBegin(SITES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sites.size())); for (String _iter11 : struct.sites) { oprot.writeString(_iter11); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } 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.isSetSites()) { optionals.set(0); } if (struct.isSetSensor()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSites()) { { oprot.writeI32(struct.sites.size()); for (String _iter12 : struct.sites) { oprot.writeString(_iter12); } } } 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(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.sites = new ArrayList<String>(_list13.size); for (int _i14 = 0; _i14 < _list13.size; ++_i14) { String _elem15; _elem15 = iprot.readString(); struct.sites.add(_elem15); } } struct.setSitesIsSet(true); } if (incoming.get(1)) { 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 SITES_FIELD_DESC = new org.apache.thrift.protocol.TField("sites", org.apache.thrift.protocol.TType.LIST, (short)1); 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)2); 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 List<String> sites; // required 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 { SITES((short)1, "sites"), ID((short)2, "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: // SITES return SITES; case 2: // 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.SITES, new org.apache.thrift.meta_data.FieldMetaData("sites", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); 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( List<String> sites, String id) { this(); this.sites = sites; this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public unDeploySensor_args(unDeploySensor_args other) { if (other.isSetSites()) { List<String> __this__sites = new ArrayList<String>(other.sites); this.sites = __this__sites; } if (other.isSetId()) { this.id = other.id; } } public unDeploySensor_args deepCopy() { return new unDeploySensor_args(this); } @Override public void clear() { this.sites = null; this.id = null; } public int getSitesSize() { return (this.sites == null) ? 0 : this.sites.size(); } public java.util.Iterator<String> getSitesIterator() { return (this.sites == null) ? null : this.sites.iterator(); } public void addToSites(String elem) { if (this.sites == null) { this.sites = new ArrayList<String>(); } this.sites.add(elem); } public List<String> getSites() { return this.sites; } public unDeploySensor_args setSites(List<String> sites) { this.sites = sites; return this; } public void unsetSites() { this.sites = null; } /** Returns true if field sites is set (has been assigned a value) and false otherwise */ public boolean isSetSites() { return this.sites != null; } public void setSitesIsSet(boolean value) { if (!value) { this.sites = 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 SITES: if (value == null) { unsetSites(); } else { setSites((List<String>)value); } break; case ID: if (value == null) { unsetId(); } else { setId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITES: return getSites(); 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 SITES: return isSetSites(); 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_sites = true && this.isSetSites(); boolean that_present_sites = true && that.isSetSites(); if (this_present_sites || that_present_sites) { if (!(this_present_sites && that_present_sites)) return false; if (!this.sites.equals(that.sites)) 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(isSetSites()).compareTo(other.isSetSites()); if (lastComparison != 0) { return lastComparison; } if (isSetSites()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sites, other.sites); if (lastComparison != 0) { return lastComparison; } } 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("sites:"); if (this.sites == null) { sb.append("null"); } else { sb.append(this.sites); } first = false; if (!first) sb.append(", "); 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: // SITES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); struct.sites = new ArrayList<String>(_list16.size); for (int _i17 = 0; _i17 < _list16.size; ++_i17) { String _elem18; _elem18 = iprot.readString(); struct.sites.add(_elem18); } iprot.readListEnd(); } struct.setSitesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // 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.sites != null) { oprot.writeFieldBegin(SITES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sites.size())); for (String _iter19 : struct.sites) { oprot.writeString(_iter19); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } 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.isSetSites()) { optionals.set(0); } if (struct.isSetId()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSites()) { { oprot.writeI32(struct.sites.size()); for (String _iter20 : struct.sites) { oprot.writeString(_iter20); } } } 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(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list21 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.sites = new ArrayList<String>(_list21.size); for (int _i22 = 0; _i22 < _list21.size; ++_i22) { String _elem23; _elem23 = iprot.readString(); struct.sites.add(_elem23); } } struct.setSitesIsSet(true); } if (incoming.get(1)) { 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 unDeployAllSensor_args implements org.apache.thrift.TBase<unDeployAllSensor_args, unDeployAllSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<unDeployAllSensor_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unDeployAllSensor_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 unDeployAllSensor_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new unDeployAllSensor_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(unDeployAllSensor_args.class, metaDataMap); } public unDeployAllSensor_args() { } public unDeployAllSensor_args( String id) { this(); this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public unDeployAllSensor_args(unDeployAllSensor_args other) { if (other.isSetId()) { this.id = other.id; } } public unDeployAllSensor_args deepCopy() { return new unDeployAllSensor_args(this); } @Override public void clear() { this.id = null; } public String getId() { return this.id; } public unDeployAllSensor_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 unDeployAllSensor_args) return this.equals((unDeployAllSensor_args)that); return false; } public boolean equals(unDeployAllSensor_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(unDeployAllSensor_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("unDeployAllSensor_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 unDeployAllSensor_argsStandardSchemeFactory implements SchemeFactory { public unDeployAllSensor_argsStandardScheme getScheme() { return new unDeployAllSensor_argsStandardScheme(); } } private static class unDeployAllSensor_argsStandardScheme extends StandardScheme<unDeployAllSensor_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, unDeployAllSensor_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, unDeployAllSensor_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 unDeployAllSensor_argsTupleSchemeFactory implements SchemeFactory { public unDeployAllSensor_argsTupleScheme getScheme() { return new unDeployAllSensor_argsTupleScheme(); } } private static class unDeployAllSensor_argsTupleScheme extends TupleScheme<unDeployAllSensor_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unDeployAllSensor_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, unDeployAllSensor_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 unDeployAllSensor_result implements org.apache.thrift.TBase<unDeployAllSensor_result, unDeployAllSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<unDeployAllSensor_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unDeployAllSensor_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 unDeployAllSensor_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new unDeployAllSensor_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(unDeployAllSensor_result.class, metaDataMap); } public unDeployAllSensor_result() { } public unDeployAllSensor_result( cgl.iotcloud.core.api.thrift.TResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public unDeployAllSensor_result(unDeployAllSensor_result other) { if (other.isSetSuccess()) { this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success); } } public unDeployAllSensor_result deepCopy() { return new unDeployAllSensor_result(this); } @Override public void clear() { this.success = null; } public cgl.iotcloud.core.api.thrift.TResponse getSuccess() { return this.success; } public unDeployAllSensor_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 unDeployAllSensor_result) return this.equals((unDeployAllSensor_result)that); return false; } public boolean equals(unDeployAllSensor_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(unDeployAllSensor_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("unDeployAllSensor_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 unDeployAllSensor_resultStandardSchemeFactory implements SchemeFactory { public unDeployAllSensor_resultStandardScheme getScheme() { return new unDeployAllSensor_resultStandardScheme(); } } private static class unDeployAllSensor_resultStandardScheme extends StandardScheme<unDeployAllSensor_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, unDeployAllSensor_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, unDeployAllSensor_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 unDeployAllSensor_resultTupleSchemeFactory implements SchemeFactory { public unDeployAllSensor_resultTupleScheme getScheme() { return new unDeployAllSensor_resultTupleScheme(); } } private static class unDeployAllSensor_resultTupleScheme extends TupleScheme<unDeployAllSensor_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unDeployAllSensor_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, unDeployAllSensor_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 SITES_FIELD_DESC = new org.apache.thrift.protocol.TField("sites", org.apache.thrift.protocol.TType.LIST, (short)1); 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)2); 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 List<String> sites; // required 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 { SITES((short)1, "sites"), ID((short)2, "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: // SITES return SITES; case 2: // 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.SITES, new org.apache.thrift.meta_data.FieldMetaData("sites", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); 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( List<String> sites, String id) { this(); this.sites = sites; this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public startSensor_args(startSensor_args other) { if (other.isSetSites()) { List<String> __this__sites = new ArrayList<String>(other.sites); this.sites = __this__sites; } if (other.isSetId()) { this.id = other.id; } } public startSensor_args deepCopy() { return new startSensor_args(this); } @Override public void clear() { this.sites = null; this.id = null; } public int getSitesSize() { return (this.sites == null) ? 0 : this.sites.size(); } public java.util.Iterator<String> getSitesIterator() { return (this.sites == null) ? null : this.sites.iterator(); } public void addToSites(String elem) { if (this.sites == null) { this.sites = new ArrayList<String>(); } this.sites.add(elem); } public List<String> getSites() { return this.sites; } public startSensor_args setSites(List<String> sites) { this.sites = sites; return this; } public void unsetSites() { this.sites = null; } /** Returns true if field sites is set (has been assigned a value) and false otherwise */ public boolean isSetSites() { return this.sites != null; } public void setSitesIsSet(boolean value) { if (!value) { this.sites = 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 SITES: if (value == null) { unsetSites(); } else { setSites((List<String>)value); } break; case ID: if (value == null) { unsetId(); } else { setId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITES: return getSites(); 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 SITES: return isSetSites(); 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_sites = true && this.isSetSites(); boolean that_present_sites = true && that.isSetSites(); if (this_present_sites || that_present_sites) { if (!(this_present_sites && that_present_sites)) return false; if (!this.sites.equals(that.sites)) 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(isSetSites()).compareTo(other.isSetSites()); if (lastComparison != 0) { return lastComparison; } if (isSetSites()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sites, other.sites); if (lastComparison != 0) { return lastComparison; } } 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("sites:"); if (this.sites == null) { sb.append("null"); } else { sb.append(this.sites); } first = false; if (!first) sb.append(", "); 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: // SITES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); struct.sites = new ArrayList<String>(_list24.size); for (int _i25 = 0; _i25 < _list24.size; ++_i25) { String _elem26; _elem26 = iprot.readString(); struct.sites.add(_elem26); } iprot.readListEnd(); } struct.setSitesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // 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.sites != null) { oprot.writeFieldBegin(SITES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sites.size())); for (String _iter27 : struct.sites) { oprot.writeString(_iter27); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } 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.isSetSites()) { optionals.set(0); } if (struct.isSetId()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSites()) { { oprot.writeI32(struct.sites.size()); for (String _iter28 : struct.sites) { oprot.writeString(_iter28); } } } 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(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.sites = new ArrayList<String>(_list29.size); for (int _i30 = 0; _i30 < _list29.size; ++_i30) { String _elem31; _elem31 = iprot.readString(); struct.sites.add(_elem31); } } struct.setSitesIsSet(true); } if (incoming.get(1)) { 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 startAllSensor_args implements org.apache.thrift.TBase<startAllSensor_args, startAllSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<startAllSensor_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startAllSensor_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 startAllSensor_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new startAllSensor_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(startAllSensor_args.class, metaDataMap); } public startAllSensor_args() { } public startAllSensor_args( String id) { this(); this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public startAllSensor_args(startAllSensor_args other) { if (other.isSetId()) { this.id = other.id; } } public startAllSensor_args deepCopy() { return new startAllSensor_args(this); } @Override public void clear() { this.id = null; } public String getId() { return this.id; } public startAllSensor_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 startAllSensor_args) return this.equals((startAllSensor_args)that); return false; } public boolean equals(startAllSensor_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(startAllSensor_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("startAllSensor_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 startAllSensor_argsStandardSchemeFactory implements SchemeFactory { public startAllSensor_argsStandardScheme getScheme() { return new startAllSensor_argsStandardScheme(); } } private static class startAllSensor_argsStandardScheme extends StandardScheme<startAllSensor_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, startAllSensor_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, startAllSensor_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 startAllSensor_argsTupleSchemeFactory implements SchemeFactory { public startAllSensor_argsTupleScheme getScheme() { return new startAllSensor_argsTupleScheme(); } } private static class startAllSensor_argsTupleScheme extends TupleScheme<startAllSensor_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, startAllSensor_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, startAllSensor_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 startAllSensor_result implements org.apache.thrift.TBase<startAllSensor_result, startAllSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<startAllSensor_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startAllSensor_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 startAllSensor_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new startAllSensor_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(startAllSensor_result.class, metaDataMap); } public startAllSensor_result() { } public startAllSensor_result( cgl.iotcloud.core.api.thrift.TResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public startAllSensor_result(startAllSensor_result other) { if (other.isSetSuccess()) { this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success); } } public startAllSensor_result deepCopy() { return new startAllSensor_result(this); } @Override public void clear() { this.success = null; } public cgl.iotcloud.core.api.thrift.TResponse getSuccess() { return this.success; } public startAllSensor_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 startAllSensor_result) return this.equals((startAllSensor_result)that); return false; } public boolean equals(startAllSensor_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(startAllSensor_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("startAllSensor_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 startAllSensor_resultStandardSchemeFactory implements SchemeFactory { public startAllSensor_resultStandardScheme getScheme() { return new startAllSensor_resultStandardScheme(); } } private static class startAllSensor_resultStandardScheme extends StandardScheme<startAllSensor_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, startAllSensor_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, startAllSensor_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 startAllSensor_resultTupleSchemeFactory implements SchemeFactory { public startAllSensor_resultTupleScheme getScheme() { return new startAllSensor_resultTupleScheme(); } } private static class startAllSensor_resultTupleScheme extends TupleScheme<startAllSensor_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, startAllSensor_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, startAllSensor_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 stopSiteSensors_args implements org.apache.thrift.TBase<stopSiteSensors_args, stopSiteSensors_args._Fields>, java.io.Serializable, Cloneable, Comparable<stopSiteSensors_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopSiteSensors_args"); private static final org.apache.thrift.protocol.TField SITES_FIELD_DESC = new org.apache.thrift.protocol.TField("sites", org.apache.thrift.protocol.TType.LIST, (short)1); 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)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new stopSiteSensors_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new stopSiteSensors_argsTupleSchemeFactory()); } public List<String> sites; // required 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 { SITES((short)1, "sites"), ID((short)2, "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: // SITES return SITES; case 2: // 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.SITES, new org.apache.thrift.meta_data.FieldMetaData("sites", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); 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(stopSiteSensors_args.class, metaDataMap); } public stopSiteSensors_args() { } public stopSiteSensors_args( List<String> sites, String id) { this(); this.sites = sites; this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public stopSiteSensors_args(stopSiteSensors_args other) { if (other.isSetSites()) { List<String> __this__sites = new ArrayList<String>(other.sites); this.sites = __this__sites; } if (other.isSetId()) { this.id = other.id; } } public stopSiteSensors_args deepCopy() { return new stopSiteSensors_args(this); } @Override public void clear() { this.sites = null; this.id = null; } public int getSitesSize() { return (this.sites == null) ? 0 : this.sites.size(); } public java.util.Iterator<String> getSitesIterator() { return (this.sites == null) ? null : this.sites.iterator(); } public void addToSites(String elem) { if (this.sites == null) { this.sites = new ArrayList<String>(); } this.sites.add(elem); } public List<String> getSites() { return this.sites; } public stopSiteSensors_args setSites(List<String> sites) { this.sites = sites; return this; } public void unsetSites() { this.sites = null; } /** Returns true if field sites is set (has been assigned a value) and false otherwise */ public boolean isSetSites() { return this.sites != null; } public void setSitesIsSet(boolean value) { if (!value) { this.sites = null; } } public String getId() { return this.id; } public stopSiteSensors_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 SITES: if (value == null) { unsetSites(); } else { setSites((List<String>)value); } break; case ID: if (value == null) { unsetId(); } else { setId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITES: return getSites(); 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 SITES: return isSetSites(); case ID: return isSetId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof stopSiteSensors_args) return this.equals((stopSiteSensors_args)that); return false; } public boolean equals(stopSiteSensors_args that) { if (that == null) return false; boolean this_present_sites = true && this.isSetSites(); boolean that_present_sites = true && that.isSetSites(); if (this_present_sites || that_present_sites) { if (!(this_present_sites && that_present_sites)) return false; if (!this.sites.equals(that.sites)) 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(stopSiteSensors_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSites()).compareTo(other.isSetSites()); if (lastComparison != 0) { return lastComparison; } if (isSetSites()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sites, other.sites); if (lastComparison != 0) { return lastComparison; } } 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("stopSiteSensors_args("); boolean first = true; sb.append("sites:"); if (this.sites == null) { sb.append("null"); } else { sb.append(this.sites); } first = false; if (!first) sb.append(", "); 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 stopSiteSensors_argsStandardSchemeFactory implements SchemeFactory { public stopSiteSensors_argsStandardScheme getScheme() { return new stopSiteSensors_argsStandardScheme(); } } private static class stopSiteSensors_argsStandardScheme extends StandardScheme<stopSiteSensors_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, stopSiteSensors_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: // SITES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list32 = iprot.readListBegin(); struct.sites = new ArrayList<String>(_list32.size); for (int _i33 = 0; _i33 < _list32.size; ++_i33) { String _elem34; _elem34 = iprot.readString(); struct.sites.add(_elem34); } iprot.readListEnd(); } struct.setSitesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // 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, stopSiteSensors_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.sites != null) { oprot.writeFieldBegin(SITES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sites.size())); for (String _iter35 : struct.sites) { oprot.writeString(_iter35); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.id != null) { oprot.writeFieldBegin(ID_FIELD_DESC); oprot.writeString(struct.id); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class stopSiteSensors_argsTupleSchemeFactory implements SchemeFactory { public stopSiteSensors_argsTupleScheme getScheme() { return new stopSiteSensors_argsTupleScheme(); } } private static class stopSiteSensors_argsTupleScheme extends TupleScheme<stopSiteSensors_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, stopSiteSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSites()) { optionals.set(0); } if (struct.isSetId()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSites()) { { oprot.writeI32(struct.sites.size()); for (String _iter36 : struct.sites) { oprot.writeString(_iter36); } } } if (struct.isSetId()) { oprot.writeString(struct.id); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, stopSiteSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.sites = new ArrayList<String>(_list37.size); for (int _i38 = 0; _i38 < _list37.size; ++_i38) { String _elem39; _elem39 = iprot.readString(); struct.sites.add(_elem39); } } struct.setSitesIsSet(true); } if (incoming.get(1)) { struct.id = iprot.readString(); struct.setIdIsSet(true); } } } } public static class stopSiteSensors_result implements org.apache.thrift.TBase<stopSiteSensors_result, stopSiteSensors_result._Fields>, java.io.Serializable, Cloneable, Comparable<stopSiteSensors_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopSiteSensors_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 stopSiteSensors_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new stopSiteSensors_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(stopSiteSensors_result.class, metaDataMap); } public stopSiteSensors_result() { } public stopSiteSensors_result( cgl.iotcloud.core.api.thrift.TResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public stopSiteSensors_result(stopSiteSensors_result other) { if (other.isSetSuccess()) { this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success); } } public stopSiteSensors_result deepCopy() { return new stopSiteSensors_result(this); } @Override public void clear() { this.success = null; } public cgl.iotcloud.core.api.thrift.TResponse getSuccess() { return this.success; } public stopSiteSensors_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 stopSiteSensors_result) return this.equals((stopSiteSensors_result)that); return false; } public boolean equals(stopSiteSensors_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(stopSiteSensors_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("stopSiteSensors_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 stopSiteSensors_resultStandardSchemeFactory implements SchemeFactory { public stopSiteSensors_resultStandardScheme getScheme() { return new stopSiteSensors_resultStandardScheme(); } } private static class stopSiteSensors_resultStandardScheme extends StandardScheme<stopSiteSensors_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, stopSiteSensors_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, stopSiteSensors_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 stopSiteSensors_resultTupleSchemeFactory implements SchemeFactory { public stopSiteSensors_resultTupleScheme getScheme() { return new stopSiteSensors_resultTupleScheme(); } } private static class stopSiteSensors_resultTupleScheme extends TupleScheme<stopSiteSensors_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, stopSiteSensors_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, stopSiteSensors_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 stopAllSensors_args implements org.apache.thrift.TBase<stopAllSensors_args, stopAllSensors_args._Fields>, java.io.Serializable, Cloneable, Comparable<stopAllSensors_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopAllSensors_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 stopAllSensors_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new stopAllSensors_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(stopAllSensors_args.class, metaDataMap); } public stopAllSensors_args() { } public stopAllSensors_args( String id) { this(); this.id = id; } /** * Performs a deep copy on <i>other</i>. */ public stopAllSensors_args(stopAllSensors_args other) { if (other.isSetId()) { this.id = other.id; } } public stopAllSensors_args deepCopy() { return new stopAllSensors_args(this); } @Override public void clear() { this.id = null; } public String getId() { return this.id; } public stopAllSensors_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 stopAllSensors_args) return this.equals((stopAllSensors_args)that); return false; } public boolean equals(stopAllSensors_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(stopAllSensors_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("stopAllSensors_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 stopAllSensors_argsStandardSchemeFactory implements SchemeFactory { public stopAllSensors_argsStandardScheme getScheme() { return new stopAllSensors_argsStandardScheme(); } } private static class stopAllSensors_argsStandardScheme extends StandardScheme<stopAllSensors_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, stopAllSensors_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, stopAllSensors_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 stopAllSensors_argsTupleSchemeFactory implements SchemeFactory { public stopAllSensors_argsTupleScheme getScheme() { return new stopAllSensors_argsTupleScheme(); } } private static class stopAllSensors_argsTupleScheme extends TupleScheme<stopAllSensors_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, stopAllSensors_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, stopAllSensors_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 stopAllSensors_result implements org.apache.thrift.TBase<stopAllSensors_result, stopAllSensors_result._Fields>, java.io.Serializable, Cloneable, Comparable<stopAllSensors_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("stopAllSensors_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 stopAllSensors_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new stopAllSensors_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(stopAllSensors_result.class, metaDataMap); } public stopAllSensors_result() { } public stopAllSensors_result( cgl.iotcloud.core.api.thrift.TResponse success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public stopAllSensors_result(stopAllSensors_result other) { if (other.isSetSuccess()) { this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success); } } public stopAllSensors_result deepCopy() { return new stopAllSensors_result(this); } @Override public void clear() { this.success = null; } public cgl.iotcloud.core.api.thrift.TResponse getSuccess() { return this.success; } public stopAllSensors_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 stopAllSensors_result) return this.equals((stopAllSensors_result)that); return false; } public boolean equals(stopAllSensors_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(stopAllSensors_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("stopAllSensors_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 stopAllSensors_resultStandardSchemeFactory implements SchemeFactory { public stopAllSensors_resultStandardScheme getScheme() { return new stopAllSensors_resultStandardScheme(); } } private static class stopAllSensors_resultStandardScheme extends StandardScheme<stopAllSensors_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, stopAllSensors_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, stopAllSensors_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 stopAllSensors_resultTupleSchemeFactory implements SchemeFactory { public stopAllSensors_resultTupleScheme getScheme() { return new stopAllSensors_resultTupleScheme(); } } private static class stopAllSensors_resultTupleScheme extends TupleScheme<stopAllSensors_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, stopAllSensors_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, stopAllSensors_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 getSensors_args implements org.apache.thrift.TBase<getSensors_args, getSensors_args._Fields>, java.io.Serializable, Cloneable, Comparable<getSensors_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSensors_args"); private static final org.apache.thrift.protocol.TField SITE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("siteId", 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 getSensors_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSensors_argsTupleSchemeFactory()); } public String siteId; // 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 { SITE_ID((short)1, "siteId"); 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: // SITE_ID return SITE_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.SITE_ID, new org.apache.thrift.meta_data.FieldMetaData("siteId", 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(getSensors_args.class, metaDataMap); } public getSensors_args() { } public getSensors_args( String siteId) { this(); this.siteId = siteId; } /** * Performs a deep copy on <i>other</i>. */ public getSensors_args(getSensors_args other) { if (other.isSetSiteId()) { this.siteId = other.siteId; } } public getSensors_args deepCopy() { return new getSensors_args(this); } @Override public void clear() { this.siteId = null; } public String getSiteId() { return this.siteId; } public getSensors_args setSiteId(String siteId) { this.siteId = siteId; return this; } public void unsetSiteId() { this.siteId = null; } /** Returns true if field siteId is set (has been assigned a value) and false otherwise */ public boolean isSetSiteId() { return this.siteId != null; } public void setSiteIdIsSet(boolean value) { if (!value) { this.siteId = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SITE_ID: if (value == null) { unsetSiteId(); } else { setSiteId((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SITE_ID: return getSiteId(); } 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 SITE_ID: return isSetSiteId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getSensors_args) return this.equals((getSensors_args)that); return false; } public boolean equals(getSensors_args that) { if (that == null) return false; boolean this_present_siteId = true && this.isSetSiteId(); boolean that_present_siteId = true && that.isSetSiteId(); if (this_present_siteId || that_present_siteId) { if (!(this_present_siteId && that_present_siteId)) return false; if (!this.siteId.equals(that.siteId)) return false; } return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getSensors_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSiteId()).compareTo(other.isSetSiteId()); if (lastComparison != 0) { return lastComparison; } if (isSetSiteId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.siteId, other.siteId); 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("getSensors_args("); boolean first = true; sb.append("siteId:"); if (this.siteId == null) { sb.append("null"); } else { sb.append(this.siteId); } 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 getSensors_argsStandardSchemeFactory implements SchemeFactory { public getSensors_argsStandardScheme getScheme() { return new getSensors_argsStandardScheme(); } } private static class getSensors_argsStandardScheme extends StandardScheme<getSensors_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSensors_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: // SITE_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.siteId = iprot.readString(); struct.setSiteIdIsSet(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, getSensors_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.siteId != null) { oprot.writeFieldBegin(SITE_ID_FIELD_DESC); oprot.writeString(struct.siteId); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSensors_argsTupleSchemeFactory implements SchemeFactory { public getSensors_argsTupleScheme getScheme() { return new getSensors_argsTupleScheme(); } } private static class getSensors_argsTupleScheme extends TupleScheme<getSensors_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSiteId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSiteId()) { oprot.writeString(struct.siteId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.siteId = iprot.readString(); struct.setSiteIdIsSet(true); } } } } public static class getSensors_result implements org.apache.thrift.TBase<getSensors_result, getSensors_result._Fields>, java.io.Serializable, Cloneable, Comparable<getSensors_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getSensors_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getSensors_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getSensors_resultTupleSchemeFactory()); } public List<cgl.iotcloud.core.api.thrift.TSensor> 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.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TSensor.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getSensors_result.class, metaDataMap); } public getSensors_result() { } public getSensors_result( List<cgl.iotcloud.core.api.thrift.TSensor> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getSensors_result(getSensors_result other) { if (other.isSetSuccess()) { List<cgl.iotcloud.core.api.thrift.TSensor> __this__success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(other.success.size()); for (cgl.iotcloud.core.api.thrift.TSensor other_element : other.success) { __this__success.add(new cgl.iotcloud.core.api.thrift.TSensor(other_element)); } this.success = __this__success; } } public getSensors_result deepCopy() { return new getSensors_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<cgl.iotcloud.core.api.thrift.TSensor> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(cgl.iotcloud.core.api.thrift.TSensor elem) { if (this.success == null) { this.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(); } this.success.add(elem); } public List<cgl.iotcloud.core.api.thrift.TSensor> getSuccess() { return this.success; } public getSensors_result setSuccess(List<cgl.iotcloud.core.api.thrift.TSensor> 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((List<cgl.iotcloud.core.api.thrift.TSensor>)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 getSensors_result) return this.equals((getSensors_result)that); return false; } public boolean equals(getSensors_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(getSensors_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("getSensors_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getSensors_resultStandardSchemeFactory implements SchemeFactory { public getSensors_resultStandardScheme getScheme() { return new getSensors_resultStandardScheme(); } } private static class getSensors_resultStandardScheme extends StandardScheme<getSensors_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getSensors_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.LIST) { { org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); struct.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(_list40.size); for (int _i41 = 0; _i41 < _list40.size; ++_i41) { cgl.iotcloud.core.api.thrift.TSensor _elem42; _elem42 = new cgl.iotcloud.core.api.thrift.TSensor(); _elem42.read(iprot); struct.success.add(_elem42); } iprot.readListEnd(); } 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, getSensors_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (cgl.iotcloud.core.api.thrift.TSensor _iter43 : struct.success) { _iter43.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getSensors_resultTupleSchemeFactory implements SchemeFactory { public getSensors_resultTupleScheme getScheme() { return new getSensors_resultTupleScheme(); } } private static class getSensors_resultTupleScheme extends TupleScheme<getSensors_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getSensors_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (cgl.iotcloud.core.api.thrift.TSensor _iter44 : struct.success) { _iter44.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getSensors_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(_list45.size); for (int _i46 = 0; _i46 < _list45.size; ++_i46) { cgl.iotcloud.core.api.thrift.TSensor _elem47; _elem47 = new cgl.iotcloud.core.api.thrift.TSensor(); _elem47.read(iprot); struct.success.add(_elem47); } } struct.setSuccessIsSet(true); } } } } public static class getAllSensors_args implements org.apache.thrift.TBase<getAllSensors_args, getAllSensors_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSensors_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSensors_args"); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getAllSensors_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new getAllSensors_argsTupleSchemeFactory()); } /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { ; private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { default: return null; } } /** * Find the _Fields constant that matches fieldId, throwing an exception * if it is not found. */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; } /** * Find the _Fields constant that matches name, or null if its not found. */ public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; private final String _fieldName; _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } public short getThriftFieldId() { return _thriftId; } public String getFieldName() { return _fieldName; } } public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllSensors_args.class, metaDataMap); } public getAllSensors_args() { } /** * Performs a deep copy on <i>other</i>. */ public getAllSensors_args(getAllSensors_args other) { } public getAllSensors_args deepCopy() { return new getAllSensors_args(this); } @Override public void clear() { } public void setFieldValue(_Fields field, Object value) { switch (field) { } } public Object getFieldValue(_Fields field) { switch (field) { } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof getAllSensors_args) return this.equals((getAllSensors_args)that); return false; } public boolean equals(getAllSensors_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } @Override public int compareTo(getAllSensors_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("getAllSensors_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getAllSensors_argsStandardSchemeFactory implements SchemeFactory { public getAllSensors_argsStandardScheme getScheme() { return new getAllSensors_argsStandardScheme(); } } private static class getAllSensors_argsStandardScheme extends StandardScheme<getAllSensors_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSensors_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(org.apache.thrift.protocol.TProtocol oprot, getAllSensors_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getAllSensors_argsTupleSchemeFactory implements SchemeFactory { public getAllSensors_argsTupleScheme getScheme() { return new getAllSensors_argsTupleScheme(); } } private static class getAllSensors_argsTupleScheme extends TupleScheme<getAllSensors_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getAllSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getAllSensors_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; } } } public static class getAllSensors_result implements org.apache.thrift.TBase<getAllSensors_result, getAllSensors_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllSensors_result> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllSensors_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new getAllSensors_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new getAllSensors_resultTupleSchemeFactory()); } public List<cgl.iotcloud.core.api.thrift.TSensor> 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.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TSensor.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllSensors_result.class, metaDataMap); } public getAllSensors_result() { } public getAllSensors_result( List<cgl.iotcloud.core.api.thrift.TSensor> success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public getAllSensors_result(getAllSensors_result other) { if (other.isSetSuccess()) { List<cgl.iotcloud.core.api.thrift.TSensor> __this__success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(other.success.size()); for (cgl.iotcloud.core.api.thrift.TSensor other_element : other.success) { __this__success.add(new cgl.iotcloud.core.api.thrift.TSensor(other_element)); } this.success = __this__success; } } public getAllSensors_result deepCopy() { return new getAllSensors_result(this); } @Override public void clear() { this.success = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<cgl.iotcloud.core.api.thrift.TSensor> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(cgl.iotcloud.core.api.thrift.TSensor elem) { if (this.success == null) { this.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(); } this.success.add(elem); } public List<cgl.iotcloud.core.api.thrift.TSensor> getSuccess() { return this.success; } public getAllSensors_result setSuccess(List<cgl.iotcloud.core.api.thrift.TSensor> 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((List<cgl.iotcloud.core.api.thrift.TSensor>)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 getAllSensors_result) return this.equals((getAllSensors_result)that); return false; } public boolean equals(getAllSensors_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(getAllSensors_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("getAllSensors_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class getAllSensors_resultStandardSchemeFactory implements SchemeFactory { public getAllSensors_resultStandardScheme getScheme() { return new getAllSensors_resultStandardScheme(); } } private static class getAllSensors_resultStandardScheme extends StandardScheme<getAllSensors_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, getAllSensors_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.LIST) { { org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); struct.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(_list48.size); for (int _i49 = 0; _i49 < _list48.size; ++_i49) { cgl.iotcloud.core.api.thrift.TSensor _elem50; _elem50 = new cgl.iotcloud.core.api.thrift.TSensor(); _elem50.read(iprot); struct.success.add(_elem50); } iprot.readListEnd(); } 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, getAllSensors_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); for (cgl.iotcloud.core.api.thrift.TSensor _iter51 : struct.success) { _iter51.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class getAllSensors_resultTupleSchemeFactory implements SchemeFactory { public getAllSensors_resultTupleScheme getScheme() { return new getAllSensors_resultTupleScheme(); } } private static class getAllSensors_resultTupleScheme extends TupleScheme<getAllSensors_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getAllSensors_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (cgl.iotcloud.core.api.thrift.TSensor _iter52 : struct.success) { _iter52.write(oprot); } } } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getAllSensors_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<cgl.iotcloud.core.api.thrift.TSensor>(_list53.size); for (int _i54 = 0; _i54 < _list53.size; ++_i54) { cgl.iotcloud.core.api.thrift.TSensor _elem55; _elem55 = new cgl.iotcloud.core.api.thrift.TSensor(); _elem55.read(iprot); struct.success.add(_elem55); } } struct.setSuccessIsSet(true); } } } } }