/**
* Autogenerated by Thrift Compiler (0.9.1)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.openslx.imagemaster.thrift.iface;
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;
public class ImageServer {
public interface Iface {
public boolean ping() throws org.apache.thrift.TException;
public SessionData authenticate(String username, String password) throws AuthenticationException, org.apache.thrift.TException;
public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException;
public String startServerAuthentication(String organization) throws ServerAuthenticationException, org.apache.thrift.TException;
public ServerSessionData serverAuthenticate(String organization, ByteBuffer challengeResponse) throws ServerAuthenticationException, org.apache.thrift.TException;
public FtpCredentials submitImage(String serverSessionId, ImageData imageDescription) throws AuthorizationException, ImageDataException, org.apache.thrift.TException;
public boolean finshedUpload(String ftpUser, ImageData imageDescription) throws ImageDataException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void authenticate(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void serverAuthenticate(String organization, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void submitImage(String serverSessionId, ImageData imageDescription, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void finshedUpload(String ftpUser, ImageData imageDescription, 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 boolean ping() throws org.apache.thrift.TException
{
send_ping();
return recv_ping();
}
public void send_ping() throws org.apache.thrift.TException
{
ping_args args = new ping_args();
sendBase("ping", args);
}
public boolean recv_ping() throws org.apache.thrift.TException
{
ping_result result = new ping_result();
receiveBase(result, "ping");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result");
}
public SessionData authenticate(String username, String password) throws AuthenticationException, org.apache.thrift.TException
{
send_authenticate(username, password);
return recv_authenticate();
}
public void send_authenticate(String username, String password) throws org.apache.thrift.TException
{
authenticate_args args = new authenticate_args();
args.setUsername(username);
args.setPassword(password);
sendBase("authenticate", args);
}
public SessionData recv_authenticate() throws AuthenticationException, org.apache.thrift.TException
{
authenticate_result result = new authenticate_result();
receiveBase(result, "authenticate");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "authenticate failed: unknown result");
}
public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException
{
send_getUserFromToken(token);
return recv_getUserFromToken();
}
public void send_getUserFromToken(String token) throws org.apache.thrift.TException
{
getUserFromToken_args args = new getUserFromToken_args();
args.setToken(token);
sendBase("getUserFromToken", args);
}
public UserInfo recv_getUserFromToken() throws InvalidTokenException, org.apache.thrift.TException
{
getUserFromToken_result result = new getUserFromToken_result();
receiveBase(result, "getUserFromToken");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserFromToken failed: unknown result");
}
public String startServerAuthentication(String organization) throws ServerAuthenticationException, org.apache.thrift.TException
{
send_startServerAuthentication(organization);
return recv_startServerAuthentication();
}
public void send_startServerAuthentication(String organization) throws org.apache.thrift.TException
{
startServerAuthentication_args args = new startServerAuthentication_args();
args.setOrganization(organization);
sendBase("startServerAuthentication", args);
}
public String recv_startServerAuthentication() throws ServerAuthenticationException, org.apache.thrift.TException
{
startServerAuthentication_result result = new startServerAuthentication_result();
receiveBase(result, "startServerAuthentication");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "startServerAuthentication failed: unknown result");
}
public ServerSessionData serverAuthenticate(String organization, ByteBuffer challengeResponse) throws ServerAuthenticationException, org.apache.thrift.TException
{
send_serverAuthenticate(organization, challengeResponse);
return recv_serverAuthenticate();
}
public void send_serverAuthenticate(String organization, ByteBuffer challengeResponse) throws org.apache.thrift.TException
{
serverAuthenticate_args args = new serverAuthenticate_args();
args.setOrganization(organization);
args.setChallengeResponse(challengeResponse);
sendBase("serverAuthenticate", args);
}
public ServerSessionData recv_serverAuthenticate() throws ServerAuthenticationException, org.apache.thrift.TException
{
serverAuthenticate_result result = new serverAuthenticate_result();
receiveBase(result, "serverAuthenticate");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "serverAuthenticate failed: unknown result");
}
public FtpCredentials submitImage(String serverSessionId, ImageData imageDescription) throws AuthorizationException, ImageDataException, org.apache.thrift.TException
{
send_submitImage(serverSessionId, imageDescription);
return recv_submitImage();
}
public void send_submitImage(String serverSessionId, ImageData imageDescription) throws org.apache.thrift.TException
{
submitImage_args args = new submitImage_args();
args.setServerSessionId(serverSessionId);
args.setImageDescription(imageDescription);
sendBase("submitImage", args);
}
public FtpCredentials recv_submitImage() throws AuthorizationException, ImageDataException, org.apache.thrift.TException
{
submitImage_result result = new submitImage_result();
receiveBase(result, "submitImage");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
if (result.failure2 != null) {
throw result.failure2;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submitImage failed: unknown result");
}
public boolean finshedUpload(String ftpUser, ImageData imageDescription) throws ImageDataException, org.apache.thrift.TException
{
send_finshedUpload(ftpUser, imageDescription);
return recv_finshedUpload();
}
public void send_finshedUpload(String ftpUser, ImageData imageDescription) throws org.apache.thrift.TException
{
finshedUpload_args args = new finshedUpload_args();
args.setFtpUser(ftpUser);
args.setImageDescription(imageDescription);
sendBase("finshedUpload", args);
}
public boolean recv_finshedUpload() throws ImageDataException, org.apache.thrift.TException
{
finshedUpload_result result = new finshedUpload_result();
receiveBase(result, "finshedUpload");
if (result.isSetSuccess()) {
return result.success;
}
if (result.failure != null) {
throw result.failure;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "finshedUpload 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 ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
ping_call method_call = new ping_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall {
public ping_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0));
ping_args args = new ping_args();
args.write(prot);
prot.writeMessageEnd();
}
public boolean getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_ping();
}
}
public void authenticate(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
authenticate_call method_call = new authenticate_call(username, password, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class authenticate_call extends org.apache.thrift.async.TAsyncMethodCall {
private String username;
private String password;
public authenticate_call(String username, String password, 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.username = username;
this.password = password;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("authenticate", org.apache.thrift.protocol.TMessageType.CALL, 0));
authenticate_args args = new authenticate_args();
args.setUsername(username);
args.setPassword(password);
args.write(prot);
prot.writeMessageEnd();
}
public SessionData getResult() throws AuthenticationException, 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_authenticate();
}
}
public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getUserFromToken_call method_call = new getUserFromToken_call(token, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getUserFromToken_call extends org.apache.thrift.async.TAsyncMethodCall {
private String token;
public getUserFromToken_call(String token, 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.token = token;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserFromToken", org.apache.thrift.protocol.TMessageType.CALL, 0));
getUserFromToken_args args = new getUserFromToken_args();
args.setToken(token);
args.write(prot);
prot.writeMessageEnd();
}
public UserInfo getResult() throws InvalidTokenException, 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_getUserFromToken();
}
}
public void startServerAuthentication(String organization, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
startServerAuthentication_call method_call = new startServerAuthentication_call(organization, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class startServerAuthentication_call extends org.apache.thrift.async.TAsyncMethodCall {
private String organization;
public startServerAuthentication_call(String organization, 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.organization = organization;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("startServerAuthentication", org.apache.thrift.protocol.TMessageType.CALL, 0));
startServerAuthentication_args args = new startServerAuthentication_args();
args.setOrganization(organization);
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws ServerAuthenticationException, 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_startServerAuthentication();
}
}
public void serverAuthenticate(String organization, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
serverAuthenticate_call method_call = new serverAuthenticate_call(organization, challengeResponse, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class serverAuthenticate_call extends org.apache.thrift.async.TAsyncMethodCall {
private String organization;
private ByteBuffer challengeResponse;
public serverAuthenticate_call(String organization, ByteBuffer challengeResponse, 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.organization = organization;
this.challengeResponse = challengeResponse;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("serverAuthenticate", org.apache.thrift.protocol.TMessageType.CALL, 0));
serverAuthenticate_args args = new serverAuthenticate_args();
args.setOrganization(organization);
args.setChallengeResponse(challengeResponse);
args.write(prot);
prot.writeMessageEnd();
}
public ServerSessionData getResult() throws ServerAuthenticationException, 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_serverAuthenticate();
}
}
public void submitImage(String serverSessionId, ImageData imageDescription, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
submitImage_call method_call = new submitImage_call(serverSessionId, imageDescription, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class submitImage_call extends org.apache.thrift.async.TAsyncMethodCall {
private String serverSessionId;
private ImageData imageDescription;
public submitImage_call(String serverSessionId, ImageData imageDescription, 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.serverSessionId = serverSessionId;
this.imageDescription = imageDescription;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("submitImage", org.apache.thrift.protocol.TMessageType.CALL, 0));
submitImage_args args = new submitImage_args();
args.setServerSessionId(serverSessionId);
args.setImageDescription(imageDescription);
args.write(prot);
prot.writeMessageEnd();
}
public FtpCredentials getResult() throws AuthorizationException, ImageDataException, 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_submitImage();
}
}
public void finshedUpload(String ftpUser, ImageData imageDescription, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
finshedUpload_call method_call = new finshedUpload_call(ftpUser, imageDescription, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class finshedUpload_call extends org.apache.thrift.async.TAsyncMethodCall {
private String ftpUser;
private ImageData imageDescription;
public finshedUpload_call(String ftpUser, ImageData imageDescription, 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.ftpUser = ftpUser;
this.imageDescription = imageDescription;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("finshedUpload", org.apache.thrift.protocol.TMessageType.CALL, 0));
finshedUpload_args args = new finshedUpload_args();
args.setFtpUser(ftpUser);
args.setImageDescription(imageDescription);
args.write(prot);
prot.writeMessageEnd();
}
public boolean getResult() throws ImageDataException, 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_finshedUpload();
}
}
}
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("ping", new ping());
processMap.put("authenticate", new authenticate());
processMap.put("getUserFromToken", new getUserFromToken());
processMap.put("startServerAuthentication", new startServerAuthentication());
processMap.put("serverAuthenticate", new serverAuthenticate());
processMap.put("submitImage", new submitImage());
processMap.put("finshedUpload", new finshedUpload());
return processMap;
}
public static class ping<I extends Iface> extends org.apache.thrift.ProcessFunction<I, ping_args> {
public ping() {
super("ping");
}
public ping_args getEmptyArgsInstance() {
return new ping_args();
}
protected boolean isOneway() {
return false;
}
public ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException {
ping_result result = new ping_result();
result.success = iface.ping();
result.setSuccessIsSet(true);
return result;
}
}
public static class authenticate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, authenticate_args> {
public authenticate() {
super("authenticate");
}
public authenticate_args getEmptyArgsInstance() {
return new authenticate_args();
}
protected boolean isOneway() {
return false;
}
public authenticate_result getResult(I iface, authenticate_args args) throws org.apache.thrift.TException {
authenticate_result result = new authenticate_result();
try {
result.success = iface.authenticate(args.username, args.password);
} catch (AuthenticationException failure) {
result.failure = failure;
}
return result;
}
}
public static class getUserFromToken<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getUserFromToken_args> {
public getUserFromToken() {
super("getUserFromToken");
}
public getUserFromToken_args getEmptyArgsInstance() {
return new getUserFromToken_args();
}
protected boolean isOneway() {
return false;
}
public getUserFromToken_result getResult(I iface, getUserFromToken_args args) throws org.apache.thrift.TException {
getUserFromToken_result result = new getUserFromToken_result();
try {
result.success = iface.getUserFromToken(args.token);
} catch (InvalidTokenException failure) {
result.failure = failure;
}
return result;
}
}
public static class startServerAuthentication<I extends Iface> extends org.apache.thrift.ProcessFunction<I, startServerAuthentication_args> {
public startServerAuthentication() {
super("startServerAuthentication");
}
public startServerAuthentication_args getEmptyArgsInstance() {
return new startServerAuthentication_args();
}
protected boolean isOneway() {
return false;
}
public startServerAuthentication_result getResult(I iface, startServerAuthentication_args args) throws org.apache.thrift.TException {
startServerAuthentication_result result = new startServerAuthentication_result();
try {
result.success = iface.startServerAuthentication(args.organization);
} catch (ServerAuthenticationException failure) {
result.failure = failure;
}
return result;
}
}
public static class serverAuthenticate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, serverAuthenticate_args> {
public serverAuthenticate() {
super("serverAuthenticate");
}
public serverAuthenticate_args getEmptyArgsInstance() {
return new serverAuthenticate_args();
}
protected boolean isOneway() {
return false;
}
public serverAuthenticate_result getResult(I iface, serverAuthenticate_args args) throws org.apache.thrift.TException {
serverAuthenticate_result result = new serverAuthenticate_result();
try {
result.success = iface.serverAuthenticate(args.organization, args.challengeResponse);
} catch (ServerAuthenticationException failure) {
result.failure = failure;
}
return result;
}
}
public static class submitImage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, submitImage_args> {
public submitImage() {
super("submitImage");
}
public submitImage_args getEmptyArgsInstance() {
return new submitImage_args();
}
protected boolean isOneway() {
return false;
}
public submitImage_result getResult(I iface, submitImage_args args) throws org.apache.thrift.TException {
submitImage_result result = new submitImage_result();
try {
result.success = iface.submitImage(args.serverSessionId, args.imageDescription);
} catch (AuthorizationException failure) {
result.failure = failure;
} catch (ImageDataException failure2) {
result.failure2 = failure2;
}
return result;
}
}
public static class finshedUpload<I extends Iface> extends org.apache.thrift.ProcessFunction<I, finshedUpload_args> {
public finshedUpload() {
super("finshedUpload");
}
public finshedUpload_args getEmptyArgsInstance() {
return new finshedUpload_args();
}
protected boolean isOneway() {
return false;
}
public finshedUpload_result getResult(I iface, finshedUpload_args args) throws org.apache.thrift.TException {
finshedUpload_result result = new finshedUpload_result();
try {
result.success = iface.finshedUpload(args.ftpUser, args.imageDescription);
result.setSuccessIsSet(true);
} catch (ImageDataException failure) {
result.failure = failure;
}
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("ping", new ping());
processMap.put("authenticate", new authenticate());
processMap.put("getUserFromToken", new getUserFromToken());
processMap.put("startServerAuthentication", new startServerAuthentication());
processMap.put("serverAuthenticate", new serverAuthenticate());
processMap.put("submitImage", new submitImage());
processMap.put("finshedUpload", new finshedUpload());
return processMap;
}
public static class ping<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, ping_args, Boolean> {
public ping() {
super("ping");
}
public ping_args getEmptyArgsInstance() {
return new ping_args();
}
public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Boolean>() {
public void onComplete(Boolean o) {
ping_result result = new ping_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
ping_result result = new ping_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, ping_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
iface.ping(resultHandler);
}
}
public static class authenticate<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, authenticate_args, SessionData> {
public authenticate() {
super("authenticate");
}
public authenticate_args getEmptyArgsInstance() {
return new authenticate_args();
}
public AsyncMethodCallback<SessionData> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<SessionData>() {
public void onComplete(SessionData o) {
authenticate_result result = new authenticate_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;
authenticate_result result = new authenticate_result();
if (e instanceof AuthenticationException) {
result.failure = (AuthenticationException) e;
result.setFailureIsSet(true);
msg = result;
}
else
{
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, authenticate_args args, org.apache.thrift.async.AsyncMethodCallback<SessionData> resultHandler) throws TException {
iface.authenticate(args.username, args.password,resultHandler);
}
}
public static class getUserFromToken<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getUserFromToken_args, UserInfo> {
public getUserFromToken() {
super("getUserFromToken");
}
public getUserFromToken_args getEmptyArgsInstance() {
return new getUserFromToken_args();
}
public AsyncMethodCallback<UserInfo> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<UserInfo>() {
public void onComplete(UserInfo o) {
getUserFromToken_result result = new getUserFromToken_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;
getUserFromToken_result result = new getUserFromToken_result();
if (e instanceof InvalidTokenException) {
result.failure = (InvalidTokenException) e;
result.setFailureIsSet(true);
msg = result;
}
else
{
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, getUserFromToken_args args, org.apache.thrift.async.AsyncMethodCallback<UserInfo> resultHandler) throws TException {
iface.getUserFromToken(args.token,resultHandler);
}
}
public static class startServerAuthentication<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, startServerAuthentication_args, String> {
public startServerAuthentication() {
super("startServerAuthentication");
}
public startServerAuthentication_args getEmptyArgsInstance() {
return new startServerAuthentication_args();
}
public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<String>() {
public void onComplete(String o) {
startServerAuthentication_result result = new startServerAuthentication_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;
startServerAuthentication_result result = new startServerAuthentication_result();
if (e instanceof ServerAuthenticationException) {
result.failure = (ServerAuthenticationException) e;
result.setFailureIsSet(true);
msg = result;
}
else
{
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, startServerAuthentication_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
iface.startServerAuthentication(args.organization,resultHandler);
}
}
public static class serverAuthenticate<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, serverAuthenticate_args, ServerSessionData> {
public serverAuthenticate() {
super("serverAuthenticate");
}
public serverAuthenticate_args getEmptyArgsInstance() {
return new serverAuthenticate_args();
}
public AsyncMethodCallback<ServerSessionData> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<ServerSessionData>() {
public void onComplete(ServerSessionData o) {
serverAuthenticate_result result = new serverAuthenticate_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;
serverAuthenticate_result result = new serverAuthenticate_result();
if (e instanceof ServerAuthenticationException) {
result.failure = (ServerAuthenticationException) e;
result.setFailureIsSet(true);
msg = result;
}
else
{
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, serverAuthenticate_args args, org.apache.thrift.async.AsyncMethodCallback<ServerSessionData> resultHandler) throws TException {
iface.serverAuthenticate(args.organization, args.challengeResponse,resultHandler);
}
}
public static class submitImage<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, submitImage_args, FtpCredentials> {
public submitImage() {
super("submitImage");
}
public submitImage_args getEmptyArgsInstance() {
return new submitImage_args();
}
public AsyncMethodCallback<FtpCredentials> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<FtpCredentials>() {
public void onComplete(FtpCredentials o) {
submitImage_result result = new submitImage_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;
submitImage_result result = new submitImage_result();
if (e instanceof AuthorizationException) {
result.failure = (AuthorizationException) e;
result.setFailureIsSet(true);
msg = result;
}
else if (e instanceof ImageDataException) {
result.failure2 = (ImageDataException) e;
result.setFailure2IsSet(true);
msg = result;
}
else
{
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, submitImage_args args, org.apache.thrift.async.AsyncMethodCallback<FtpCredentials> resultHandler) throws TException {
iface.submitImage(args.serverSessionId, args.imageDescription,resultHandler);
}
}
public static class finshedUpload<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, finshedUpload_args, Boolean> {
public finshedUpload() {
super("finshedUpload");
}
public finshedUpload_args getEmptyArgsInstance() {
return new finshedUpload_args();
}
public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Boolean>() {
public void onComplete(Boolean o) {
finshedUpload_result result = new finshedUpload_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
finshedUpload_result result = new finshedUpload_result();
if (e instanceof ImageDataException) {
result.failure = (ImageDataException) e;
result.setFailureIsSet(true);
msg = result;
}
else
{
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, finshedUpload_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException {
iface.finshedUpload(args.ftpUser, args.imageDescription,resultHandler);
}
}
}
public static class ping_args implements org.apache.thrift.TBase<ping_args, ping_args._Fields>, java.io.Serializable, Cloneable, Comparable<ping_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ping_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new ping_argsTupleSchemeFactory());
}
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap);
}
public ping_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ping_args(ping_args other) {
}
public ping_args deepCopy() {
return new ping_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ping_args)
return this.equals((ping_args)that);
return false;
}
public boolean equals(ping_args that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(ping_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ping_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ping_argsStandardSchemeFactory implements SchemeFactory {
public ping_argsStandardScheme getScheme() {
return new ping_argsStandardScheme();
}
}
private static class ping_argsStandardScheme extends StandardScheme<ping_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ping_argsTupleSchemeFactory implements SchemeFactory {
public ping_argsTupleScheme getScheme() {
return new ping_argsTupleScheme();
}
}
private static class ping_argsTupleScheme extends TupleScheme<ping_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
public static class ping_result implements org.apache.thrift.TBase<ping_result, ping_result._Fields>, java.io.Serializable, Cloneable, Comparable<ping_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ping_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new ping_resultTupleSchemeFactory());
}
public boolean success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
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
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap);
}
public ping_result() {
}
public ping_result(
boolean success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ping_result(ping_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public ping_result deepCopy() {
return new ping_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
}
public boolean isSuccess() {
return this.success;
}
public ping_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Boolean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return Boolean.valueOf(isSuccess());
}
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 ping_result)
return this.equals((ping_result)that);
return false;
}
public boolean equals(ping_result that) {
if (that == null)
return false;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(ping_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("ping_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ping_resultStandardSchemeFactory implements SchemeFactory {
public ping_resultStandardScheme getScheme() {
return new ping_resultStandardScheme();
}
}
private static class ping_resultStandardScheme extends StandardScheme<ping_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
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.BOOL) {
struct.success = iprot.readBool();
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, ping_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ping_resultTupleSchemeFactory implements SchemeFactory {
public ping_resultTupleScheme getScheme() {
return new ping_resultTupleScheme();
}
}
private static class ping_resultTupleScheme extends TupleScheme<ping_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
}
}
}
public static class authenticate_args implements org.apache.thrift.TBase<authenticate_args, authenticate_args._Fields>, java.io.Serializable, Cloneable, Comparable<authenticate_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("authenticate_args");
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", 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 authenticate_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new authenticate_argsTupleSchemeFactory());
}
public String username; // required
public String password; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
USERNAME((short)1, "username"),
PASSWORD((short)2, "password");
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: // USERNAME
return USERNAME;
case 2: // PASSWORD
return PASSWORD;
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.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", 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(authenticate_args.class, metaDataMap);
}
public authenticate_args() {
}
public authenticate_args(
String username,
String password)
{
this();
this.username = username;
this.password = password;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public authenticate_args(authenticate_args other) {
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetPassword()) {
this.password = other.password;
}
}
public authenticate_args deepCopy() {
return new authenticate_args(this);
}
@Override
public void clear() {
this.username = null;
this.password = null;
}
public String getUsername() {
return this.username;
}
public authenticate_args setUsername(String username) {
this.username = username;
return this;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public String getPassword() {
return this.password;
}
public authenticate_args setPassword(String password) {
this.password = password;
return this;
}
public void unsetPassword() {
this.password = null;
}
/** Returns true if field password is set (has been assigned a value) and false otherwise */
public boolean isSetPassword() {
return this.password != null;
}
public void setPasswordIsSet(boolean value) {
if (!value) {
this.password = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((String)value);
}
break;
case PASSWORD:
if (value == null) {
unsetPassword();
} else {
setPassword((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USERNAME:
return getUsername();
case PASSWORD:
return getPassword();
}
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 USERNAME:
return isSetUsername();
case PASSWORD:
return isSetPassword();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof authenticate_args)
return this.equals((authenticate_args)that);
return false;
}
public boolean equals(authenticate_args that) {
if (that == null)
return false;
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_password = true && this.isSetPassword();
boolean that_present_password = true && that.isSetPassword();
if (this_present_password || that_present_password) {
if (!(this_present_password && that_present_password))
return false;
if (!this.password.equals(that.password))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(authenticate_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPassword()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
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("authenticate_args(");
boolean first = true;
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
if (!first) sb.append(", ");
sb.append("password:");
if (this.password == null) {
sb.append("null");
} else {
sb.append(this.password);
}
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 authenticate_argsStandardSchemeFactory implements SchemeFactory {
public authenticate_argsStandardScheme getScheme() {
return new authenticate_argsStandardScheme();
}
}
private static class authenticate_argsStandardScheme extends StandardScheme<authenticate_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, authenticate_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: // USERNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // PASSWORD
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.password = iprot.readString();
struct.setPasswordIsSet(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, authenticate_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.username != null) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(struct.username);
oprot.writeFieldEnd();
}
if (struct.password != null) {
oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
oprot.writeString(struct.password);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class authenticate_argsTupleSchemeFactory implements SchemeFactory {
public authenticate_argsTupleScheme getScheme() {
return new authenticate_argsTupleScheme();
}
}
private static class authenticate_argsTupleScheme extends TupleScheme<authenticate_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, authenticate_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetUsername()) {
optionals.set(0);
}
if (struct.isSetPassword()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetUsername()) {
oprot.writeString(struct.username);
}
if (struct.isSetPassword()) {
oprot.writeString(struct.password);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, authenticate_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
}
if (incoming.get(1)) {
struct.password = iprot.readString();
struct.setPasswordIsSet(true);
}
}
}
}
public static class authenticate_result implements org.apache.thrift.TBase<authenticate_result, authenticate_result._Fields>, java.io.Serializable, Cloneable, Comparable<authenticate_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("authenticate_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 authenticate_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new authenticate_resultTupleSchemeFactory());
}
public SessionData success; // required
public AuthenticationException failure; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure");
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;
case 1: // FAILURE
return FAILURE;
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, SessionData.class)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(authenticate_result.class, metaDataMap);
}
public authenticate_result() {
}
public authenticate_result(
SessionData success,
AuthenticationException failure)
{
this();
this.success = success;
this.failure = failure;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public authenticate_result(authenticate_result other) {
if (other.isSetSuccess()) {
this.success = new SessionData(other.success);
}
if (other.isSetFailure()) {
this.failure = new AuthenticationException(other.failure);
}
}
public authenticate_result deepCopy() {
return new authenticate_result(this);
}
@Override
public void clear() {
this.success = null;
this.failure = null;
}
public SessionData getSuccess() {
return this.success;
}
public authenticate_result setSuccess(SessionData 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 AuthenticationException getFailure() {
return this.failure;
}
public authenticate_result setFailure(AuthenticationException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((SessionData)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((AuthenticationException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case FAILURE:
return getFailure();
}
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();
case FAILURE:
return isSetFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof authenticate_result)
return this.equals((authenticate_result)that);
return false;
}
public boolean equals(authenticate_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;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(authenticate_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
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("authenticate_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
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 authenticate_resultStandardSchemeFactory implements SchemeFactory {
public authenticate_resultStandardScheme getScheme() {
return new authenticate_resultStandardScheme();
}
}
private static class authenticate_resultStandardScheme extends StandardScheme<authenticate_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, authenticate_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 SessionData();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new AuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(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, authenticate_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class authenticate_resultTupleSchemeFactory implements SchemeFactory {
public authenticate_resultTupleScheme getScheme() {
return new authenticate_resultTupleScheme();
}
}
private static class authenticate_resultTupleScheme extends TupleScheme<authenticate_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, authenticate_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, authenticate_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new SessionData();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new AuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
}
}
}
public static class getUserFromToken_args implements org.apache.thrift.TBase<getUserFromToken_args, getUserFromToken_args._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_args");
private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getUserFromToken_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new getUserFromToken_argsTupleSchemeFactory());
}
public String token; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TOKEN((short)1, "token");
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: // TOKEN
return TOKEN;
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.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token")));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_args.class, metaDataMap);
}
public getUserFromToken_args() {
}
public getUserFromToken_args(
String token)
{
this();
this.token = token;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getUserFromToken_args(getUserFromToken_args other) {
if (other.isSetToken()) {
this.token = other.token;
}
}
public getUserFromToken_args deepCopy() {
return new getUserFromToken_args(this);
}
@Override
public void clear() {
this.token = null;
}
public String getToken() {
return this.token;
}
public getUserFromToken_args setToken(String token) {
this.token = token;
return this;
}
public void unsetToken() {
this.token = null;
}
/** Returns true if field token is set (has been assigned a value) and false otherwise */
public boolean isSetToken() {
return this.token != null;
}
public void setTokenIsSet(boolean value) {
if (!value) {
this.token = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case TOKEN:
if (value == null) {
unsetToken();
} else {
setToken((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case TOKEN:
return getToken();
}
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 TOKEN:
return isSetToken();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getUserFromToken_args)
return this.equals((getUserFromToken_args)that);
return false;
}
public boolean equals(getUserFromToken_args that) {
if (that == null)
return false;
boolean this_present_token = true && this.isSetToken();
boolean that_present_token = true && that.isSetToken();
if (this_present_token || that_present_token) {
if (!(this_present_token && that_present_token))
return false;
if (!this.token.equals(that.token))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(getUserFromToken_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetToken()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
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("getUserFromToken_args(");
boolean first = true;
sb.append("token:");
if (this.token == null) {
sb.append("null");
} else {
sb.append(this.token);
}
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 getUserFromToken_argsStandardSchemeFactory implements SchemeFactory {
public getUserFromToken_argsStandardScheme getScheme() {
return new getUserFromToken_argsStandardScheme();
}
}
private static class getUserFromToken_argsStandardScheme extends StandardScheme<getUserFromToken_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_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: // TOKEN
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.token = iprot.readString();
struct.setTokenIsSet(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, getUserFromToken_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.token != null) {
oprot.writeFieldBegin(TOKEN_FIELD_DESC);
oprot.writeString(struct.token);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getUserFromToken_argsTupleSchemeFactory implements SchemeFactory {
public getUserFromToken_argsTupleScheme getScheme() {
return new getUserFromToken_argsTupleScheme();
}
}
private static class getUserFromToken_argsTupleScheme extends TupleScheme<getUserFromToken_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetToken()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetToken()) {
oprot.writeString(struct.token);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.token = iprot.readString();
struct.setTokenIsSet(true);
}
}
}
}
public static class getUserFromToken_result implements org.apache.thrift.TBase<getUserFromToken_result, getUserFromToken_result._Fields>, java.io.Serializable, Cloneable, Comparable<getUserFromToken_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getUserFromToken_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 getUserFromToken_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new getUserFromToken_resultTupleSchemeFactory());
}
public UserInfo success; // required
public InvalidTokenException failure; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure");
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;
case 1: // FAILURE
return FAILURE;
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, UserInfo.class)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getUserFromToken_result.class, metaDataMap);
}
public getUserFromToken_result() {
}
public getUserFromToken_result(
UserInfo success,
InvalidTokenException failure)
{
this();
this.success = success;
this.failure = failure;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getUserFromToken_result(getUserFromToken_result other) {
if (other.isSetSuccess()) {
this.success = new UserInfo(other.success);
}
if (other.isSetFailure()) {
this.failure = new InvalidTokenException(other.failure);
}
}
public getUserFromToken_result deepCopy() {
return new getUserFromToken_result(this);
}
@Override
public void clear() {
this.success = null;
this.failure = null;
}
public UserInfo getSuccess() {
return this.success;
}
public getUserFromToken_result setSuccess(UserInfo 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 InvalidTokenException getFailure() {
return this.failure;
}
public getUserFromToken_result setFailure(InvalidTokenException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((UserInfo)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((InvalidTokenException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case FAILURE:
return getFailure();
}
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();
case FAILURE:
return isSetFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getUserFromToken_result)
return this.equals((getUserFromToken_result)that);
return false;
}
public boolean equals(getUserFromToken_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;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(getUserFromToken_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
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("getUserFromToken_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
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 getUserFromToken_resultStandardSchemeFactory implements SchemeFactory {
public getUserFromToken_resultStandardScheme getScheme() {
return new getUserFromToken_resultStandardScheme();
}
}
private static class getUserFromToken_resultStandardScheme extends StandardScheme<getUserFromToken_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getUserFromToken_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 UserInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new InvalidTokenException();
struct.failure.read(iprot);
struct.setFailureIsSet(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, getUserFromToken_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getUserFromToken_resultTupleSchemeFactory implements SchemeFactory {
public getUserFromToken_resultTupleScheme getScheme() {
return new getUserFromToken_resultTupleScheme();
}
}
private static class getUserFromToken_resultTupleScheme extends TupleScheme<getUserFromToken_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getUserFromToken_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new UserInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new InvalidTokenException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
}
}
}
public static class startServerAuthentication_args implements org.apache.thrift.TBase<startServerAuthentication_args, startServerAuthentication_args._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_args");
private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new startServerAuthentication_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new startServerAuthentication_argsTupleSchemeFactory());
}
public String organization; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ORGANIZATION((short)1, "organization");
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: // ORGANIZATION
return ORGANIZATION;
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.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", 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(startServerAuthentication_args.class, metaDataMap);
}
public startServerAuthentication_args() {
}
public startServerAuthentication_args(
String organization)
{
this();
this.organization = organization;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public startServerAuthentication_args(startServerAuthentication_args other) {
if (other.isSetOrganization()) {
this.organization = other.organization;
}
}
public startServerAuthentication_args deepCopy() {
return new startServerAuthentication_args(this);
}
@Override
public void clear() {
this.organization = null;
}
public String getOrganization() {
return this.organization;
}
public startServerAuthentication_args setOrganization(String organization) {
this.organization = organization;
return this;
}
public void unsetOrganization() {
this.organization = null;
}
/** Returns true if field organization is set (has been assigned a value) and false otherwise */
public boolean isSetOrganization() {
return this.organization != null;
}
public void setOrganizationIsSet(boolean value) {
if (!value) {
this.organization = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ORGANIZATION:
if (value == null) {
unsetOrganization();
} else {
setOrganization((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ORGANIZATION:
return getOrganization();
}
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 ORGANIZATION:
return isSetOrganization();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof startServerAuthentication_args)
return this.equals((startServerAuthentication_args)that);
return false;
}
public boolean equals(startServerAuthentication_args that) {
if (that == null)
return false;
boolean this_present_organization = true && this.isSetOrganization();
boolean that_present_organization = true && that.isSetOrganization();
if (this_present_organization || that_present_organization) {
if (!(this_present_organization && that_present_organization))
return false;
if (!this.organization.equals(that.organization))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(startServerAuthentication_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOrganization()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization);
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("startServerAuthentication_args(");
boolean first = true;
sb.append("organization:");
if (this.organization == null) {
sb.append("null");
} else {
sb.append(this.organization);
}
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 startServerAuthentication_argsStandardSchemeFactory implements SchemeFactory {
public startServerAuthentication_argsStandardScheme getScheme() {
return new startServerAuthentication_argsStandardScheme();
}
}
private static class startServerAuthentication_argsStandardScheme extends StandardScheme<startServerAuthentication_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_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: // ORGANIZATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.organization = iprot.readString();
struct.setOrganizationIsSet(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, startServerAuthentication_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.organization != null) {
oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC);
oprot.writeString(struct.organization);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class startServerAuthentication_argsTupleSchemeFactory implements SchemeFactory {
public startServerAuthentication_argsTupleScheme getScheme() {
return new startServerAuthentication_argsTupleScheme();
}
}
private static class startServerAuthentication_argsTupleScheme extends TupleScheme<startServerAuthentication_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetOrganization()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetOrganization()) {
oprot.writeString(struct.organization);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.organization = iprot.readString();
struct.setOrganizationIsSet(true);
}
}
}
}
public static class startServerAuthentication_result implements org.apache.thrift.TBase<startServerAuthentication_result, startServerAuthentication_result._Fields>, java.io.Serializable, Cloneable, Comparable<startServerAuthentication_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("startServerAuthentication_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 startServerAuthentication_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new startServerAuthentication_resultTupleSchemeFactory());
}
public String success; // required
public ServerAuthenticationException failure; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure");
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;
case 1: // FAILURE
return FAILURE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startServerAuthentication_result.class, metaDataMap);
}
public startServerAuthentication_result() {
}
public startServerAuthentication_result(
String success,
ServerAuthenticationException failure)
{
this();
this.success = success;
this.failure = failure;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public startServerAuthentication_result(startServerAuthentication_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
if (other.isSetFailure()) {
this.failure = new ServerAuthenticationException(other.failure);
}
}
public startServerAuthentication_result deepCopy() {
return new startServerAuthentication_result(this);
}
@Override
public void clear() {
this.success = null;
this.failure = null;
}
public String getSuccess() {
return this.success;
}
public startServerAuthentication_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public ServerAuthenticationException getFailure() {
return this.failure;
}
public startServerAuthentication_result setFailure(ServerAuthenticationException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((ServerAuthenticationException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case FAILURE:
return getFailure();
}
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();
case FAILURE:
return isSetFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof startServerAuthentication_result)
return this.equals((startServerAuthentication_result)that);
return false;
}
public boolean equals(startServerAuthentication_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;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(startServerAuthentication_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
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("startServerAuthentication_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
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 startServerAuthentication_resultStandardSchemeFactory implements SchemeFactory {
public startServerAuthentication_resultStandardScheme getScheme() {
return new startServerAuthentication_resultStandardScheme();
}
}
private static class startServerAuthentication_resultStandardScheme extends StandardScheme<startServerAuthentication_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, startServerAuthentication_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new ServerAuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(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, startServerAuthentication_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class startServerAuthentication_resultTupleSchemeFactory implements SchemeFactory {
public startServerAuthentication_resultTupleScheme getScheme() {
return new startServerAuthentication_resultTupleScheme();
}
}
private static class startServerAuthentication_resultTupleScheme extends TupleScheme<startServerAuthentication_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, startServerAuthentication_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new ServerAuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
}
}
}
public static class serverAuthenticate_args implements org.apache.thrift.TBase<serverAuthenticate_args, serverAuthenticate_args._Fields>, java.io.Serializable, Cloneable, Comparable<serverAuthenticate_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("serverAuthenticate_args");
private static final org.apache.thrift.protocol.TField ORGANIZATION_FIELD_DESC = new org.apache.thrift.protocol.TField("organization", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField CHALLENGE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("challengeResponse", 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 serverAuthenticate_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new serverAuthenticate_argsTupleSchemeFactory());
}
public String organization; // required
public ByteBuffer challengeResponse; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
ORGANIZATION((short)1, "organization"),
CHALLENGE_RESPONSE((short)2, "challengeResponse");
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: // ORGANIZATION
return ORGANIZATION;
case 2: // CHALLENGE_RESPONSE
return CHALLENGE_RESPONSE;
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.ORGANIZATION, new org.apache.thrift.meta_data.FieldMetaData("organization", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CHALLENGE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("challengeResponse", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(serverAuthenticate_args.class, metaDataMap);
}
public serverAuthenticate_args() {
}
public serverAuthenticate_args(
String organization,
ByteBuffer challengeResponse)
{
this();
this.organization = organization;
this.challengeResponse = challengeResponse;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public serverAuthenticate_args(serverAuthenticate_args other) {
if (other.isSetOrganization()) {
this.organization = other.organization;
}
if (other.isSetChallengeResponse()) {
this.challengeResponse = org.apache.thrift.TBaseHelper.copyBinary(other.challengeResponse);
;
}
}
public serverAuthenticate_args deepCopy() {
return new serverAuthenticate_args(this);
}
@Override
public void clear() {
this.organization = null;
this.challengeResponse = null;
}
public String getOrganization() {
return this.organization;
}
public serverAuthenticate_args setOrganization(String organization) {
this.organization = organization;
return this;
}
public void unsetOrganization() {
this.organization = null;
}
/** Returns true if field organization is set (has been assigned a value) and false otherwise */
public boolean isSetOrganization() {
return this.organization != null;
}
public void setOrganizationIsSet(boolean value) {
if (!value) {
this.organization = null;
}
}
public byte[] getChallengeResponse() {
setChallengeResponse(org.apache.thrift.TBaseHelper.rightSize(challengeResponse));
return challengeResponse == null ? null : challengeResponse.array();
}
public ByteBuffer bufferForChallengeResponse() {
return challengeResponse;
}
public serverAuthenticate_args setChallengeResponse(byte[] challengeResponse) {
setChallengeResponse(challengeResponse == null ? (ByteBuffer)null : ByteBuffer.wrap(challengeResponse));
return this;
}
public serverAuthenticate_args setChallengeResponse(ByteBuffer challengeResponse) {
this.challengeResponse = challengeResponse;
return this;
}
public void unsetChallengeResponse() {
this.challengeResponse = null;
}
/** Returns true if field challengeResponse is set (has been assigned a value) and false otherwise */
public boolean isSetChallengeResponse() {
return this.challengeResponse != null;
}
public void setChallengeResponseIsSet(boolean value) {
if (!value) {
this.challengeResponse = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case ORGANIZATION:
if (value == null) {
unsetOrganization();
} else {
setOrganization((String)value);
}
break;
case CHALLENGE_RESPONSE:
if (value == null) {
unsetChallengeResponse();
} else {
setChallengeResponse((ByteBuffer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case ORGANIZATION:
return getOrganization();
case CHALLENGE_RESPONSE:
return getChallengeResponse();
}
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 ORGANIZATION:
return isSetOrganization();
case CHALLENGE_RESPONSE:
return isSetChallengeResponse();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof serverAuthenticate_args)
return this.equals((serverAuthenticate_args)that);
return false;
}
public boolean equals(serverAuthenticate_args that) {
if (that == null)
return false;
boolean this_present_organization = true && this.isSetOrganization();
boolean that_present_organization = true && that.isSetOrganization();
if (this_present_organization || that_present_organization) {
if (!(this_present_organization && that_present_organization))
return false;
if (!this.organization.equals(that.organization))
return false;
}
boolean this_present_challengeResponse = true && this.isSetChallengeResponse();
boolean that_present_challengeResponse = true && that.isSetChallengeResponse();
if (this_present_challengeResponse || that_present_challengeResponse) {
if (!(this_present_challengeResponse && that_present_challengeResponse))
return false;
if (!this.challengeResponse.equals(that.challengeResponse))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(serverAuthenticate_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetOrganization()).compareTo(other.isSetOrganization());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetOrganization()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.organization, other.organization);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetChallengeResponse()).compareTo(other.isSetChallengeResponse());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetChallengeResponse()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.challengeResponse, other.challengeResponse);
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("serverAuthenticate_args(");
boolean first = true;
sb.append("organization:");
if (this.organization == null) {
sb.append("null");
} else {
sb.append(this.organization);
}
first = false;
if (!first) sb.append(", ");
sb.append("challengeResponse:");
if (this.challengeResponse == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.challengeResponse, sb);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class serverAuthenticate_argsStandardSchemeFactory implements SchemeFactory {
public serverAuthenticate_argsStandardScheme getScheme() {
return new serverAuthenticate_argsStandardScheme();
}
}
private static class serverAuthenticate_argsStandardScheme extends StandardScheme<serverAuthenticate_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, serverAuthenticate_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: // ORGANIZATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.organization = iprot.readString();
struct.setOrganizationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CHALLENGE_RESPONSE
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.challengeResponse = iprot.readBinary();
struct.setChallengeResponseIsSet(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, serverAuthenticate_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.organization != null) {
oprot.writeFieldBegin(ORGANIZATION_FIELD_DESC);
oprot.writeString(struct.organization);
oprot.writeFieldEnd();
}
if (struct.challengeResponse != null) {
oprot.writeFieldBegin(CHALLENGE_RESPONSE_FIELD_DESC);
oprot.writeBinary(struct.challengeResponse);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class serverAuthenticate_argsTupleSchemeFactory implements SchemeFactory {
public serverAuthenticate_argsTupleScheme getScheme() {
return new serverAuthenticate_argsTupleScheme();
}
}
private static class serverAuthenticate_argsTupleScheme extends TupleScheme<serverAuthenticate_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, serverAuthenticate_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetOrganization()) {
optionals.set(0);
}
if (struct.isSetChallengeResponse()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetOrganization()) {
oprot.writeString(struct.organization);
}
if (struct.isSetChallengeResponse()) {
oprot.writeBinary(struct.challengeResponse);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, serverAuthenticate_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.organization = iprot.readString();
struct.setOrganizationIsSet(true);
}
if (incoming.get(1)) {
struct.challengeResponse = iprot.readBinary();
struct.setChallengeResponseIsSet(true);
}
}
}
}
public static class serverAuthenticate_result implements org.apache.thrift.TBase<serverAuthenticate_result, serverAuthenticate_result._Fields>, java.io.Serializable, Cloneable, Comparable<serverAuthenticate_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("serverAuthenticate_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 serverAuthenticate_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new serverAuthenticate_resultTupleSchemeFactory());
}
public ServerSessionData success; // required
public ServerAuthenticationException failure; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure");
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;
case 1: // FAILURE
return FAILURE;
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, ServerSessionData.class)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(serverAuthenticate_result.class, metaDataMap);
}
public serverAuthenticate_result() {
}
public serverAuthenticate_result(
ServerSessionData success,
ServerAuthenticationException failure)
{
this();
this.success = success;
this.failure = failure;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public serverAuthenticate_result(serverAuthenticate_result other) {
if (other.isSetSuccess()) {
this.success = new ServerSessionData(other.success);
}
if (other.isSetFailure()) {
this.failure = new ServerAuthenticationException(other.failure);
}
}
public serverAuthenticate_result deepCopy() {
return new serverAuthenticate_result(this);
}
@Override
public void clear() {
this.success = null;
this.failure = null;
}
public ServerSessionData getSuccess() {
return this.success;
}
public serverAuthenticate_result setSuccess(ServerSessionData 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 ServerAuthenticationException getFailure() {
return this.failure;
}
public serverAuthenticate_result setFailure(ServerAuthenticationException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ServerSessionData)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((ServerAuthenticationException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case FAILURE:
return getFailure();
}
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();
case FAILURE:
return isSetFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof serverAuthenticate_result)
return this.equals((serverAuthenticate_result)that);
return false;
}
public boolean equals(serverAuthenticate_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;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(serverAuthenticate_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
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("serverAuthenticate_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
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 serverAuthenticate_resultStandardSchemeFactory implements SchemeFactory {
public serverAuthenticate_resultStandardScheme getScheme() {
return new serverAuthenticate_resultStandardScheme();
}
}
private static class serverAuthenticate_resultStandardScheme extends StandardScheme<serverAuthenticate_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, serverAuthenticate_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 ServerSessionData();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new ServerAuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(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, serverAuthenticate_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class serverAuthenticate_resultTupleSchemeFactory implements SchemeFactory {
public serverAuthenticate_resultTupleScheme getScheme() {
return new serverAuthenticate_resultTupleScheme();
}
}
private static class serverAuthenticate_resultTupleScheme extends TupleScheme<serverAuthenticate_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, serverAuthenticate_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, serverAuthenticate_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new ServerSessionData();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new ServerAuthenticationException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
}
}
}
public static class submitImage_args implements org.apache.thrift.TBase<submitImage_args, submitImage_args._Fields>, java.io.Serializable, Cloneable, Comparable<submitImage_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitImage_args");
private static final org.apache.thrift.protocol.TField SERVER_SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverSessionId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField IMAGE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageDescription", 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 submitImage_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new submitImage_argsTupleSchemeFactory());
}
public String serverSessionId; // required
public ImageData imageDescription; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SERVER_SESSION_ID((short)1, "serverSessionId"),
IMAGE_DESCRIPTION((short)2, "imageDescription");
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: // SERVER_SESSION_ID
return SERVER_SESSION_ID;
case 2: // IMAGE_DESCRIPTION
return IMAGE_DESCRIPTION;
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.SERVER_SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("serverSessionId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IMAGE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("imageDescription", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImageData.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitImage_args.class, metaDataMap);
}
public submitImage_args() {
}
public submitImage_args(
String serverSessionId,
ImageData imageDescription)
{
this();
this.serverSessionId = serverSessionId;
this.imageDescription = imageDescription;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public submitImage_args(submitImage_args other) {
if (other.isSetServerSessionId()) {
this.serverSessionId = other.serverSessionId;
}
if (other.isSetImageDescription()) {
this.imageDescription = new ImageData(other.imageDescription);
}
}
public submitImage_args deepCopy() {
return new submitImage_args(this);
}
@Override
public void clear() {
this.serverSessionId = null;
this.imageDescription = null;
}
public String getServerSessionId() {
return this.serverSessionId;
}
public submitImage_args setServerSessionId(String serverSessionId) {
this.serverSessionId = serverSessionId;
return this;
}
public void unsetServerSessionId() {
this.serverSessionId = null;
}
/** Returns true if field serverSessionId is set (has been assigned a value) and false otherwise */
public boolean isSetServerSessionId() {
return this.serverSessionId != null;
}
public void setServerSessionIdIsSet(boolean value) {
if (!value) {
this.serverSessionId = null;
}
}
public ImageData getImageDescription() {
return this.imageDescription;
}
public submitImage_args setImageDescription(ImageData imageDescription) {
this.imageDescription = imageDescription;
return this;
}
public void unsetImageDescription() {
this.imageDescription = null;
}
/** Returns true if field imageDescription is set (has been assigned a value) and false otherwise */
public boolean isSetImageDescription() {
return this.imageDescription != null;
}
public void setImageDescriptionIsSet(boolean value) {
if (!value) {
this.imageDescription = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SERVER_SESSION_ID:
if (value == null) {
unsetServerSessionId();
} else {
setServerSessionId((String)value);
}
break;
case IMAGE_DESCRIPTION:
if (value == null) {
unsetImageDescription();
} else {
setImageDescription((ImageData)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SERVER_SESSION_ID:
return getServerSessionId();
case IMAGE_DESCRIPTION:
return getImageDescription();
}
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 SERVER_SESSION_ID:
return isSetServerSessionId();
case IMAGE_DESCRIPTION:
return isSetImageDescription();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof submitImage_args)
return this.equals((submitImage_args)that);
return false;
}
public boolean equals(submitImage_args that) {
if (that == null)
return false;
boolean this_present_serverSessionId = true && this.isSetServerSessionId();
boolean that_present_serverSessionId = true && that.isSetServerSessionId();
if (this_present_serverSessionId || that_present_serverSessionId) {
if (!(this_present_serverSessionId && that_present_serverSessionId))
return false;
if (!this.serverSessionId.equals(that.serverSessionId))
return false;
}
boolean this_present_imageDescription = true && this.isSetImageDescription();
boolean that_present_imageDescription = true && that.isSetImageDescription();
if (this_present_imageDescription || that_present_imageDescription) {
if (!(this_present_imageDescription && that_present_imageDescription))
return false;
if (!this.imageDescription.equals(that.imageDescription))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(submitImage_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetServerSessionId()).compareTo(other.isSetServerSessionId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServerSessionId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverSessionId, other.serverSessionId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetImageDescription()).compareTo(other.isSetImageDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetImageDescription()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageDescription, other.imageDescription);
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("submitImage_args(");
boolean first = true;
sb.append("serverSessionId:");
if (this.serverSessionId == null) {
sb.append("null");
} else {
sb.append(this.serverSessionId);
}
first = false;
if (!first) sb.append(", ");
sb.append("imageDescription:");
if (this.imageDescription == null) {
sb.append("null");
} else {
sb.append(this.imageDescription);
}
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 (imageDescription != null) {
imageDescription.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 submitImage_argsStandardSchemeFactory implements SchemeFactory {
public submitImage_argsStandardScheme getScheme() {
return new submitImage_argsStandardScheme();
}
}
private static class submitImage_argsStandardScheme extends StandardScheme<submitImage_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, submitImage_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: // SERVER_SESSION_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.serverSessionId = iprot.readString();
struct.setServerSessionIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // IMAGE_DESCRIPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.imageDescription = new ImageData();
struct.imageDescription.read(iprot);
struct.setImageDescriptionIsSet(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, submitImage_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.serverSessionId != null) {
oprot.writeFieldBegin(SERVER_SESSION_ID_FIELD_DESC);
oprot.writeString(struct.serverSessionId);
oprot.writeFieldEnd();
}
if (struct.imageDescription != null) {
oprot.writeFieldBegin(IMAGE_DESCRIPTION_FIELD_DESC);
struct.imageDescription.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class submitImage_argsTupleSchemeFactory implements SchemeFactory {
public submitImage_argsTupleScheme getScheme() {
return new submitImage_argsTupleScheme();
}
}
private static class submitImage_argsTupleScheme extends TupleScheme<submitImage_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, submitImage_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetServerSessionId()) {
optionals.set(0);
}
if (struct.isSetImageDescription()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetServerSessionId()) {
oprot.writeString(struct.serverSessionId);
}
if (struct.isSetImageDescription()) {
struct.imageDescription.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, submitImage_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.serverSessionId = iprot.readString();
struct.setServerSessionIdIsSet(true);
}
if (incoming.get(1)) {
struct.imageDescription = new ImageData();
struct.imageDescription.read(iprot);
struct.setImageDescriptionIsSet(true);
}
}
}
}
public static class submitImage_result implements org.apache.thrift.TBase<submitImage_result, submitImage_result._Fields>, java.io.Serializable, Cloneable, Comparable<submitImage_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("submitImage_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField FAILURE2_FIELD_DESC = new org.apache.thrift.protocol.TField("failure2", 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 submitImage_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new submitImage_resultTupleSchemeFactory());
}
public FtpCredentials success; // required
public AuthorizationException failure; // required
public ImageDataException failure2; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure"),
FAILURE2((short)2, "failure2");
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;
case 1: // FAILURE
return FAILURE;
case 2: // FAILURE2
return FAILURE2;
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, FtpCredentials.class)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.FAILURE2, new org.apache.thrift.meta_data.FieldMetaData("failure2", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(submitImage_result.class, metaDataMap);
}
public submitImage_result() {
}
public submitImage_result(
FtpCredentials success,
AuthorizationException failure,
ImageDataException failure2)
{
this();
this.success = success;
this.failure = failure;
this.failure2 = failure2;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public submitImage_result(submitImage_result other) {
if (other.isSetSuccess()) {
this.success = new FtpCredentials(other.success);
}
if (other.isSetFailure()) {
this.failure = new AuthorizationException(other.failure);
}
if (other.isSetFailure2()) {
this.failure2 = new ImageDataException(other.failure2);
}
}
public submitImage_result deepCopy() {
return new submitImage_result(this);
}
@Override
public void clear() {
this.success = null;
this.failure = null;
this.failure2 = null;
}
public FtpCredentials getSuccess() {
return this.success;
}
public submitImage_result setSuccess(FtpCredentials 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 AuthorizationException getFailure() {
return this.failure;
}
public submitImage_result setFailure(AuthorizationException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public ImageDataException getFailure2() {
return this.failure2;
}
public submitImage_result setFailure2(ImageDataException failure2) {
this.failure2 = failure2;
return this;
}
public void unsetFailure2() {
this.failure2 = null;
}
/** Returns true if field failure2 is set (has been assigned a value) and false otherwise */
public boolean isSetFailure2() {
return this.failure2 != null;
}
public void setFailure2IsSet(boolean value) {
if (!value) {
this.failure2 = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((FtpCredentials)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((AuthorizationException)value);
}
break;
case FAILURE2:
if (value == null) {
unsetFailure2();
} else {
setFailure2((ImageDataException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case FAILURE:
return getFailure();
case FAILURE2:
return getFailure2();
}
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();
case FAILURE:
return isSetFailure();
case FAILURE2:
return isSetFailure2();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof submitImage_result)
return this.equals((submitImage_result)that);
return false;
}
public boolean equals(submitImage_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;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
boolean this_present_failure2 = true && this.isSetFailure2();
boolean that_present_failure2 = true && that.isSetFailure2();
if (this_present_failure2 || that_present_failure2) {
if (!(this_present_failure2 && that_present_failure2))
return false;
if (!this.failure2.equals(that.failure2))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(submitImage_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetFailure2()).compareTo(other.isSetFailure2());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure2()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure2, other.failure2);
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("submitImage_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
first = false;
if (!first) sb.append(", ");
sb.append("failure2:");
if (this.failure2 == null) {
sb.append("null");
} else {
sb.append(this.failure2);
}
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 submitImage_resultStandardSchemeFactory implements SchemeFactory {
public submitImage_resultStandardScheme getScheme() {
return new submitImage_resultStandardScheme();
}
}
private static class submitImage_resultStandardScheme extends StandardScheme<submitImage_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, submitImage_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 FtpCredentials();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new AuthorizationException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // FAILURE2
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure2 = new ImageDataException();
struct.failure2.read(iprot);
struct.setFailure2IsSet(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, submitImage_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
if (struct.failure2 != null) {
oprot.writeFieldBegin(FAILURE2_FIELD_DESC);
struct.failure2.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class submitImage_resultTupleSchemeFactory implements SchemeFactory {
public submitImage_resultTupleScheme getScheme() {
return new submitImage_resultTupleScheme();
}
}
private static class submitImage_resultTupleScheme extends TupleScheme<submitImage_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, submitImage_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
if (struct.isSetFailure2()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
if (struct.isSetFailure2()) {
struct.failure2.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, submitImage_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new FtpCredentials();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new AuthorizationException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
if (incoming.get(2)) {
struct.failure2 = new ImageDataException();
struct.failure2.read(iprot);
struct.setFailure2IsSet(true);
}
}
}
}
public static class finshedUpload_args implements org.apache.thrift.TBase<finshedUpload_args, finshedUpload_args._Fields>, java.io.Serializable, Cloneable, Comparable<finshedUpload_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finshedUpload_args");
private static final org.apache.thrift.protocol.TField FTP_USER_FIELD_DESC = new org.apache.thrift.protocol.TField("ftpUser", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField IMAGE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("imageDescription", 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 finshedUpload_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new finshedUpload_argsTupleSchemeFactory());
}
public String ftpUser; // required
public ImageData imageDescription; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
FTP_USER((short)1, "ftpUser"),
IMAGE_DESCRIPTION((short)2, "imageDescription");
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: // FTP_USER
return FTP_USER;
case 2: // IMAGE_DESCRIPTION
return IMAGE_DESCRIPTION;
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.FTP_USER, new org.apache.thrift.meta_data.FieldMetaData("ftpUser", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.IMAGE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("imageDescription", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImageData.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finshedUpload_args.class, metaDataMap);
}
public finshedUpload_args() {
}
public finshedUpload_args(
String ftpUser,
ImageData imageDescription)
{
this();
this.ftpUser = ftpUser;
this.imageDescription = imageDescription;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public finshedUpload_args(finshedUpload_args other) {
if (other.isSetFtpUser()) {
this.ftpUser = other.ftpUser;
}
if (other.isSetImageDescription()) {
this.imageDescription = new ImageData(other.imageDescription);
}
}
public finshedUpload_args deepCopy() {
return new finshedUpload_args(this);
}
@Override
public void clear() {
this.ftpUser = null;
this.imageDescription = null;
}
public String getFtpUser() {
return this.ftpUser;
}
public finshedUpload_args setFtpUser(String ftpUser) {
this.ftpUser = ftpUser;
return this;
}
public void unsetFtpUser() {
this.ftpUser = null;
}
/** Returns true if field ftpUser is set (has been assigned a value) and false otherwise */
public boolean isSetFtpUser() {
return this.ftpUser != null;
}
public void setFtpUserIsSet(boolean value) {
if (!value) {
this.ftpUser = null;
}
}
public ImageData getImageDescription() {
return this.imageDescription;
}
public finshedUpload_args setImageDescription(ImageData imageDescription) {
this.imageDescription = imageDescription;
return this;
}
public void unsetImageDescription() {
this.imageDescription = null;
}
/** Returns true if field imageDescription is set (has been assigned a value) and false otherwise */
public boolean isSetImageDescription() {
return this.imageDescription != null;
}
public void setImageDescriptionIsSet(boolean value) {
if (!value) {
this.imageDescription = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case FTP_USER:
if (value == null) {
unsetFtpUser();
} else {
setFtpUser((String)value);
}
break;
case IMAGE_DESCRIPTION:
if (value == null) {
unsetImageDescription();
} else {
setImageDescription((ImageData)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case FTP_USER:
return getFtpUser();
case IMAGE_DESCRIPTION:
return getImageDescription();
}
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 FTP_USER:
return isSetFtpUser();
case IMAGE_DESCRIPTION:
return isSetImageDescription();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof finshedUpload_args)
return this.equals((finshedUpload_args)that);
return false;
}
public boolean equals(finshedUpload_args that) {
if (that == null)
return false;
boolean this_present_ftpUser = true && this.isSetFtpUser();
boolean that_present_ftpUser = true && that.isSetFtpUser();
if (this_present_ftpUser || that_present_ftpUser) {
if (!(this_present_ftpUser && that_present_ftpUser))
return false;
if (!this.ftpUser.equals(that.ftpUser))
return false;
}
boolean this_present_imageDescription = true && this.isSetImageDescription();
boolean that_present_imageDescription = true && that.isSetImageDescription();
if (this_present_imageDescription || that_present_imageDescription) {
if (!(this_present_imageDescription && that_present_imageDescription))
return false;
if (!this.imageDescription.equals(that.imageDescription))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(finshedUpload_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetFtpUser()).compareTo(other.isSetFtpUser());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFtpUser()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ftpUser, other.ftpUser);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetImageDescription()).compareTo(other.isSetImageDescription());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetImageDescription()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageDescription, other.imageDescription);
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("finshedUpload_args(");
boolean first = true;
sb.append("ftpUser:");
if (this.ftpUser == null) {
sb.append("null");
} else {
sb.append(this.ftpUser);
}
first = false;
if (!first) sb.append(", ");
sb.append("imageDescription:");
if (this.imageDescription == null) {
sb.append("null");
} else {
sb.append(this.imageDescription);
}
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 (imageDescription != null) {
imageDescription.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 finshedUpload_argsStandardSchemeFactory implements SchemeFactory {
public finshedUpload_argsStandardScheme getScheme() {
return new finshedUpload_argsStandardScheme();
}
}
private static class finshedUpload_argsStandardScheme extends StandardScheme<finshedUpload_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, finshedUpload_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: // FTP_USER
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.ftpUser = iprot.readString();
struct.setFtpUserIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // IMAGE_DESCRIPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.imageDescription = new ImageData();
struct.imageDescription.read(iprot);
struct.setImageDescriptionIsSet(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, finshedUpload_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.ftpUser != null) {
oprot.writeFieldBegin(FTP_USER_FIELD_DESC);
oprot.writeString(struct.ftpUser);
oprot.writeFieldEnd();
}
if (struct.imageDescription != null) {
oprot.writeFieldBegin(IMAGE_DESCRIPTION_FIELD_DESC);
struct.imageDescription.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class finshedUpload_argsTupleSchemeFactory implements SchemeFactory {
public finshedUpload_argsTupleScheme getScheme() {
return new finshedUpload_argsTupleScheme();
}
}
private static class finshedUpload_argsTupleScheme extends TupleScheme<finshedUpload_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, finshedUpload_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetFtpUser()) {
optionals.set(0);
}
if (struct.isSetImageDescription()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetFtpUser()) {
oprot.writeString(struct.ftpUser);
}
if (struct.isSetImageDescription()) {
struct.imageDescription.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, finshedUpload_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.ftpUser = iprot.readString();
struct.setFtpUserIsSet(true);
}
if (incoming.get(1)) {
struct.imageDescription = new ImageData();
struct.imageDescription.read(iprot);
struct.setImageDescriptionIsSet(true);
}
}
}
}
public static class finshedUpload_result implements org.apache.thrift.TBase<finshedUpload_result, finshedUpload_result._Fields>, java.io.Serializable, Cloneable, Comparable<finshedUpload_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("finshedUpload_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
private static final org.apache.thrift.protocol.TField FAILURE_FIELD_DESC = new org.apache.thrift.protocol.TField("failure", 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 finshedUpload_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new finshedUpload_resultTupleSchemeFactory());
}
public boolean success; // required
public ImageDataException failure; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
FAILURE((short)1, "failure");
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;
case 1: // FAILURE
return FAILURE;
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
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
tmpMap.put(_Fields.FAILURE, new org.apache.thrift.meta_data.FieldMetaData("failure", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(finshedUpload_result.class, metaDataMap);
}
public finshedUpload_result() {
}
public finshedUpload_result(
boolean success,
ImageDataException failure)
{
this();
this.success = success;
setSuccessIsSet(true);
this.failure = failure;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public finshedUpload_result(finshedUpload_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
if (other.isSetFailure()) {
this.failure = new ImageDataException(other.failure);
}
}
public finshedUpload_result deepCopy() {
return new finshedUpload_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = false;
this.failure = null;
}
public boolean isSuccess() {
return this.success;
}
public finshedUpload_result setSuccess(boolean success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public ImageDataException getFailure() {
return this.failure;
}
public finshedUpload_result setFailure(ImageDataException failure) {
this.failure = failure;
return this;
}
public void unsetFailure() {
this.failure = null;
}
/** Returns true if field failure is set (has been assigned a value) and false otherwise */
public boolean isSetFailure() {
return this.failure != null;
}
public void setFailureIsSet(boolean value) {
if (!value) {
this.failure = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Boolean)value);
}
break;
case FAILURE:
if (value == null) {
unsetFailure();
} else {
setFailure((ImageDataException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return Boolean.valueOf(isSuccess());
case FAILURE:
return getFailure();
}
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();
case FAILURE:
return isSetFailure();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof finshedUpload_result)
return this.equals((finshedUpload_result)that);
return false;
}
public boolean equals(finshedUpload_result that) {
if (that == null)
return false;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
boolean this_present_failure = true && this.isSetFailure();
boolean that_present_failure = true && that.isSetFailure();
if (this_present_failure || that_present_failure) {
if (!(this_present_failure && that_present_failure))
return false;
if (!this.failure.equals(that.failure))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
@Override
public int compareTo(finshedUpload_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;
}
}
lastComparison = Boolean.valueOf(isSetFailure()).compareTo(other.isSetFailure());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFailure()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failure, other.failure);
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("finshedUpload_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
if (!first) sb.append(", ");
sb.append("failure:");
if (this.failure == null) {
sb.append("null");
} else {
sb.append(this.failure);
}
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 {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class finshedUpload_resultStandardSchemeFactory implements SchemeFactory {
public finshedUpload_resultStandardScheme getScheme() {
return new finshedUpload_resultStandardScheme();
}
}
private static class finshedUpload_resultStandardScheme extends StandardScheme<finshedUpload_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, finshedUpload_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.BOOL) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // FAILURE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.failure = new ImageDataException();
struct.failure.read(iprot);
struct.setFailureIsSet(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, finshedUpload_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeBool(struct.success);
oprot.writeFieldEnd();
}
if (struct.failure != null) {
oprot.writeFieldBegin(FAILURE_FIELD_DESC);
struct.failure.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class finshedUpload_resultTupleSchemeFactory implements SchemeFactory {
public finshedUpload_resultTupleScheme getScheme() {
return new finshedUpload_resultTupleScheme();
}
}
private static class finshedUpload_resultTupleScheme extends TupleScheme<finshedUpload_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, finshedUpload_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetFailure()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
oprot.writeBool(struct.success);
}
if (struct.isSetFailure()) {
struct.failure.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, finshedUpload_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = iprot.readBool();
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.failure = new ImageDataException();
struct.failure.read(iprot);
struct.setFailureIsSet(true);
}
}
}
}
}