/*
* 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.master.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 TMasterService {
public interface Iface {
public cgl.iotcloud.core.api.thrift.TResponse registerSite(cgl.iotcloud.core.api.thrift.TSite request) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse unRegisterSite(cgl.iotcloud.core.api.thrift.TSite site) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse registerSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse unRegisterSensor(String siteId, String sensor) throws org.apache.thrift.TException;
public cgl.iotcloud.core.api.thrift.TResponse updateSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void registerSite(cgl.iotcloud.core.api.thrift.TSite request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unRegisterSite(cgl.iotcloud.core.api.thrift.TSite site, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void registerSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unRegisterSensor(String siteId, String sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void updateSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public cgl.iotcloud.core.api.thrift.TResponse registerSite(cgl.iotcloud.core.api.thrift.TSite request) throws org.apache.thrift.TException
{
send_registerSite(request);
return recv_registerSite();
}
public void send_registerSite(cgl.iotcloud.core.api.thrift.TSite request) throws org.apache.thrift.TException
{
registerSite_args args = new registerSite_args();
args.setRequest(request);
sendBase("registerSite", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_registerSite() throws org.apache.thrift.TException
{
registerSite_result result = new registerSite_result();
receiveBase(result, "registerSite");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerSite failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse unRegisterSite(cgl.iotcloud.core.api.thrift.TSite site) throws org.apache.thrift.TException
{
send_unRegisterSite(site);
return recv_unRegisterSite();
}
public void send_unRegisterSite(cgl.iotcloud.core.api.thrift.TSite site) throws org.apache.thrift.TException
{
unRegisterSite_args args = new unRegisterSite_args();
args.setSite(site);
sendBase("unRegisterSite", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_unRegisterSite() throws org.apache.thrift.TException
{
unRegisterSite_result result = new unRegisterSite_result();
receiveBase(result, "unRegisterSite");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "unRegisterSite failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse registerSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException
{
send_registerSensor(siteId, sensor);
return recv_registerSensor();
}
public void send_registerSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException
{
registerSensor_args args = new registerSensor_args();
args.setSiteId(siteId);
args.setSensor(sensor);
sendBase("registerSensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_registerSensor() throws org.apache.thrift.TException
{
registerSensor_result result = new registerSensor_result();
receiveBase(result, "registerSensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerSensor failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse unRegisterSensor(String siteId, String sensor) throws org.apache.thrift.TException
{
send_unRegisterSensor(siteId, sensor);
return recv_unRegisterSensor();
}
public void send_unRegisterSensor(String siteId, String sensor) throws org.apache.thrift.TException
{
unRegisterSensor_args args = new unRegisterSensor_args();
args.setSiteId(siteId);
args.setSensor(sensor);
sendBase("unRegisterSensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_unRegisterSensor() throws org.apache.thrift.TException
{
unRegisterSensor_result result = new unRegisterSensor_result();
receiveBase(result, "unRegisterSensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "unRegisterSensor failed: unknown result");
}
public cgl.iotcloud.core.api.thrift.TResponse updateSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException
{
send_updateSensor(siteId, sensor);
return recv_updateSensor();
}
public void send_updateSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor) throws org.apache.thrift.TException
{
updateSensor_args args = new updateSensor_args();
args.setSiteId(siteId);
args.setSensor(sensor);
sendBase("updateSensor", args);
}
public cgl.iotcloud.core.api.thrift.TResponse recv_updateSensor() throws org.apache.thrift.TException
{
updateSensor_result result = new updateSensor_result();
receiveBase(result, "updateSensor");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateSensor 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 registerSite(cgl.iotcloud.core.api.thrift.TSite request, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
registerSite_call method_call = new registerSite_call(request, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class registerSite_call extends org.apache.thrift.async.TAsyncMethodCall {
private cgl.iotcloud.core.api.thrift.TSite request;
public registerSite_call(cgl.iotcloud.core.api.thrift.TSite request, 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.request = request;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerSite", org.apache.thrift.protocol.TMessageType.CALL, 0));
registerSite_args args = new registerSite_args();
args.setRequest(request);
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_registerSite();
}
}
public void unRegisterSite(cgl.iotcloud.core.api.thrift.TSite site, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unRegisterSite_call method_call = new unRegisterSite_call(site, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class unRegisterSite_call extends org.apache.thrift.async.TAsyncMethodCall {
private cgl.iotcloud.core.api.thrift.TSite site;
public unRegisterSite_call(cgl.iotcloud.core.api.thrift.TSite site, 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.site = site;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unRegisterSite", org.apache.thrift.protocol.TMessageType.CALL, 0));
unRegisterSite_args args = new unRegisterSite_args();
args.setSite(site);
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_unRegisterSite();
}
}
public void registerSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
registerSensor_call method_call = new registerSensor_call(siteId, sensor, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class registerSensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String siteId;
private cgl.iotcloud.core.api.thrift.TSensor sensor;
public registerSensor_call(String siteId, cgl.iotcloud.core.api.thrift.TSensor 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.siteId = siteId;
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("registerSensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
registerSensor_args args = new registerSensor_args();
args.setSiteId(siteId);
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_registerSensor();
}
}
public void unRegisterSensor(String siteId, String sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unRegisterSensor_call method_call = new unRegisterSensor_call(siteId, sensor, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class unRegisterSensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String siteId;
private String sensor;
public unRegisterSensor_call(String siteId, String 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.siteId = siteId;
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("unRegisterSensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
unRegisterSensor_args args = new unRegisterSensor_args();
args.setSiteId(siteId);
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_unRegisterSensor();
}
}
public void updateSensor(String siteId, cgl.iotcloud.core.api.thrift.TSensor sensor, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
updateSensor_call method_call = new updateSensor_call(siteId, sensor, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class updateSensor_call extends org.apache.thrift.async.TAsyncMethodCall {
private String siteId;
private cgl.iotcloud.core.api.thrift.TSensor sensor;
public updateSensor_call(String siteId, cgl.iotcloud.core.api.thrift.TSensor 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.siteId = siteId;
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("updateSensor", org.apache.thrift.protocol.TMessageType.CALL, 0));
updateSensor_args args = new updateSensor_args();
args.setSiteId(siteId);
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_updateSensor();
}
}
}
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("registerSite", new registerSite());
processMap.put("unRegisterSite", new unRegisterSite());
processMap.put("registerSensor", new registerSensor());
processMap.put("unRegisterSensor", new unRegisterSensor());
processMap.put("updateSensor", new updateSensor());
return processMap;
}
public static class registerSite<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerSite_args> {
public registerSite() {
super("registerSite");
}
public registerSite_args getEmptyArgsInstance() {
return new registerSite_args();
}
protected boolean isOneway() {
return false;
}
public registerSite_result getResult(I iface, registerSite_args args) throws org.apache.thrift.TException {
registerSite_result result = new registerSite_result();
result.success = iface.registerSite(args.request);
return result;
}
}
public static class unRegisterSite<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unRegisterSite_args> {
public unRegisterSite() {
super("unRegisterSite");
}
public unRegisterSite_args getEmptyArgsInstance() {
return new unRegisterSite_args();
}
protected boolean isOneway() {
return false;
}
public unRegisterSite_result getResult(I iface, unRegisterSite_args args) throws org.apache.thrift.TException {
unRegisterSite_result result = new unRegisterSite_result();
result.success = iface.unRegisterSite(args.site);
return result;
}
}
public static class registerSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerSensor_args> {
public registerSensor() {
super("registerSensor");
}
public registerSensor_args getEmptyArgsInstance() {
return new registerSensor_args();
}
protected boolean isOneway() {
return false;
}
public registerSensor_result getResult(I iface, registerSensor_args args) throws org.apache.thrift.TException {
registerSensor_result result = new registerSensor_result();
result.success = iface.registerSensor(args.siteId, args.sensor);
return result;
}
}
public static class unRegisterSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unRegisterSensor_args> {
public unRegisterSensor() {
super("unRegisterSensor");
}
public unRegisterSensor_args getEmptyArgsInstance() {
return new unRegisterSensor_args();
}
protected boolean isOneway() {
return false;
}
public unRegisterSensor_result getResult(I iface, unRegisterSensor_args args) throws org.apache.thrift.TException {
unRegisterSensor_result result = new unRegisterSensor_result();
result.success = iface.unRegisterSensor(args.siteId, args.sensor);
return result;
}
}
public static class updateSensor<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateSensor_args> {
public updateSensor() {
super("updateSensor");
}
public updateSensor_args getEmptyArgsInstance() {
return new updateSensor_args();
}
protected boolean isOneway() {
return false;
}
public updateSensor_result getResult(I iface, updateSensor_args args) throws org.apache.thrift.TException {
updateSensor_result result = new updateSensor_result();
result.success = iface.updateSensor(args.siteId, args.sensor);
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("registerSite", new registerSite());
processMap.put("unRegisterSite", new unRegisterSite());
processMap.put("registerSensor", new registerSensor());
processMap.put("unRegisterSensor", new unRegisterSensor());
processMap.put("updateSensor", new updateSensor());
return processMap;
}
public static class registerSite<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerSite_args, cgl.iotcloud.core.api.thrift.TResponse> {
public registerSite() {
super("registerSite");
}
public registerSite_args getEmptyArgsInstance() {
return new registerSite_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) {
registerSite_result result = new registerSite_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;
registerSite_result result = new registerSite_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, registerSite_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.registerSite(args.request,resultHandler);
}
}
public static class unRegisterSite<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unRegisterSite_args, cgl.iotcloud.core.api.thrift.TResponse> {
public unRegisterSite() {
super("unRegisterSite");
}
public unRegisterSite_args getEmptyArgsInstance() {
return new unRegisterSite_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) {
unRegisterSite_result result = new unRegisterSite_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;
unRegisterSite_result result = new unRegisterSite_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, unRegisterSite_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.unRegisterSite(args.site,resultHandler);
}
}
public static class registerSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, registerSensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public registerSensor() {
super("registerSensor");
}
public registerSensor_args getEmptyArgsInstance() {
return new registerSensor_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) {
registerSensor_result result = new registerSensor_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;
registerSensor_result result = new registerSensor_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, registerSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.registerSensor(args.siteId, args.sensor,resultHandler);
}
}
public static class unRegisterSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, unRegisterSensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public unRegisterSensor() {
super("unRegisterSensor");
}
public unRegisterSensor_args getEmptyArgsInstance() {
return new unRegisterSensor_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) {
unRegisterSensor_result result = new unRegisterSensor_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;
unRegisterSensor_result result = new unRegisterSensor_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, unRegisterSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.unRegisterSensor(args.siteId, args.sensor,resultHandler);
}
}
public static class updateSensor<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateSensor_args, cgl.iotcloud.core.api.thrift.TResponse> {
public updateSensor() {
super("updateSensor");
}
public updateSensor_args getEmptyArgsInstance() {
return new updateSensor_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) {
updateSensor_result result = new updateSensor_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;
updateSensor_result result = new updateSensor_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, updateSensor_args args, org.apache.thrift.async.AsyncMethodCallback<cgl.iotcloud.core.api.thrift.TResponse> resultHandler) throws TException {
iface.updateSensor(args.siteId, args.sensor,resultHandler);
}
}
}
public static class registerSite_args implements org.apache.thrift.TBase<registerSite_args, registerSite_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerSite_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerSite_args");
private static final org.apache.thrift.protocol.TField REQUEST_FIELD_DESC = new org.apache.thrift.protocol.TField("request", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new registerSite_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerSite_argsTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TSite request; // 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 {
REQUEST((short)1, "request");
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: // REQUEST
return REQUEST;
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.REQUEST, new org.apache.thrift.meta_data.FieldMetaData("request", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TSite.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerSite_args.class, metaDataMap);
}
public registerSite_args() {
}
public registerSite_args(
cgl.iotcloud.core.api.thrift.TSite request)
{
this();
this.request = request;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerSite_args(registerSite_args other) {
if (other.isSetRequest()) {
this.request = new cgl.iotcloud.core.api.thrift.TSite(other.request);
}
}
public registerSite_args deepCopy() {
return new registerSite_args(this);
}
@Override
public void clear() {
this.request = null;
}
public cgl.iotcloud.core.api.thrift.TSite getRequest() {
return this.request;
}
public registerSite_args setRequest(cgl.iotcloud.core.api.thrift.TSite request) {
this.request = request;
return this;
}
public void unsetRequest() {
this.request = null;
}
/** Returns true if field request is set (has been assigned a value) and false otherwise */
public boolean isSetRequest() {
return this.request != null;
}
public void setRequestIsSet(boolean value) {
if (!value) {
this.request = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case REQUEST:
if (value == null) {
unsetRequest();
} else {
setRequest((cgl.iotcloud.core.api.thrift.TSite)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case REQUEST:
return getRequest();
}
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 REQUEST:
return isSetRequest();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof registerSite_args)
return this.equals((registerSite_args)that);
return false;
}
public boolean equals(registerSite_args that) {
if (that == null)
return false;
boolean this_present_request = true && this.isSetRequest();
boolean that_present_request = true && that.isSetRequest();
if (this_present_request || that_present_request) {
if (!(this_present_request && that_present_request))
return false;
if (!this.request.equals(that.request))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(registerSite_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetRequest()).compareTo(other.isSetRequest());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRequest()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request, other.request);
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("registerSite_args(");
boolean first = true;
sb.append("request:");
if (this.request == null) {
sb.append("null");
} else {
sb.append(this.request);
}
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 (request != null) {
request.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 registerSite_argsStandardSchemeFactory implements SchemeFactory {
public registerSite_argsStandardScheme getScheme() {
return new registerSite_argsStandardScheme();
}
}
private static class registerSite_argsStandardScheme extends StandardScheme<registerSite_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerSite_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: // REQUEST
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.request = new cgl.iotcloud.core.api.thrift.TSite();
struct.request.read(iprot);
struct.setRequestIsSet(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, registerSite_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.request != null) {
oprot.writeFieldBegin(REQUEST_FIELD_DESC);
struct.request.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class registerSite_argsTupleSchemeFactory implements SchemeFactory {
public registerSite_argsTupleScheme getScheme() {
return new registerSite_argsTupleScheme();
}
}
private static class registerSite_argsTupleScheme extends TupleScheme<registerSite_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerSite_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetRequest()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetRequest()) {
struct.request.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, registerSite_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.request = new cgl.iotcloud.core.api.thrift.TSite();
struct.request.read(iprot);
struct.setRequestIsSet(true);
}
}
}
}
public static class registerSite_result implements org.apache.thrift.TBase<registerSite_result, registerSite_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerSite_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerSite_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 registerSite_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerSite_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(registerSite_result.class, metaDataMap);
}
public registerSite_result() {
}
public registerSite_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerSite_result(registerSite_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public registerSite_result deepCopy() {
return new registerSite_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public registerSite_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 registerSite_result)
return this.equals((registerSite_result)that);
return false;
}
public boolean equals(registerSite_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(registerSite_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("registerSite_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 registerSite_resultStandardSchemeFactory implements SchemeFactory {
public registerSite_resultStandardScheme getScheme() {
return new registerSite_resultStandardScheme();
}
}
private static class registerSite_resultStandardScheme extends StandardScheme<registerSite_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerSite_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, registerSite_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 registerSite_resultTupleSchemeFactory implements SchemeFactory {
public registerSite_resultTupleScheme getScheme() {
return new registerSite_resultTupleScheme();
}
}
private static class registerSite_resultTupleScheme extends TupleScheme<registerSite_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerSite_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, registerSite_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 unRegisterSite_args implements org.apache.thrift.TBase<unRegisterSite_args, unRegisterSite_args._Fields>, java.io.Serializable, Cloneable, Comparable<unRegisterSite_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unRegisterSite_args");
private static final org.apache.thrift.protocol.TField SITE_FIELD_DESC = new org.apache.thrift.protocol.TField("site", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new unRegisterSite_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new unRegisterSite_argsTupleSchemeFactory());
}
public cgl.iotcloud.core.api.thrift.TSite site; // 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((short)1, "site");
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
return SITE;
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, new org.apache.thrift.meta_data.FieldMetaData("site", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, cgl.iotcloud.core.api.thrift.TSite.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unRegisterSite_args.class, metaDataMap);
}
public unRegisterSite_args() {
}
public unRegisterSite_args(
cgl.iotcloud.core.api.thrift.TSite site)
{
this();
this.site = site;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unRegisterSite_args(unRegisterSite_args other) {
if (other.isSetSite()) {
this.site = new cgl.iotcloud.core.api.thrift.TSite(other.site);
}
}
public unRegisterSite_args deepCopy() {
return new unRegisterSite_args(this);
}
@Override
public void clear() {
this.site = null;
}
public cgl.iotcloud.core.api.thrift.TSite getSite() {
return this.site;
}
public unRegisterSite_args setSite(cgl.iotcloud.core.api.thrift.TSite site) {
this.site = site;
return this;
}
public void unsetSite() {
this.site = null;
}
/** Returns true if field site is set (has been assigned a value) and false otherwise */
public boolean isSetSite() {
return this.site != null;
}
public void setSiteIsSet(boolean value) {
if (!value) {
this.site = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SITE:
if (value == null) {
unsetSite();
} else {
setSite((cgl.iotcloud.core.api.thrift.TSite)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SITE:
return getSite();
}
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:
return isSetSite();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof unRegisterSite_args)
return this.equals((unRegisterSite_args)that);
return false;
}
public boolean equals(unRegisterSite_args that) {
if (that == null)
return false;
boolean this_present_site = true && this.isSetSite();
boolean that_present_site = true && that.isSetSite();
if (this_present_site || that_present_site) {
if (!(this_present_site && that_present_site))
return false;
if (!this.site.equals(that.site))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(unRegisterSite_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSite()).compareTo(other.isSetSite());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSite()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.site, other.site);
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("unRegisterSite_args(");
boolean first = true;
sb.append("site:");
if (this.site == null) {
sb.append("null");
} else {
sb.append(this.site);
}
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 (site != null) {
site.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 unRegisterSite_argsStandardSchemeFactory implements SchemeFactory {
public unRegisterSite_argsStandardScheme getScheme() {
return new unRegisterSite_argsStandardScheme();
}
}
private static class unRegisterSite_argsStandardScheme extends StandardScheme<unRegisterSite_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unRegisterSite_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
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.site = new cgl.iotcloud.core.api.thrift.TSite();
struct.site.read(iprot);
struct.setSiteIsSet(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, unRegisterSite_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.site != null) {
oprot.writeFieldBegin(SITE_FIELD_DESC);
struct.site.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unRegisterSite_argsTupleSchemeFactory implements SchemeFactory {
public unRegisterSite_argsTupleScheme getScheme() {
return new unRegisterSite_argsTupleScheme();
}
}
private static class unRegisterSite_argsTupleScheme extends TupleScheme<unRegisterSite_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unRegisterSite_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSite()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSite()) {
struct.site.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unRegisterSite_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.site = new cgl.iotcloud.core.api.thrift.TSite();
struct.site.read(iprot);
struct.setSiteIsSet(true);
}
}
}
}
public static class unRegisterSite_result implements org.apache.thrift.TBase<unRegisterSite_result, unRegisterSite_result._Fields>, java.io.Serializable, Cloneable, Comparable<unRegisterSite_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unRegisterSite_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 unRegisterSite_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new unRegisterSite_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(unRegisterSite_result.class, metaDataMap);
}
public unRegisterSite_result() {
}
public unRegisterSite_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unRegisterSite_result(unRegisterSite_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public unRegisterSite_result deepCopy() {
return new unRegisterSite_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public unRegisterSite_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 unRegisterSite_result)
return this.equals((unRegisterSite_result)that);
return false;
}
public boolean equals(unRegisterSite_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(unRegisterSite_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("unRegisterSite_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 unRegisterSite_resultStandardSchemeFactory implements SchemeFactory {
public unRegisterSite_resultStandardScheme getScheme() {
return new unRegisterSite_resultStandardScheme();
}
}
private static class unRegisterSite_resultStandardScheme extends StandardScheme<unRegisterSite_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unRegisterSite_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, unRegisterSite_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 unRegisterSite_resultTupleSchemeFactory implements SchemeFactory {
public unRegisterSite_resultTupleScheme getScheme() {
return new unRegisterSite_resultTupleScheme();
}
}
private static class unRegisterSite_resultTupleScheme extends TupleScheme<unRegisterSite_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unRegisterSite_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, unRegisterSite_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 registerSensor_args implements org.apache.thrift.TBase<registerSensor_args, registerSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<registerSensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerSensor_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 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 registerSensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerSensor_argsTupleSchemeFactory());
}
public String siteId; // required
public cgl.iotcloud.core.api.thrift.TSensor 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 {
SITE_ID((short)1, "siteId"),
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: // SITE_ID
return SITE_ID;
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.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)));
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.TSensor.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(registerSensor_args.class, metaDataMap);
}
public registerSensor_args() {
}
public registerSensor_args(
String siteId,
cgl.iotcloud.core.api.thrift.TSensor sensor)
{
this();
this.siteId = siteId;
this.sensor = sensor;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerSensor_args(registerSensor_args other) {
if (other.isSetSiteId()) {
this.siteId = other.siteId;
}
if (other.isSetSensor()) {
this.sensor = new cgl.iotcloud.core.api.thrift.TSensor(other.sensor);
}
}
public registerSensor_args deepCopy() {
return new registerSensor_args(this);
}
@Override
public void clear() {
this.siteId = null;
this.sensor = null;
}
public String getSiteId() {
return this.siteId;
}
public registerSensor_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 cgl.iotcloud.core.api.thrift.TSensor getSensor() {
return this.sensor;
}
public registerSensor_args setSensor(cgl.iotcloud.core.api.thrift.TSensor 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 SITE_ID:
if (value == null) {
unsetSiteId();
} else {
setSiteId((String)value);
}
break;
case SENSOR:
if (value == null) {
unsetSensor();
} else {
setSensor((cgl.iotcloud.core.api.thrift.TSensor)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SITE_ID:
return getSiteId();
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 SITE_ID:
return isSetSiteId();
case SENSOR:
return isSetSensor();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof registerSensor_args)
return this.equals((registerSensor_args)that);
return false;
}
public boolean equals(registerSensor_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;
}
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(registerSensor_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;
}
}
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("registerSensor_args(");
boolean first = true;
sb.append("siteId:");
if (this.siteId == null) {
sb.append("null");
} else {
sb.append(this.siteId);
}
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 registerSensor_argsStandardSchemeFactory implements SchemeFactory {
public registerSensor_argsStandardScheme getScheme() {
return new registerSensor_argsStandardScheme();
}
}
private static class registerSensor_argsStandardScheme extends StandardScheme<registerSensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerSensor_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;
case 2: // SENSOR
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensor();
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, registerSensor_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();
}
if (struct.sensor != null) {
oprot.writeFieldBegin(SENSOR_FIELD_DESC);
struct.sensor.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class registerSensor_argsTupleSchemeFactory implements SchemeFactory {
public registerSensor_argsTupleScheme getScheme() {
return new registerSensor_argsTupleScheme();
}
}
private static class registerSensor_argsTupleScheme extends TupleScheme<registerSensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSiteId()) {
optionals.set(0);
}
if (struct.isSetSensor()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSiteId()) {
oprot.writeString(struct.siteId);
}
if (struct.isSetSensor()) {
struct.sensor.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, registerSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.siteId = iprot.readString();
struct.setSiteIdIsSet(true);
}
if (incoming.get(1)) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensor();
struct.sensor.read(iprot);
struct.setSensorIsSet(true);
}
}
}
}
public static class registerSensor_result implements org.apache.thrift.TBase<registerSensor_result, registerSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<registerSensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerSensor_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 registerSensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerSensor_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(registerSensor_result.class, metaDataMap);
}
public registerSensor_result() {
}
public registerSensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerSensor_result(registerSensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public registerSensor_result deepCopy() {
return new registerSensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public registerSensor_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 registerSensor_result)
return this.equals((registerSensor_result)that);
return false;
}
public boolean equals(registerSensor_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(registerSensor_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("registerSensor_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 registerSensor_resultStandardSchemeFactory implements SchemeFactory {
public registerSensor_resultStandardScheme getScheme() {
return new registerSensor_resultStandardScheme();
}
}
private static class registerSensor_resultStandardScheme extends StandardScheme<registerSensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerSensor_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, registerSensor_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 registerSensor_resultTupleSchemeFactory implements SchemeFactory {
public registerSensor_resultTupleScheme getScheme() {
return new registerSensor_resultTupleScheme();
}
}
private static class registerSensor_resultTupleScheme extends TupleScheme<registerSensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerSensor_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, registerSensor_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 unRegisterSensor_args implements org.apache.thrift.TBase<unRegisterSensor_args, unRegisterSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<unRegisterSensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unRegisterSensor_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 org.apache.thrift.protocol.TField SENSOR_FIELD_DESC = new org.apache.thrift.protocol.TField("sensor", 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 unRegisterSensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new unRegisterSensor_argsTupleSchemeFactory());
}
public String siteId; // required
public String 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 {
SITE_ID((short)1, "siteId"),
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: // SITE_ID
return SITE_ID;
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.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)));
tmpMap.put(_Fields.SENSOR, new org.apache.thrift.meta_data.FieldMetaData("sensor", 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(unRegisterSensor_args.class, metaDataMap);
}
public unRegisterSensor_args() {
}
public unRegisterSensor_args(
String siteId,
String sensor)
{
this();
this.siteId = siteId;
this.sensor = sensor;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unRegisterSensor_args(unRegisterSensor_args other) {
if (other.isSetSiteId()) {
this.siteId = other.siteId;
}
if (other.isSetSensor()) {
this.sensor = other.sensor;
}
}
public unRegisterSensor_args deepCopy() {
return new unRegisterSensor_args(this);
}
@Override
public void clear() {
this.siteId = null;
this.sensor = null;
}
public String getSiteId() {
return this.siteId;
}
public unRegisterSensor_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 String getSensor() {
return this.sensor;
}
public unRegisterSensor_args setSensor(String 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 SITE_ID:
if (value == null) {
unsetSiteId();
} else {
setSiteId((String)value);
}
break;
case SENSOR:
if (value == null) {
unsetSensor();
} else {
setSensor((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SITE_ID:
return getSiteId();
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 SITE_ID:
return isSetSiteId();
case SENSOR:
return isSetSensor();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof unRegisterSensor_args)
return this.equals((unRegisterSensor_args)that);
return false;
}
public boolean equals(unRegisterSensor_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;
}
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(unRegisterSensor_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;
}
}
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("unRegisterSensor_args(");
boolean first = true;
sb.append("siteId:");
if (this.siteId == null) {
sb.append("null");
} else {
sb.append(this.siteId);
}
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
}
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 unRegisterSensor_argsStandardSchemeFactory implements SchemeFactory {
public unRegisterSensor_argsStandardScheme getScheme() {
return new unRegisterSensor_argsStandardScheme();
}
}
private static class unRegisterSensor_argsStandardScheme extends StandardScheme<unRegisterSensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unRegisterSensor_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;
case 2: // SENSOR
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.sensor = iprot.readString();
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, unRegisterSensor_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();
}
if (struct.sensor != null) {
oprot.writeFieldBegin(SENSOR_FIELD_DESC);
oprot.writeString(struct.sensor);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class unRegisterSensor_argsTupleSchemeFactory implements SchemeFactory {
public unRegisterSensor_argsTupleScheme getScheme() {
return new unRegisterSensor_argsTupleScheme();
}
}
private static class unRegisterSensor_argsTupleScheme extends TupleScheme<unRegisterSensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unRegisterSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSiteId()) {
optionals.set(0);
}
if (struct.isSetSensor()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSiteId()) {
oprot.writeString(struct.siteId);
}
if (struct.isSetSensor()) {
oprot.writeString(struct.sensor);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, unRegisterSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.siteId = iprot.readString();
struct.setSiteIdIsSet(true);
}
if (incoming.get(1)) {
struct.sensor = iprot.readString();
struct.setSensorIsSet(true);
}
}
}
}
public static class unRegisterSensor_result implements org.apache.thrift.TBase<unRegisterSensor_result, unRegisterSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<unRegisterSensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unRegisterSensor_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 unRegisterSensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new unRegisterSensor_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(unRegisterSensor_result.class, metaDataMap);
}
public unRegisterSensor_result() {
}
public unRegisterSensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public unRegisterSensor_result(unRegisterSensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public unRegisterSensor_result deepCopy() {
return new unRegisterSensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public unRegisterSensor_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 unRegisterSensor_result)
return this.equals((unRegisterSensor_result)that);
return false;
}
public boolean equals(unRegisterSensor_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(unRegisterSensor_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("unRegisterSensor_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 unRegisterSensor_resultStandardSchemeFactory implements SchemeFactory {
public unRegisterSensor_resultStandardScheme getScheme() {
return new unRegisterSensor_resultStandardScheme();
}
}
private static class unRegisterSensor_resultStandardScheme extends StandardScheme<unRegisterSensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, unRegisterSensor_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, unRegisterSensor_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 unRegisterSensor_resultTupleSchemeFactory implements SchemeFactory {
public unRegisterSensor_resultTupleScheme getScheme() {
return new unRegisterSensor_resultTupleScheme();
}
}
private static class unRegisterSensor_resultTupleScheme extends TupleScheme<unRegisterSensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, unRegisterSensor_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, unRegisterSensor_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 updateSensor_args implements org.apache.thrift.TBase<updateSensor_args, updateSensor_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateSensor_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateSensor_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 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 updateSensor_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new updateSensor_argsTupleSchemeFactory());
}
public String siteId; // required
public cgl.iotcloud.core.api.thrift.TSensor 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 {
SITE_ID((short)1, "siteId"),
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: // SITE_ID
return SITE_ID;
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.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)));
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.TSensor.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateSensor_args.class, metaDataMap);
}
public updateSensor_args() {
}
public updateSensor_args(
String siteId,
cgl.iotcloud.core.api.thrift.TSensor sensor)
{
this();
this.siteId = siteId;
this.sensor = sensor;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateSensor_args(updateSensor_args other) {
if (other.isSetSiteId()) {
this.siteId = other.siteId;
}
if (other.isSetSensor()) {
this.sensor = new cgl.iotcloud.core.api.thrift.TSensor(other.sensor);
}
}
public updateSensor_args deepCopy() {
return new updateSensor_args(this);
}
@Override
public void clear() {
this.siteId = null;
this.sensor = null;
}
public String getSiteId() {
return this.siteId;
}
public updateSensor_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 cgl.iotcloud.core.api.thrift.TSensor getSensor() {
return this.sensor;
}
public updateSensor_args setSensor(cgl.iotcloud.core.api.thrift.TSensor 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 SITE_ID:
if (value == null) {
unsetSiteId();
} else {
setSiteId((String)value);
}
break;
case SENSOR:
if (value == null) {
unsetSensor();
} else {
setSensor((cgl.iotcloud.core.api.thrift.TSensor)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SITE_ID:
return getSiteId();
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 SITE_ID:
return isSetSiteId();
case SENSOR:
return isSetSensor();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof updateSensor_args)
return this.equals((updateSensor_args)that);
return false;
}
public boolean equals(updateSensor_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;
}
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(updateSensor_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;
}
}
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("updateSensor_args(");
boolean first = true;
sb.append("siteId:");
if (this.siteId == null) {
sb.append("null");
} else {
sb.append(this.siteId);
}
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 updateSensor_argsStandardSchemeFactory implements SchemeFactory {
public updateSensor_argsStandardScheme getScheme() {
return new updateSensor_argsStandardScheme();
}
}
private static class updateSensor_argsStandardScheme extends StandardScheme<updateSensor_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateSensor_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;
case 2: // SENSOR
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensor();
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, updateSensor_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();
}
if (struct.sensor != null) {
oprot.writeFieldBegin(SENSOR_FIELD_DESC);
struct.sensor.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateSensor_argsTupleSchemeFactory implements SchemeFactory {
public updateSensor_argsTupleScheme getScheme() {
return new updateSensor_argsTupleScheme();
}
}
private static class updateSensor_argsTupleScheme extends TupleScheme<updateSensor_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSiteId()) {
optionals.set(0);
}
if (struct.isSetSensor()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSiteId()) {
oprot.writeString(struct.siteId);
}
if (struct.isSetSensor()) {
struct.sensor.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateSensor_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.siteId = iprot.readString();
struct.setSiteIdIsSet(true);
}
if (incoming.get(1)) {
struct.sensor = new cgl.iotcloud.core.api.thrift.TSensor();
struct.sensor.read(iprot);
struct.setSensorIsSet(true);
}
}
}
}
public static class updateSensor_result implements org.apache.thrift.TBase<updateSensor_result, updateSensor_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateSensor_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateSensor_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 updateSensor_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new updateSensor_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(updateSensor_result.class, metaDataMap);
}
public updateSensor_result() {
}
public updateSensor_result(
cgl.iotcloud.core.api.thrift.TResponse success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateSensor_result(updateSensor_result other) {
if (other.isSetSuccess()) {
this.success = new cgl.iotcloud.core.api.thrift.TResponse(other.success);
}
}
public updateSensor_result deepCopy() {
return new updateSensor_result(this);
}
@Override
public void clear() {
this.success = null;
}
public cgl.iotcloud.core.api.thrift.TResponse getSuccess() {
return this.success;
}
public updateSensor_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 updateSensor_result)
return this.equals((updateSensor_result)that);
return false;
}
public boolean equals(updateSensor_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(updateSensor_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("updateSensor_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 updateSensor_resultStandardSchemeFactory implements SchemeFactory {
public updateSensor_resultStandardScheme getScheme() {
return new updateSensor_resultStandardScheme();
}
}
private static class updateSensor_resultStandardScheme extends StandardScheme<updateSensor_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateSensor_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, updateSensor_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 updateSensor_resultTupleSchemeFactory implements SchemeFactory {
public updateSensor_resultTupleScheme getScheme() {
return new updateSensor_resultTupleScheme();
}
}
private static class updateSensor_resultTupleScheme extends TupleScheme<updateSensor_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateSensor_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, updateSensor_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);
}
}
}
}
}