From 693392fe6c0022e7ec5060192ee322c7753b0d90 Mon Sep 17 00:00:00 2001
From: Simon Rettberg
Date: Fri, 5 Jun 2015 11:25:50 +0200
Subject: Changes for Dozmod v1.1
---
pom.xml | 2 +-
.../java/org/openslx/filetransfer/ClassTest.java | 4 +-
.../java/org/openslx/filetransfer/Downloader.java | 29 +-
.../org/openslx/filetransfer/IncomingEvent.java | 4 +-
.../java/org/openslx/filetransfer/Listener.java | 158 +-
.../java/org/openslx/filetransfer/Transfer.java | 113 +-
.../openslx/filetransfer/UploadStatusCallback.java | 10 +
.../java/org/openslx/filetransfer/Uploader.java | 44 +-
.../thrift/iface/AuthenticationError.java | 60 -
.../thrift/iface/AuthenticationException.java | 504 -
.../thrift/iface/AuthorizationError.java | 48 -
.../thrift/iface/AuthorizationException.java | 504 -
.../imagemaster/thrift/iface/DownloadData.java | 635 -
.../thrift/iface/DownloadException.java | 504 -
.../imagemaster/thrift/iface/ImageData.java | 1350 -
.../imagemaster/thrift/iface/ImageDataError.java | 45 -
.../thrift/iface/ImageDataException.java | 504 -
.../imagemaster/thrift/iface/ImageServer.java | 15606 ------
.../thrift/iface/InvalidTokenException.java | 280 -
.../imagemaster/thrift/iface/OrganizationData.java | 737 -
.../thrift/iface/ServerSessionData.java | 388 -
.../imagemaster/thrift/iface/SessionData.java | 588 -
.../imagemaster/thrift/iface/UploadData.java | 486 -
.../imagemaster/thrift/iface/UploadError.java | 54 -
.../imagemaster/thrift/iface/UploadException.java | 504 -
.../openslx/imagemaster/thrift/iface/UserInfo.java | 788 -
.../java/org/openslx/sat/thrift/iface/Image.java | 1388 -
.../java/org/openslx/sat/thrift/iface/Lecture.java | 1188 -
.../java/org/openslx/sat/thrift/iface/Person.java | 1350 -
.../java/org/openslx/sat/thrift/iface/Server.java | 55510 -------------------
.../java/org/openslx/sat/thrift/iface/User.java | 588 -
.../org/openslx/sat/thrift/version/Version.java | 2 +-
.../org/openslx/thrifthelper/ThriftHandler.java | 27 +-
.../java/org/openslx/util/TimeoutReference.java | 49 +
src/main/thrift/bwlp.thrift | 242 +
src/main/thrift/imagemaster.thrift | 162 -
src/main/thrift/sat.thrift | 104 -
thrift-compile.sh | 16 +-
38 files changed, 530 insertions(+), 84045 deletions(-)
create mode 100644 src/main/java/org/openslx/filetransfer/UploadStatusCallback.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationError.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/DownloadData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/DownloadException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataError.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/InvalidTokenException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/OrganizationData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/ServerSessionData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/SessionData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/UploadData.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/UploadError.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/UploadException.java
delete mode 100644 src/main/java/org/openslx/imagemaster/thrift/iface/UserInfo.java
delete mode 100644 src/main/java/org/openslx/sat/thrift/iface/Image.java
delete mode 100644 src/main/java/org/openslx/sat/thrift/iface/Lecture.java
delete mode 100644 src/main/java/org/openslx/sat/thrift/iface/Person.java
delete mode 100644 src/main/java/org/openslx/sat/thrift/iface/Server.java
delete mode 100644 src/main/java/org/openslx/sat/thrift/iface/User.java
create mode 100644 src/main/java/org/openslx/util/TimeoutReference.java
create mode 100644 src/main/thrift/bwlp.thrift
delete mode 100644 src/main/thrift/imagemaster.thrift
delete mode 100644 src/main/thrift/sat.thrift
diff --git a/pom.xml b/pom.xml
index a8bbaba..a097104 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
org.openslx.bwlp
master-sync-shared
- 1.0-SNAPSHOT
+ 1.1-SNAPSHOT
jar
master-sync-shared
diff --git a/src/main/java/org/openslx/filetransfer/ClassTest.java b/src/main/java/org/openslx/filetransfer/ClassTest.java
index 92269bb..37b37c0 100644
--- a/src/main/java/org/openslx/filetransfer/ClassTest.java
+++ b/src/main/java/org/openslx/filetransfer/ClassTest.java
@@ -141,7 +141,7 @@ public class ClassTest
// Implementing IncomingEvent for testing case.
static class Test implements IncomingEvent
{
- public void incomingUploader( Uploader uploader ) throws IOException
+ public void incomingDownloadRequest( Uploader uploader ) throws IOException
{
if ( uploader.getToken() == null ) {
System.out.println( "Incoming uploader: could not get token!" );
@@ -153,7 +153,7 @@ public class ClassTest
System.out.println( "Incomgin uploader OK" );
}
- public void incomingDownloader( Downloader downloader ) throws IOException
+ public void incomingUploadRequest( Downloader downloader ) throws IOException
{
if ( downloader.getToken() == null ) {
System.out.println( "Incoming downloader: could not get token!" );
diff --git a/src/main/java/org/openslx/filetransfer/Downloader.java b/src/main/java/org/openslx/filetransfer/Downloader.java
index 00c6f69..20a50e6 100644
--- a/src/main/java/org/openslx/filetransfer/Downloader.java
+++ b/src/main/java/org/openslx/filetransfer/Downloader.java
@@ -4,9 +4,9 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
+import java.net.Socket;
import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
import org.apache.log4j.Logger;
@@ -38,11 +38,20 @@ public class Downloader extends Transfer
* @param socket established connection to peer which requested an upload.
* @throws IOException
*/
- protected Downloader( SSLSocket socket ) throws IOException
+ protected Downloader( Socket socket ) throws IOException
{
super( socket, log );
}
+ /**
+ * Initiate the download. This method does not return until the file transfer finished.
+ *
+ * @param destinationFile destination file name to download to
+ * @param rangeCallback this object's .get() method is called whenever the downloader needs to
+ * know which part of the file to request next. This method should return null if no
+ * more parts are needed, which in turn let's this method return true
+ * @return true on success, false otherwise
+ */
public boolean download( final String destinationFile, final WantRangeCallback callback )
{
RandomAccessFile file = null;
@@ -69,14 +78,20 @@ public class Downloader extends Transfer
};
return download( cb, callback );
} finally {
- if ( file != null )
- try {
- file.close();
- } catch ( IOException e ) {
- }
+ Transfer.safeClose( file );
}
}
+ /**
+ * Initiate the download. This method does not return until the file transfer finished.
+ *
+ * @param dataCallback this object's .dataReceived() method is called whenever a chunk of data is
+ * received
+ * @param rangeCallback this object's .get() method is called whenever the downloader needs to
+ * know which part of the file to request next. This method should return null if no
+ * more parts are needed, which in turn let's this method return true
+ * @return true on success, false otherwise
+ */
public boolean download( DataReceivedCallback dataCallback, WantRangeCallback rangeCallback )
{
if ( shouldGetToken() ) {
diff --git a/src/main/java/org/openslx/filetransfer/IncomingEvent.java b/src/main/java/org/openslx/filetransfer/IncomingEvent.java
index fc5dc63..d72ecdd 100644
--- a/src/main/java/org/openslx/filetransfer/IncomingEvent.java
+++ b/src/main/java/org/openslx/filetransfer/IncomingEvent.java
@@ -11,7 +11,7 @@ import java.io.IOException;
*/
public interface IncomingEvent
{
- void incomingUploader( Uploader uploader ) throws IOException;
+ void incomingDownloadRequest( Uploader uploader ) throws IOException;
- void incomingDownloader( Downloader downloader ) throws IOException;
+ void incomingUploadRequest( Downloader downloader ) throws IOException;
}
diff --git a/src/main/java/org/openslx/filetransfer/Listener.java b/src/main/java/org/openslx/filetransfer/Listener.java
index 699c61d..e4e99e9 100644
--- a/src/main/java/org/openslx/filetransfer/Listener.java
+++ b/src/main/java/org/openslx/filetransfer/Listener.java
@@ -1,29 +1,35 @@
package org.openslx.filetransfer;
import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
-import javax.net.ssl.SSLSocket;
import org.apache.log4j.Logger;
-public class Listener extends Thread
+public class Listener
{
- private IncomingEvent incomingEvent;
- private SSLContext context;
- private int port;
- final private int U = 85; // hex - code 'U' = 85.
- final private int D = 68; // hex - code 'D' = 68.
+ private final IncomingEvent incomingEvent;
+ private final SSLContext context;
+ private final int port;
+ private ServerSocket listenSocket = null;
+ private Thread acceptThread = null;
+ private static final byte U = 85; // hex - code 'U' = 85.
+ private static final byte D = 68; // hex - code 'D' = 68.
private static Logger log = Logger.getLogger( Listener.class );
/***********************************************************************/
/**
- * Constructor for class Listener, which gets an instance of IncomingEvent.
+ * File transfer listener. This is the active side, opening a port and
+ * waiting for incoming connections.
*
- * @param e
+ * @param e the event handler for incoming connections
+ * @param context the SSL context used for encryption; if null, unencrypted connections will be
+ * used
+ * @param port port to listen on
*/
public Listener( IncomingEvent e, SSLContext context, int port )
{
@@ -38,48 +44,74 @@ public class Listener extends Thread
* connection, and start Downloader or Uploader.
*
*/
- private void listen()
+ private boolean listen()
{
- SSLServerSocket welcomeSocket = null;
try {
- SSLServerSocketFactory sslServerSocketFactory = context.getServerSocketFactory();
- welcomeSocket = (SSLServerSocket)sslServerSocketFactory.createServerSocket( this.port );
+ if ( this.context == null ) {
+ listenSocket = new ServerSocket( this.port );
+ } else {
+ SSLServerSocketFactory sslServerSocketFactory = context.getServerSocketFactory();
+ listenSocket = sslServerSocketFactory.createServerSocket( this.port );
+ }
+ } catch ( Exception e ) {
+ log.error( "Cannot listen on port " + this.port );
+ return false;
+ }
+ return true;
+ }
- while ( !isInterrupted() ) {
- SSLSocket connectionSocket = (SSLSocket)welcomeSocket.accept();
- connectionSocket.setSoTimeout( 2000 ); // 2 second timeout enough? Maybe even use a small thread pool for handling accepted connections
+ private void run()
+ {
+ final Listener instance = this;
+ acceptThread = new Thread() {
+ @Override
+ public void run()
+ {
+ try {
+ while ( !isInterrupted() ) {
+ Socket connectionSocket = null;
+ try {
+ connectionSocket = listenSocket.accept();
+ connectionSocket.setSoTimeout( 2000 ); // 2 second timeout enough? Maybe even use a small thread pool for handling accepted connections
- byte[] b = new byte[ 1 ];
- int length = connectionSocket.getInputStream().read( b );
+ byte[] b = new byte[ 1 ];
+ int length = connectionSocket.getInputStream().read( b );
- log.debug( "Length (Listener): " + length );
+ connectionSocket.setSoTimeout( 10000 );
- if ( b[0] == U ) {
- log.debug( "recognized U --> starting Downloader" );
- // --> start Downloader(socket).
- Downloader d = new Downloader( connectionSocket );
- incomingEvent.incomingDownloader( d );
- }
- else if ( b[0] == D ) {
- log.debug( "recognized D --> starting Uploader" );
- // --> start Uploader(socket).
- Uploader u = new Uploader( connectionSocket );
- incomingEvent.incomingUploader( u );
- }
- else {
- log.debug( "Got invalid option ... close connection" );
- connectionSocket.close();
+ log.debug( "Length (Listener): " + length );
+
+ if ( b[0] == U ) {
+ log.debug( "recognized U --> starting Downloader" );
+ // --> start Downloader(socket).
+ Downloader d = new Downloader( connectionSocket );
+ incomingEvent.incomingUploadRequest( d );
+ }
+ else if ( b[0] == D ) {
+ log.debug( "recognized D --> starting Uploader" );
+ // --> start Uploader(socket).
+ Uploader u = new Uploader( connectionSocket );
+ incomingEvent.incomingDownloadRequest( u );
+ }
+ else {
+ log.debug( "Got invalid option ... close connection" );
+ connectionSocket.close();
+ }
+ } catch ( IOException e ) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ } finally {
+ synchronized ( instance ) {
+ Transfer.safeClose( listenSocket );
+ listenSocket = null;
+ }
}
}
- } catch ( Exception e ) {
- e.printStackTrace(); // same as writing to System.err.println(e.toString).
- } finally {
- try {
- welcomeSocket.close();
- } catch ( IOException e ) {
- // Nothing we can do
- }
- }
+ };
+ acceptThread.start();
+ log.info( "Starting to accept " + ( this.context == null ? "UNENCRYPTED" : "encrypted" ) + " connections on port " + this.port );
}
public int getPort()
@@ -87,14 +119,36 @@ public class Listener extends Thread
return this.port;
}
- @Override
- public void run()
+ /**
+ * Check whether this listener is running.
+ *
+ * @return true if this instance is currently listening for connections and runs the accept loop.
+ */
+ public synchronized boolean isRunning()
{
- try {
- this.listen();
- } catch ( Exception e ) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ return acceptThread != null && acceptThread.isAlive() && listenSocket != null && !listenSocket.isClosed();
+ }
+
+ /**
+ * Check whether this listener was started.
+ *
+ * @return true if this instance was started before, but might have been stopped already.
+ */
+ public synchronized boolean wasStarted()
+ {
+ return acceptThread != null;
+ }
+
+ /**
+ * Start this listener.
+ *
+ * @return true if the port could be openened and the accepting thread was started
+ */
+ public synchronized boolean start()
+ {
+ if ( !this.listen() )
+ return false;
+ this.run();
+ return true;
}
}
diff --git a/src/main/java/org/openslx/filetransfer/Transfer.java b/src/main/java/org/openslx/filetransfer/Transfer.java
index 3f2fdde..3e278c8 100644
--- a/src/main/java/org/openslx/filetransfer/Transfer.java
+++ b/src/main/java/org/openslx/filetransfer/Transfer.java
@@ -1,23 +1,23 @@
package org.openslx.filetransfer;
+import java.io.Closeable;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.InetSocketAddress;
+import java.net.Socket;
import java.net.SocketTimeoutException;
-import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import org.apache.log4j.Logger;
public abstract class Transfer
{
- protected final SSLSocket transferSocket;
+ protected final Socket transferSocket;
protected final DataOutputStream outStream;
protected final DataInputStream dataFromServer;
protected String ERROR = null;
@@ -30,7 +30,7 @@ public abstract class Transfer
*
* @param host Remote Host
* @param port Remote Port
- * @param context SSL Context for encryption
+ * @param context SSL Context for encryption, null if plain
* @param log Logger to use
* @throws IOException
*/
@@ -38,10 +38,13 @@ public abstract class Transfer
{
this.log = log;
// create socket.
- SSLSocketFactory sslSocketFactory = context.getSocketFactory();
-
- transferSocket = (SSLSocket)sslSocketFactory.createSocket();
- transferSocket.setSoTimeout( 5000 ); // set socket timeout.
+ if ( context == null ) {
+ transferSocket = new Socket();
+ } else {
+ SSLSocketFactory sslSocketFactory = context.getSocketFactory();
+ transferSocket = sslSocketFactory.createSocket();
+ }
+ transferSocket.setSoTimeout( 10000 ); // set socket timeout.
transferSocket.connect( new InetSocketAddress( host, port ) );
outStream = new DataOutputStream( transferSocket.getOutputStream() );
@@ -56,7 +59,7 @@ public abstract class Transfer
* @param log Logger to use
* @throws IOException
*/
- protected Transfer( SSLSocket socket, Logger log ) throws IOException
+ protected Transfer( Socket socket, Logger log ) throws IOException
{
this.log = log;
transferSocket = socket;
@@ -122,7 +125,7 @@ public abstract class Transfer
protected boolean sendEndOfMeta()
{
try {
- outStream.writeByte( 0 );
+ outStream.writeShort( 0 );
} catch ( SocketTimeoutException e ) {
log.error( "Error sending end of meta - socket timeout" );
return false;
@@ -146,39 +149,10 @@ public abstract class Transfer
Map entries = new HashMap<>();
try {
while ( true ) {
- byte[] incoming = new byte[ 255 ];
-
- // First get length.
- int retLengthByte;
- retLengthByte = dataFromServer.read( incoming, 0, 1 );
- // If .read() didn't return 1, it was not able to read first byte.
- if ( retLengthByte != 1 ) {
- log.debug( " retLenthByte was not 1! retLengthByte = " + retLengthByte );
- this.close( "Error occured while reading Metadata." );
- return null;
- }
+ String data = dataFromServer.readUTF();
- int length = incoming[0] & 0xFF;
- log.debug( "length (downloader): " + length );
-
- if ( length == 0 )
- break;
-
- /*
- * Read the next available bytes and split by '=' for
- * getting TOKEN or RANGE.
- */
- int hasRead = 0;
- while ( hasRead < length ) {
- int ret = dataFromServer.read( incoming, hasRead, length - hasRead );
- if ( ret == -1 ) {
- this.close( "Error occured while reading Metadata." );
- return null;
- }
- hasRead += ret;
- }
-
- String data = new String( incoming, 0, length, StandardCharsets.UTF_8 );
+ if ( data == null || data.length() == 0 )
+ break; // End of meta data
String[] splitted = data.split( "=", 2 );
if ( splitted.length != 2 ) {
@@ -208,12 +182,12 @@ public abstract class Transfer
private void sendKeyValuePair( String key, String value ) throws IOException
{
- byte[] data = ( key + "=" + value ).getBytes( StandardCharsets.UTF_8 );
+ if ( outStream == null )
+ return;
try {
- outStream.writeByte( data.length );
- outStream.write( data );
- } catch ( SocketTimeoutException e ) {
- log.warn( "Socket timeout when sending KVP with key " + key );
+ outStream.writeUTF( key + "=" + value );
+ } catch ( Exception e ) {
+ this.close( e.getClass().getSimpleName() + " when sending KVP with key " + key );
}
}
@@ -222,20 +196,21 @@ public abstract class Transfer
* Method for closing connection, if download has finished.
*
*/
- public void close( String error )
+ public void close( String error, UploadStatusCallback callback, boolean sendToPeer )
{
- if ( error != null )
+ if ( error != null ) {
+ if ( sendToPeer )
+ sendErrorCode( error );
+ if ( callback != null )
+ callback.uploadError( error );
log.info( error );
- try {
- if ( transferSocket != null )
- this.transferSocket.close();
- if ( dataFromServer != null )
- dataFromServer.close();
- if ( outStream != null )
- outStream.close();
- } catch ( IOException e ) {
- e.printStackTrace();
}
+ safeClose( dataFromServer, outStream, transferSocket );
+ }
+
+ public void close( String error )
+ {
+ close( error, null, false );
}
/**
@@ -294,6 +269,28 @@ public abstract class Transfer
return shouldGetToken;
}
+ /**
+ * Close given stream, socket, anything closeable.
+ * Never throws any exception, if it's not closeable there's
+ * not much else we can do.
+ *
+ * @param list one or more closeables. Pass one, many, or an array
+ */
+ static protected void safeClose( Closeable... list )
+ {
+ if ( list == null )
+ return;
+ for ( Closeable c : list ) {
+ if ( c == null )
+ continue;
+ try {
+ c.close();
+ } catch ( Throwable t ) {
+ // Silcence...
+ }
+ }
+ }
+
/**
* High level access to key-value-pairs.
*/
diff --git a/src/main/java/org/openslx/filetransfer/UploadStatusCallback.java b/src/main/java/org/openslx/filetransfer/UploadStatusCallback.java
new file mode 100644
index 0000000..72f8f61
--- /dev/null
+++ b/src/main/java/org/openslx/filetransfer/UploadStatusCallback.java
@@ -0,0 +1,10 @@
+package org.openslx.filetransfer;
+
+public interface UploadStatusCallback
+{
+
+ public void uploadError( String message );
+
+ public void uploadProgress( long bytesSent );
+
+}
diff --git a/src/main/java/org/openslx/filetransfer/Uploader.java b/src/main/java/org/openslx/filetransfer/Uploader.java
index 87845fa..748b1e2 100644
--- a/src/main/java/org/openslx/filetransfer/Uploader.java
+++ b/src/main/java/org/openslx/filetransfer/Uploader.java
@@ -4,9 +4,9 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
+import java.net.Socket;
import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
import org.apache.log4j.Logger;
@@ -39,7 +39,7 @@ public class Uploader extends Transfer
*
* @throws IOException
*/
- public Uploader( SSLSocket socket ) throws IOException
+ public Uploader( Socket socket ) throws IOException
{
super( socket, log );
}
@@ -51,6 +51,12 @@ public class Uploader extends Transfer
* @param filename
*/
public boolean upload( String filename )
+ {
+ return upload( filename, null );
+ }
+
+ @SuppressWarnings( "resource" )
+ public boolean upload( String filename, UploadStatusCallback callback )
{
if ( shouldGetToken() ) {
log.error( "You didn't call getToken yet!" );
@@ -61,14 +67,14 @@ public class Uploader extends Transfer
try {
file = new RandomAccessFile( new File( filename ), "r" );
} catch ( FileNotFoundException e ) {
- log.error( "Could not open " + filename + " for reading." );
+ this.close( "Could not open given file for reading.", callback, true );
return false;
}
for ( ;; ) { // Loop as long as remote peer is requesting chunks from this file
// Read meta data of remote peer - either new range, or it's telling us it's done
MetaData meta = readMetaData();
if ( meta == null ) {
- log.error( "Did not get meta data from remote peer." );
+ this.close( "Did not get meta data from remote peer.", callback, true );
return false;
}
if ( meta.isDone() ) // Download complete?
@@ -76,37 +82,35 @@ public class Uploader extends Transfer
// Not complete, so there must be another range request
FileRange requestedRange = meta.getRange();
if ( requestedRange == null ) {
- log.error( "Remote peer did not include RANGE in meta data." );
- sendErrorCode( "no (valid) range in request" );
+ this.close( "Peer did not include RANGE in meta data.", callback, true );
return false;
}
// Range inside file?
try {
if ( requestedRange.endOffset > file.length() ) {
- log.error( "Requested range is larger than file size, aborting." );
- sendErrorCode( "range out of file bounds" );
+ this.close( "Requested range is larger than file size, aborting.", callback, true );
return false;
}
} catch ( IOException e ) {
- log.error( "Could not get current length of file " + filename );
+ this.close( "Could not get current length of file " + filename, callback, false );
return false;
}
// Seek to requested chunk
try {
file.seek( requestedRange.startOffset );
} catch ( IOException e ) {
- log.error( "Could not seek to start of requested range in " + filename + " (" + requestedRange.startOffset + ")" );
+ this.close( "Could not seek to start of requested range in given file (" + requestedRange.startOffset + ")", callback, true );
return false;
}
// Send confirmation of range we're about to send
try {
long ptr = file.getFilePointer();
if ( !sendRange( ptr, ptr + requestedRange.getLength() ) || !sendEndOfMeta() ) {
- log.error( "Could not send range confirmation" );
+ this.close( "Could not send range confirmation" );
return false;
}
} catch ( IOException e ) {
- log.error( "Could not determine current position in file " + filename );
+ this.close( "Could not determine current position in file " + filename );
return false;
}
// Finally send requested chunk
@@ -118,30 +122,26 @@ public class Uploader extends Transfer
try {
ret = file.read( data, 0, Math.min( length - hasRead, data.length ) );
} catch ( IOException e ) {
- log.error( "Error reading from file " + filename );
+ this.close( "Error reading from file ", callback, true );
return false;
}
if ( ret == -1 ) {
- this.close( "Error occured in Uploader.sendFile(),"
- + " while reading from File to send." );
+ this.close( "Error occured in Uploader.sendFile() while reading from File to send.", callback, true );
return false;
}
hasRead += ret;
try {
outStream.write( data, 0, ret );
} catch ( IOException e ) {
- log.error( "Sending payload failed" );
+ this.close( "Sending payload failed" );
return false;
}
+ if ( callback != null )
+ callback.uploadProgress( ret );
}
}
} finally {
- if ( file != null ) {
- try {
- file.close();
- } catch ( IOException e ) {
- }
- }
+ Transfer.safeClose( file );
}
return true;
}
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java
deleted file mode 100644
index 965ddd2..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationError.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * 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 java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum AuthenticationError implements org.apache.thrift.TEnum {
- GENERIC_ERROR(0),
- INVALID_CREDENTIALS(1),
- ACCOUNT_SUSPENDED(2),
- INVALID_ORGANIZATION(3),
- INVALID_KEY(4),
- CHALLENGE_FAILED(5),
- BANNED_NETWORK(6);
-
- private final int value;
-
- private AuthenticationError(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static AuthenticationError findByValue(int value) {
- switch (value) {
- case 0:
- return GENERIC_ERROR;
- case 1:
- return INVALID_CREDENTIALS;
- case 2:
- return ACCOUNT_SUSPENDED;
- case 3:
- return INVALID_ORGANIZATION;
- case 4:
- return INVALID_KEY;
- case 5:
- return CHALLENGE_FAILED;
- case 6:
- return BANNED_NETWORK;
- default:
- return null;
- }
- }
-}
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationException.java b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationException.java
deleted file mode 100644
index 5efc66c..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthenticationException.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/**
- * 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 AuthenticationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthenticationException");
-
- private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new AuthenticationExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AuthenticationExceptionTupleSchemeFactory());
- }
-
- /**
- *
- * @see AuthenticationError
- */
- public AuthenticationError number; // required
- public String message; // 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 {
- /**
- *
- * @see AuthenticationError
- */
- NUMBER((short)1, "number"),
- MESSAGE((short)2, "message");
-
- private static final Map byName = new HashMap();
-
- 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: // NUMBER
- return NUMBER;
- case 2: // MESSAGE
- return MESSAGE;
- 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AuthenticationError.class)));
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(AuthenticationException.class, metaDataMap);
- }
-
- public AuthenticationException() {
- }
-
- public AuthenticationException(
- AuthenticationError number,
- String message)
- {
- this();
- this.number = number;
- this.message = message;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public AuthenticationException(AuthenticationException other) {
- if (other.isSetNumber()) {
- this.number = other.number;
- }
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public AuthenticationException deepCopy() {
- return new AuthenticationException(this);
- }
-
- @Override
- public void clear() {
- this.number = null;
- this.message = null;
- }
-
- /**
- *
- * @see AuthenticationError
- */
- public AuthenticationError getNumber() {
- return this.number;
- }
-
- /**
- *
- * @see AuthenticationError
- */
- public AuthenticationException setNumber(AuthenticationError number) {
- this.number = number;
- return this;
- }
-
- public void unsetNumber() {
- this.number = null;
- }
-
- /** Returns true if field number is set (has been assigned a value) and false otherwise */
- public boolean isSetNumber() {
- return this.number != null;
- }
-
- public void setNumberIsSet(boolean value) {
- if (!value) {
- this.number = null;
- }
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public AuthenticationException setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUMBER:
- if (value == null) {
- unsetNumber();
- } else {
- setNumber((AuthenticationError)value);
- }
- break;
-
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUMBER:
- return getNumber();
-
- case MESSAGE:
- return getMessage();
-
- }
- 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 NUMBER:
- return isSetNumber();
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof AuthenticationException)
- return this.equals((AuthenticationException)that);
- return false;
- }
-
- public boolean equals(AuthenticationException that) {
- if (that == null)
- return false;
-
- boolean this_present_number = true && this.isSetNumber();
- boolean that_present_number = true && that.isSetNumber();
- if (this_present_number || that_present_number) {
- if (!(this_present_number && that_present_number))
- return false;
- if (!this.number.equals(that.number))
- return false;
- }
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(AuthenticationException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetNumber()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
- 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("AuthenticationException(");
- boolean first = true;
-
- sb.append("number:");
- if (this.number == null) {
- sb.append("null");
- } else {
- sb.append(this.number);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- 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 AuthenticationExceptionStandardSchemeFactory implements SchemeFactory {
- public AuthenticationExceptionStandardScheme getScheme() {
- return new AuthenticationExceptionStandardScheme();
- }
- }
-
- private static class AuthenticationExceptionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, AuthenticationException 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: // NUMBER
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.number = AuthenticationError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(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, AuthenticationException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.number != null) {
- oprot.writeFieldBegin(NUMBER_FIELD_DESC);
- oprot.writeI32(struct.number.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class AuthenticationExceptionTupleSchemeFactory implements SchemeFactory {
- public AuthenticationExceptionTupleScheme getScheme() {
- return new AuthenticationExceptionTupleScheme();
- }
- }
-
- private static class AuthenticationExceptionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetNumber()) {
- optionals.set(0);
- }
- if (struct.isSetMessage()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetNumber()) {
- oprot.writeI32(struct.number.getValue());
- }
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, AuthenticationException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.number = AuthenticationError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- }
- if (incoming.get(1)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationError.java b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationError.java
deleted file mode 100644
index a49ad92..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationError.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * 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 java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum AuthorizationError implements org.apache.thrift.TEnum {
- GENERIC_ERROR(0),
- NOT_AUTHENTICATED(1),
- NO_PERMISSION(2);
-
- private final int value;
-
- private AuthorizationError(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static AuthorizationError findByValue(int value) {
- switch (value) {
- case 0:
- return GENERIC_ERROR;
- case 1:
- return NOT_AUTHENTICATED;
- case 2:
- return NO_PERMISSION;
- default:
- return null;
- }
- }
-}
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationException.java b/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationException.java
deleted file mode 100644
index 5f798ac..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/AuthorizationException.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/**
- * 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 AuthorizationException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AuthorizationException");
-
- private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new AuthorizationExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new AuthorizationExceptionTupleSchemeFactory());
- }
-
- /**
- *
- * @see AuthorizationError
- */
- public AuthorizationError number; // required
- public String message; // 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 {
- /**
- *
- * @see AuthorizationError
- */
- NUMBER((short)1, "number"),
- MESSAGE((short)2, "message");
-
- private static final Map byName = new HashMap();
-
- 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: // NUMBER
- return NUMBER;
- case 2: // MESSAGE
- return MESSAGE;
- 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AuthorizationError.class)));
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(AuthorizationException.class, metaDataMap);
- }
-
- public AuthorizationException() {
- }
-
- public AuthorizationException(
- AuthorizationError number,
- String message)
- {
- this();
- this.number = number;
- this.message = message;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public AuthorizationException(AuthorizationException other) {
- if (other.isSetNumber()) {
- this.number = other.number;
- }
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public AuthorizationException deepCopy() {
- return new AuthorizationException(this);
- }
-
- @Override
- public void clear() {
- this.number = null;
- this.message = null;
- }
-
- /**
- *
- * @see AuthorizationError
- */
- public AuthorizationError getNumber() {
- return this.number;
- }
-
- /**
- *
- * @see AuthorizationError
- */
- public AuthorizationException setNumber(AuthorizationError number) {
- this.number = number;
- return this;
- }
-
- public void unsetNumber() {
- this.number = null;
- }
-
- /** Returns true if field number is set (has been assigned a value) and false otherwise */
- public boolean isSetNumber() {
- return this.number != null;
- }
-
- public void setNumberIsSet(boolean value) {
- if (!value) {
- this.number = null;
- }
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public AuthorizationException setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUMBER:
- if (value == null) {
- unsetNumber();
- } else {
- setNumber((AuthorizationError)value);
- }
- break;
-
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUMBER:
- return getNumber();
-
- case MESSAGE:
- return getMessage();
-
- }
- 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 NUMBER:
- return isSetNumber();
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof AuthorizationException)
- return this.equals((AuthorizationException)that);
- return false;
- }
-
- public boolean equals(AuthorizationException that) {
- if (that == null)
- return false;
-
- boolean this_present_number = true && this.isSetNumber();
- boolean that_present_number = true && that.isSetNumber();
- if (this_present_number || that_present_number) {
- if (!(this_present_number && that_present_number))
- return false;
- if (!this.number.equals(that.number))
- return false;
- }
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(AuthorizationException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetNumber()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
- 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("AuthorizationException(");
- boolean first = true;
-
- sb.append("number:");
- if (this.number == null) {
- sb.append("null");
- } else {
- sb.append(this.number);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- 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 AuthorizationExceptionStandardSchemeFactory implements SchemeFactory {
- public AuthorizationExceptionStandardScheme getScheme() {
- return new AuthorizationExceptionStandardScheme();
- }
- }
-
- private static class AuthorizationExceptionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, AuthorizationException 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: // NUMBER
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.number = AuthorizationError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(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, AuthorizationException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.number != null) {
- oprot.writeFieldBegin(NUMBER_FIELD_DESC);
- oprot.writeI32(struct.number.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class AuthorizationExceptionTupleSchemeFactory implements SchemeFactory {
- public AuthorizationExceptionTupleScheme getScheme() {
- return new AuthorizationExceptionTupleScheme();
- }
- }
-
- private static class AuthorizationExceptionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetNumber()) {
- optionals.set(0);
- }
- if (struct.isSetMessage()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetNumber()) {
- oprot.writeI32(struct.number.getValue());
- }
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, AuthorizationException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.number = AuthorizationError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- }
- if (incoming.get(1)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadData.java b/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadData.java
deleted file mode 100644
index 2dda1f7..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadData.java
+++ /dev/null
@@ -1,635 +0,0 @@
-/**
- * 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 DownloadData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DownloadData");
-
- 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 org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField CRC_SUMS_FIELD_DESC = new org.apache.thrift.protocol.TField("crcSums", org.apache.thrift.protocol.TType.LIST, (short)3);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new DownloadDataStandardSchemeFactory());
- schemes.put(TupleScheme.class, new DownloadDataTupleSchemeFactory());
- }
-
- public String token; // required
- public int port; // required
- public List crcSums; // 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"),
- PORT((short)2, "port"),
- CRC_SUMS((short)3, "crcSums");
-
- private static final Map byName = new HashMap();
-
- 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;
- case 2: // PORT
- return PORT;
- case 3: // CRC_SUMS
- return CRC_SUMS;
- 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 __PORT_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.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)));
- tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.CRC_SUMS, new org.apache.thrift.meta_data.FieldMetaData("crcSums", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DownloadData.class, metaDataMap);
- }
-
- public DownloadData() {
- }
-
- public DownloadData(
- String token,
- int port,
- List crcSums)
- {
- this();
- this.token = token;
- this.port = port;
- setPortIsSet(true);
- this.crcSums = crcSums;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public DownloadData(DownloadData other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.isSetToken()) {
- this.token = other.token;
- }
- this.port = other.port;
- if (other.isSetCrcSums()) {
- List __this__crcSums = new ArrayList(other.crcSums);
- this.crcSums = __this__crcSums;
- }
- }
-
- public DownloadData deepCopy() {
- return new DownloadData(this);
- }
-
- @Override
- public void clear() {
- this.token = null;
- setPortIsSet(false);
- this.port = 0;
- this.crcSums = null;
- }
-
- public String getToken() {
- return this.token;
- }
-
- public DownloadData 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 int getPort() {
- return this.port;
- }
-
- public DownloadData setPort(int port) {
- this.port = port;
- setPortIsSet(true);
- return this;
- }
-
- public void unsetPort() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- /** Returns true if field port is set (has been assigned a value) and false otherwise */
- public boolean isSetPort() {
- return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID);
- }
-
- public void setPortIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value);
- }
-
- public int getCrcSumsSize() {
- return (this.crcSums == null) ? 0 : this.crcSums.size();
- }
-
- public java.util.Iterator getCrcSumsIterator() {
- return (this.crcSums == null) ? null : this.crcSums.iterator();
- }
-
- public void addToCrcSums(int elem) {
- if (this.crcSums == null) {
- this.crcSums = new ArrayList();
- }
- this.crcSums.add(elem);
- }
-
- public List getCrcSums() {
- return this.crcSums;
- }
-
- public DownloadData setCrcSums(List crcSums) {
- this.crcSums = crcSums;
- return this;
- }
-
- public void unsetCrcSums() {
- this.crcSums = null;
- }
-
- /** Returns true if field crcSums is set (has been assigned a value) and false otherwise */
- public boolean isSetCrcSums() {
- return this.crcSums != null;
- }
-
- public void setCrcSumsIsSet(boolean value) {
- if (!value) {
- this.crcSums = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TOKEN:
- if (value == null) {
- unsetToken();
- } else {
- setToken((String)value);
- }
- break;
-
- case PORT:
- if (value == null) {
- unsetPort();
- } else {
- setPort((Integer)value);
- }
- break;
-
- case CRC_SUMS:
- if (value == null) {
- unsetCrcSums();
- } else {
- setCrcSums((List)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TOKEN:
- return getToken();
-
- case PORT:
- return Integer.valueOf(getPort());
-
- case CRC_SUMS:
- return getCrcSums();
-
- }
- 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();
- case PORT:
- return isSetPort();
- case CRC_SUMS:
- return isSetCrcSums();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof DownloadData)
- return this.equals((DownloadData)that);
- return false;
- }
-
- public boolean equals(DownloadData 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;
- }
-
- boolean this_present_port = true;
- boolean that_present_port = true;
- if (this_present_port || that_present_port) {
- if (!(this_present_port && that_present_port))
- return false;
- if (this.port != that.port)
- return false;
- }
-
- boolean this_present_crcSums = true && this.isSetCrcSums();
- boolean that_present_crcSums = true && that.isSetCrcSums();
- if (this_present_crcSums || that_present_crcSums) {
- if (!(this_present_crcSums && that_present_crcSums))
- return false;
- if (!this.crcSums.equals(that.crcSums))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(DownloadData 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;
- }
- }
- lastComparison = Boolean.valueOf(isSetPort()).compareTo(other.isSetPort());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetPort()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetCrcSums()).compareTo(other.isSetCrcSums());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetCrcSums()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.crcSums, other.crcSums);
- 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("DownloadData(");
- boolean first = true;
-
- sb.append("token:");
- if (this.token == null) {
- sb.append("null");
- } else {
- sb.append(this.token);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("port:");
- sb.append(this.port);
- first = false;
- if (!first) sb.append(", ");
- sb.append("crcSums:");
- if (this.crcSums == null) {
- sb.append("null");
- } else {
- sb.append(this.crcSums);
- }
- 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 DownloadDataStandardSchemeFactory implements SchemeFactory {
- public DownloadDataStandardScheme getScheme() {
- return new DownloadDataStandardScheme();
- }
- }
-
- private static class DownloadDataStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, DownloadData 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;
- case 2: // PORT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.port = iprot.readI32();
- struct.setPortIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // CRC_SUMS
- if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
- {
- org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
- struct.crcSums = new ArrayList(_list8.size);
- for (int _i9 = 0; _i9 < _list8.size; ++_i9)
- {
- int _elem10;
- _elem10 = iprot.readI32();
- struct.crcSums.add(_elem10);
- }
- iprot.readListEnd();
- }
- struct.setCrcSumsIsSet(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, DownloadData 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.writeFieldBegin(PORT_FIELD_DESC);
- oprot.writeI32(struct.port);
- oprot.writeFieldEnd();
- if (struct.crcSums != null) {
- oprot.writeFieldBegin(CRC_SUMS_FIELD_DESC);
- {
- oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.crcSums.size()));
- for (int _iter11 : struct.crcSums)
- {
- oprot.writeI32(_iter11);
- }
- oprot.writeListEnd();
- }
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class DownloadDataTupleSchemeFactory implements SchemeFactory {
- public DownloadDataTupleScheme getScheme() {
- return new DownloadDataTupleScheme();
- }
- }
-
- private static class DownloadDataTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, DownloadData struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetToken()) {
- optionals.set(0);
- }
- if (struct.isSetPort()) {
- optionals.set(1);
- }
- if (struct.isSetCrcSums()) {
- optionals.set(2);
- }
- oprot.writeBitSet(optionals, 3);
- if (struct.isSetToken()) {
- oprot.writeString(struct.token);
- }
- if (struct.isSetPort()) {
- oprot.writeI32(struct.port);
- }
- if (struct.isSetCrcSums()) {
- {
- oprot.writeI32(struct.crcSums.size());
- for (int _iter12 : struct.crcSums)
- {
- oprot.writeI32(_iter12);
- }
- }
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, DownloadData struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(3);
- if (incoming.get(0)) {
- struct.token = iprot.readString();
- struct.setTokenIsSet(true);
- }
- if (incoming.get(1)) {
- struct.port = iprot.readI32();
- struct.setPortIsSet(true);
- }
- if (incoming.get(2)) {
- {
- org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32());
- struct.crcSums = new ArrayList(_list13.size);
- for (int _i14 = 0; _i14 < _list13.size; ++_i14)
- {
- int _elem15;
- _elem15 = iprot.readI32();
- struct.crcSums.add(_elem15);
- }
- }
- struct.setCrcSumsIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadException.java b/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadException.java
deleted file mode 100644
index 46404b9..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/DownloadException.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/**
- * 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 DownloadException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DownloadException");
-
- private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new DownloadExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new DownloadExceptionTupleSchemeFactory());
- }
-
- /**
- *
- * @see UploadError
- */
- public UploadError number; // required
- public String message; // 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 {
- /**
- *
- * @see UploadError
- */
- NUMBER((short)1, "number"),
- MESSAGE((short)2, "message");
-
- private static final Map byName = new HashMap();
-
- 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: // NUMBER
- return NUMBER;
- case 2: // MESSAGE
- return MESSAGE;
- 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, UploadError.class)));
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(DownloadException.class, metaDataMap);
- }
-
- public DownloadException() {
- }
-
- public DownloadException(
- UploadError number,
- String message)
- {
- this();
- this.number = number;
- this.message = message;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public DownloadException(DownloadException other) {
- if (other.isSetNumber()) {
- this.number = other.number;
- }
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public DownloadException deepCopy() {
- return new DownloadException(this);
- }
-
- @Override
- public void clear() {
- this.number = null;
- this.message = null;
- }
-
- /**
- *
- * @see UploadError
- */
- public UploadError getNumber() {
- return this.number;
- }
-
- /**
- *
- * @see UploadError
- */
- public DownloadException setNumber(UploadError number) {
- this.number = number;
- return this;
- }
-
- public void unsetNumber() {
- this.number = null;
- }
-
- /** Returns true if field number is set (has been assigned a value) and false otherwise */
- public boolean isSetNumber() {
- return this.number != null;
- }
-
- public void setNumberIsSet(boolean value) {
- if (!value) {
- this.number = null;
- }
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public DownloadException setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUMBER:
- if (value == null) {
- unsetNumber();
- } else {
- setNumber((UploadError)value);
- }
- break;
-
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUMBER:
- return getNumber();
-
- case MESSAGE:
- return getMessage();
-
- }
- 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 NUMBER:
- return isSetNumber();
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof DownloadException)
- return this.equals((DownloadException)that);
- return false;
- }
-
- public boolean equals(DownloadException that) {
- if (that == null)
- return false;
-
- boolean this_present_number = true && this.isSetNumber();
- boolean that_present_number = true && that.isSetNumber();
- if (this_present_number || that_present_number) {
- if (!(this_present_number && that_present_number))
- return false;
- if (!this.number.equals(that.number))
- return false;
- }
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(DownloadException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetNumber()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
- 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("DownloadException(");
- boolean first = true;
-
- sb.append("number:");
- if (this.number == null) {
- sb.append("null");
- } else {
- sb.append(this.number);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- 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 DownloadExceptionStandardSchemeFactory implements SchemeFactory {
- public DownloadExceptionStandardScheme getScheme() {
- return new DownloadExceptionStandardScheme();
- }
- }
-
- private static class DownloadExceptionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, DownloadException 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: // NUMBER
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.number = UploadError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(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, DownloadException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.number != null) {
- oprot.writeFieldBegin(NUMBER_FIELD_DESC);
- oprot.writeI32(struct.number.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class DownloadExceptionTupleSchemeFactory implements SchemeFactory {
- public DownloadExceptionTupleScheme getScheme() {
- return new DownloadExceptionTupleScheme();
- }
- }
-
- private static class DownloadExceptionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, DownloadException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetNumber()) {
- optionals.set(0);
- }
- if (struct.isSetMessage()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetNumber()) {
- oprot.writeI32(struct.number.getValue());
- }
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, DownloadException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.number = UploadError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- }
- if (incoming.get(1)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java
deleted file mode 100644
index aeeb15b..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageData.java
+++ /dev/null
@@ -1,1350 +0,0 @@
-/**
- * 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 ImageData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImageData");
-
- private static final org.apache.thrift.protocol.TField UUID_FIELD_DESC = new org.apache.thrift.protocol.TField("uuid", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField REVISION_FIELD_DESC = new org.apache.thrift.protocol.TField("revision", org.apache.thrift.protocol.TType.I32, (short)2);
- private static final org.apache.thrift.protocol.TField TITLE_FIELD_DESC = new org.apache.thrift.protocol.TField("title", org.apache.thrift.protocol.TType.STRING, (short)3);
- private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I64, (short)4);
- private static final org.apache.thrift.protocol.TField UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("updateTime", org.apache.thrift.protocol.TType.I64, (short)5);
- private static final org.apache.thrift.protocol.TField OWNER_LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerLogin", org.apache.thrift.protocol.TType.STRING, (short)6);
- private static final org.apache.thrift.protocol.TField OPERATING_SYSTEM_FIELD_DESC = new org.apache.thrift.protocol.TField("operatingSystem", org.apache.thrift.protocol.TType.I32, (short)7);
- private static final org.apache.thrift.protocol.TField IS_VALID_FIELD_DESC = new org.apache.thrift.protocol.TField("isValid", org.apache.thrift.protocol.TType.BOOL, (short)8);
- private static final org.apache.thrift.protocol.TField IS_DELETED_FIELD_DESC = new org.apache.thrift.protocol.TField("isDeleted", org.apache.thrift.protocol.TType.BOOL, (short)9);
- private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)11);
- private static final org.apache.thrift.protocol.TField FILE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("fileSize", org.apache.thrift.protocol.TType.I64, (short)12);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ImageDataStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ImageDataTupleSchemeFactory());
- }
-
- public String uuid; // required
- public int revision; // required
- public String title; // required
- public long createTime; // required
- public long updateTime; // required
- public String ownerLogin; // required
- public int operatingSystem; // required
- public boolean isValid; // required
- public boolean isDeleted; // required
- public String description; // required
- public long fileSize; // 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 {
- UUID((short)1, "uuid"),
- REVISION((short)2, "revision"),
- TITLE((short)3, "title"),
- CREATE_TIME((short)4, "createTime"),
- UPDATE_TIME((short)5, "updateTime"),
- OWNER_LOGIN((short)6, "ownerLogin"),
- OPERATING_SYSTEM((short)7, "operatingSystem"),
- IS_VALID((short)8, "isValid"),
- IS_DELETED((short)9, "isDeleted"),
- DESCRIPTION((short)11, "description"),
- FILE_SIZE((short)12, "fileSize");
-
- private static final Map byName = new HashMap();
-
- 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: // UUID
- return UUID;
- case 2: // REVISION
- return REVISION;
- case 3: // TITLE
- return TITLE;
- case 4: // CREATE_TIME
- return CREATE_TIME;
- case 5: // UPDATE_TIME
- return UPDATE_TIME;
- case 6: // OWNER_LOGIN
- return OWNER_LOGIN;
- case 7: // OPERATING_SYSTEM
- return OPERATING_SYSTEM;
- case 8: // IS_VALID
- return IS_VALID;
- case 9: // IS_DELETED
- return IS_DELETED;
- case 11: // DESCRIPTION
- return DESCRIPTION;
- case 12: // FILE_SIZE
- return FILE_SIZE;
- 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 __REVISION_ISSET_ID = 0;
- private static final int __CREATETIME_ISSET_ID = 1;
- private static final int __UPDATETIME_ISSET_ID = 2;
- private static final int __OPERATINGSYSTEM_ISSET_ID = 3;
- private static final int __ISVALID_ISSET_ID = 4;
- private static final int __ISDELETED_ISSET_ID = 5;
- private static final int __FILESIZE_ISSET_ID = 6;
- 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.UUID, new org.apache.thrift.meta_data.FieldMetaData("uuid", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID")));
- tmpMap.put(_Fields.REVISION, new org.apache.thrift.meta_data.FieldMetaData("revision", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.TITLE, new org.apache.thrift.meta_data.FieldMetaData("title", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.CREATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("createTime", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp")));
- tmpMap.put(_Fields.UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("updateTime", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp")));
- tmpMap.put(_Fields.OWNER_LOGIN, new org.apache.thrift.meta_data.FieldMetaData("ownerLogin", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.OPERATING_SYSTEM, new org.apache.thrift.meta_data.FieldMetaData("operatingSystem", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- tmpMap.put(_Fields.IS_VALID, new org.apache.thrift.meta_data.FieldMetaData("isValid", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.IS_DELETED, new org.apache.thrift.meta_data.FieldMetaData("isDeleted", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
- tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.FILE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("fileSize", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ImageData.class, metaDataMap);
- }
-
- public ImageData() {
- }
-
- public ImageData(
- String uuid,
- int revision,
- String title,
- long createTime,
- long updateTime,
- String ownerLogin,
- int operatingSystem,
- boolean isValid,
- boolean isDeleted,
- String description,
- long fileSize)
- {
- this();
- this.uuid = uuid;
- this.revision = revision;
- setRevisionIsSet(true);
- this.title = title;
- this.createTime = createTime;
- setCreateTimeIsSet(true);
- this.updateTime = updateTime;
- setUpdateTimeIsSet(true);
- this.ownerLogin = ownerLogin;
- this.operatingSystem = operatingSystem;
- setOperatingSystemIsSet(true);
- this.isValid = isValid;
- setIsValidIsSet(true);
- this.isDeleted = isDeleted;
- setIsDeletedIsSet(true);
- this.description = description;
- this.fileSize = fileSize;
- setFileSizeIsSet(true);
- }
-
- /**
- * Performs a deep copy on other.
- */
- public ImageData(ImageData other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.isSetUuid()) {
- this.uuid = other.uuid;
- }
- this.revision = other.revision;
- if (other.isSetTitle()) {
- this.title = other.title;
- }
- this.createTime = other.createTime;
- this.updateTime = other.updateTime;
- if (other.isSetOwnerLogin()) {
- this.ownerLogin = other.ownerLogin;
- }
- this.operatingSystem = other.operatingSystem;
- this.isValid = other.isValid;
- this.isDeleted = other.isDeleted;
- if (other.isSetDescription()) {
- this.description = other.description;
- }
- this.fileSize = other.fileSize;
- }
-
- public ImageData deepCopy() {
- return new ImageData(this);
- }
-
- @Override
- public void clear() {
- this.uuid = null;
- setRevisionIsSet(false);
- this.revision = 0;
- this.title = null;
- setCreateTimeIsSet(false);
- this.createTime = 0;
- setUpdateTimeIsSet(false);
- this.updateTime = 0;
- this.ownerLogin = null;
- setOperatingSystemIsSet(false);
- this.operatingSystem = 0;
- setIsValidIsSet(false);
- this.isValid = false;
- setIsDeletedIsSet(false);
- this.isDeleted = false;
- this.description = null;
- setFileSizeIsSet(false);
- this.fileSize = 0;
- }
-
- public String getUuid() {
- return this.uuid;
- }
-
- public ImageData setUuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public void unsetUuid() {
- this.uuid = null;
- }
-
- /** Returns true if field uuid is set (has been assigned a value) and false otherwise */
- public boolean isSetUuid() {
- return this.uuid != null;
- }
-
- public void setUuidIsSet(boolean value) {
- if (!value) {
- this.uuid = null;
- }
- }
-
- public int getRevision() {
- return this.revision;
- }
-
- public ImageData setRevision(int revision) {
- this.revision = revision;
- setRevisionIsSet(true);
- return this;
- }
-
- public void unsetRevision() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REVISION_ISSET_ID);
- }
-
- /** Returns true if field revision is set (has been assigned a value) and false otherwise */
- public boolean isSetRevision() {
- return EncodingUtils.testBit(__isset_bitfield, __REVISION_ISSET_ID);
- }
-
- public void setRevisionIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REVISION_ISSET_ID, value);
- }
-
- public String getTitle() {
- return this.title;
- }
-
- public ImageData setTitle(String title) {
- this.title = title;
- return this;
- }
-
- public void unsetTitle() {
- this.title = null;
- }
-
- /** Returns true if field title is set (has been assigned a value) and false otherwise */
- public boolean isSetTitle() {
- return this.title != null;
- }
-
- public void setTitleIsSet(boolean value) {
- if (!value) {
- this.title = null;
- }
- }
-
- public long getCreateTime() {
- return this.createTime;
- }
-
- public ImageData setCreateTime(long createTime) {
- this.createTime = createTime;
- setCreateTimeIsSet(true);
- return this;
- }
-
- public void unsetCreateTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- /** Returns true if field createTime is set (has been assigned a value) and false otherwise */
- public boolean isSetCreateTime() {
- return EncodingUtils.testBit(__isset_bitfield, __CREATETIME_ISSET_ID);
- }
-
- public void setCreateTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATETIME_ISSET_ID, value);
- }
-
- public long getUpdateTime() {
- return this.updateTime;
- }
-
- public ImageData setUpdateTime(long updateTime) {
- this.updateTime = updateTime;
- setUpdateTimeIsSet(true);
- return this;
- }
-
- public void unsetUpdateTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPDATETIME_ISSET_ID);
- }
-
- /** Returns true if field updateTime is set (has been assigned a value) and false otherwise */
- public boolean isSetUpdateTime() {
- return EncodingUtils.testBit(__isset_bitfield, __UPDATETIME_ISSET_ID);
- }
-
- public void setUpdateTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPDATETIME_ISSET_ID, value);
- }
-
- public String getOwnerLogin() {
- return this.ownerLogin;
- }
-
- public ImageData setOwnerLogin(String ownerLogin) {
- this.ownerLogin = ownerLogin;
- return this;
- }
-
- public void unsetOwnerLogin() {
- this.ownerLogin = null;
- }
-
- /** Returns true if field ownerLogin is set (has been assigned a value) and false otherwise */
- public boolean isSetOwnerLogin() {
- return this.ownerLogin != null;
- }
-
- public void setOwnerLoginIsSet(boolean value) {
- if (!value) {
- this.ownerLogin = null;
- }
- }
-
- public int getOperatingSystem() {
- return this.operatingSystem;
- }
-
- public ImageData setOperatingSystem(int operatingSystem) {
- this.operatingSystem = operatingSystem;
- setOperatingSystemIsSet(true);
- return this;
- }
-
- public void unsetOperatingSystem() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATINGSYSTEM_ISSET_ID);
- }
-
- /** Returns true if field operatingSystem is set (has been assigned a value) and false otherwise */
- public boolean isSetOperatingSystem() {
- return EncodingUtils.testBit(__isset_bitfield, __OPERATINGSYSTEM_ISSET_ID);
- }
-
- public void setOperatingSystemIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATINGSYSTEM_ISSET_ID, value);
- }
-
- public boolean isIsValid() {
- return this.isValid;
- }
-
- public ImageData setIsValid(boolean isValid) {
- this.isValid = isValid;
- setIsValidIsSet(true);
- return this;
- }
-
- public void unsetIsValid() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISVALID_ISSET_ID);
- }
-
- /** Returns true if field isValid is set (has been assigned a value) and false otherwise */
- public boolean isSetIsValid() {
- return EncodingUtils.testBit(__isset_bitfield, __ISVALID_ISSET_ID);
- }
-
- public void setIsValidIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISVALID_ISSET_ID, value);
- }
-
- public boolean isIsDeleted() {
- return this.isDeleted;
- }
-
- public ImageData setIsDeleted(boolean isDeleted) {
- this.isDeleted = isDeleted;
- setIsDeletedIsSet(true);
- return this;
- }
-
- public void unsetIsDeleted() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISDELETED_ISSET_ID);
- }
-
- /** Returns true if field isDeleted is set (has been assigned a value) and false otherwise */
- public boolean isSetIsDeleted() {
- return EncodingUtils.testBit(__isset_bitfield, __ISDELETED_ISSET_ID);
- }
-
- public void setIsDeletedIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISDELETED_ISSET_ID, value);
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public ImageData setDescription(String description) {
- this.description = description;
- return this;
- }
-
- public void unsetDescription() {
- this.description = null;
- }
-
- /** Returns true if field description is set (has been assigned a value) and false otherwise */
- public boolean isSetDescription() {
- return this.description != null;
- }
-
- public void setDescriptionIsSet(boolean value) {
- if (!value) {
- this.description = null;
- }
- }
-
- public long getFileSize() {
- return this.fileSize;
- }
-
- public ImageData setFileSize(long fileSize) {
- this.fileSize = fileSize;
- setFileSizeIsSet(true);
- return this;
- }
-
- public void unsetFileSize() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILESIZE_ISSET_ID);
- }
-
- /** Returns true if field fileSize is set (has been assigned a value) and false otherwise */
- public boolean isSetFileSize() {
- return EncodingUtils.testBit(__isset_bitfield, __FILESIZE_ISSET_ID);
- }
-
- public void setFileSizeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILESIZE_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case UUID:
- if (value == null) {
- unsetUuid();
- } else {
- setUuid((String)value);
- }
- break;
-
- case REVISION:
- if (value == null) {
- unsetRevision();
- } else {
- setRevision((Integer)value);
- }
- break;
-
- case TITLE:
- if (value == null) {
- unsetTitle();
- } else {
- setTitle((String)value);
- }
- break;
-
- case CREATE_TIME:
- if (value == null) {
- unsetCreateTime();
- } else {
- setCreateTime((Long)value);
- }
- break;
-
- case UPDATE_TIME:
- if (value == null) {
- unsetUpdateTime();
- } else {
- setUpdateTime((Long)value);
- }
- break;
-
- case OWNER_LOGIN:
- if (value == null) {
- unsetOwnerLogin();
- } else {
- setOwnerLogin((String)value);
- }
- break;
-
- case OPERATING_SYSTEM:
- if (value == null) {
- unsetOperatingSystem();
- } else {
- setOperatingSystem((Integer)value);
- }
- break;
-
- case IS_VALID:
- if (value == null) {
- unsetIsValid();
- } else {
- setIsValid((Boolean)value);
- }
- break;
-
- case IS_DELETED:
- if (value == null) {
- unsetIsDeleted();
- } else {
- setIsDeleted((Boolean)value);
- }
- break;
-
- case DESCRIPTION:
- if (value == null) {
- unsetDescription();
- } else {
- setDescription((String)value);
- }
- break;
-
- case FILE_SIZE:
- if (value == null) {
- unsetFileSize();
- } else {
- setFileSize((Long)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case UUID:
- return getUuid();
-
- case REVISION:
- return Integer.valueOf(getRevision());
-
- case TITLE:
- return getTitle();
-
- case CREATE_TIME:
- return Long.valueOf(getCreateTime());
-
- case UPDATE_TIME:
- return Long.valueOf(getUpdateTime());
-
- case OWNER_LOGIN:
- return getOwnerLogin();
-
- case OPERATING_SYSTEM:
- return Integer.valueOf(getOperatingSystem());
-
- case IS_VALID:
- return Boolean.valueOf(isIsValid());
-
- case IS_DELETED:
- return Boolean.valueOf(isIsDeleted());
-
- case DESCRIPTION:
- return getDescription();
-
- case FILE_SIZE:
- return Long.valueOf(getFileSize());
-
- }
- 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 UUID:
- return isSetUuid();
- case REVISION:
- return isSetRevision();
- case TITLE:
- return isSetTitle();
- case CREATE_TIME:
- return isSetCreateTime();
- case UPDATE_TIME:
- return isSetUpdateTime();
- case OWNER_LOGIN:
- return isSetOwnerLogin();
- case OPERATING_SYSTEM:
- return isSetOperatingSystem();
- case IS_VALID:
- return isSetIsValid();
- case IS_DELETED:
- return isSetIsDeleted();
- case DESCRIPTION:
- return isSetDescription();
- case FILE_SIZE:
- return isSetFileSize();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ImageData)
- return this.equals((ImageData)that);
- return false;
- }
-
- public boolean equals(ImageData that) {
- if (that == null)
- return false;
-
- boolean this_present_uuid = true && this.isSetUuid();
- boolean that_present_uuid = true && that.isSetUuid();
- if (this_present_uuid || that_present_uuid) {
- if (!(this_present_uuid && that_present_uuid))
- return false;
- if (!this.uuid.equals(that.uuid))
- return false;
- }
-
- boolean this_present_revision = true;
- boolean that_present_revision = true;
- if (this_present_revision || that_present_revision) {
- if (!(this_present_revision && that_present_revision))
- return false;
- if (this.revision != that.revision)
- return false;
- }
-
- boolean this_present_title = true && this.isSetTitle();
- boolean that_present_title = true && that.isSetTitle();
- if (this_present_title || that_present_title) {
- if (!(this_present_title && that_present_title))
- return false;
- if (!this.title.equals(that.title))
- return false;
- }
-
- boolean this_present_createTime = true;
- boolean that_present_createTime = true;
- if (this_present_createTime || that_present_createTime) {
- if (!(this_present_createTime && that_present_createTime))
- return false;
- if (this.createTime != that.createTime)
- return false;
- }
-
- boolean this_present_updateTime = true;
- boolean that_present_updateTime = true;
- if (this_present_updateTime || that_present_updateTime) {
- if (!(this_present_updateTime && that_present_updateTime))
- return false;
- if (this.updateTime != that.updateTime)
- return false;
- }
-
- boolean this_present_ownerLogin = true && this.isSetOwnerLogin();
- boolean that_present_ownerLogin = true && that.isSetOwnerLogin();
- if (this_present_ownerLogin || that_present_ownerLogin) {
- if (!(this_present_ownerLogin && that_present_ownerLogin))
- return false;
- if (!this.ownerLogin.equals(that.ownerLogin))
- return false;
- }
-
- boolean this_present_operatingSystem = true;
- boolean that_present_operatingSystem = true;
- if (this_present_operatingSystem || that_present_operatingSystem) {
- if (!(this_present_operatingSystem && that_present_operatingSystem))
- return false;
- if (this.operatingSystem != that.operatingSystem)
- return false;
- }
-
- boolean this_present_isValid = true;
- boolean that_present_isValid = true;
- if (this_present_isValid || that_present_isValid) {
- if (!(this_present_isValid && that_present_isValid))
- return false;
- if (this.isValid != that.isValid)
- return false;
- }
-
- boolean this_present_isDeleted = true;
- boolean that_present_isDeleted = true;
- if (this_present_isDeleted || that_present_isDeleted) {
- if (!(this_present_isDeleted && that_present_isDeleted))
- return false;
- if (this.isDeleted != that.isDeleted)
- return false;
- }
-
- boolean this_present_description = true && this.isSetDescription();
- boolean that_present_description = true && that.isSetDescription();
- if (this_present_description || that_present_description) {
- if (!(this_present_description && that_present_description))
- return false;
- if (!this.description.equals(that.description))
- return false;
- }
-
- boolean this_present_fileSize = true;
- boolean that_present_fileSize = true;
- if (this_present_fileSize || that_present_fileSize) {
- if (!(this_present_fileSize && that_present_fileSize))
- return false;
- if (this.fileSize != that.fileSize)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(ImageData other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetUuid()).compareTo(other.isSetUuid());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUuid()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uuid, other.uuid);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetRevision()).compareTo(other.isSetRevision());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetRevision()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.revision, other.revision);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetTitle()).compareTo(other.isSetTitle());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetTitle()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, other.title);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetCreateTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetUpdateTime()).compareTo(other.isSetUpdateTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUpdateTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateTime, other.updateTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetOwnerLogin()).compareTo(other.isSetOwnerLogin());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetOwnerLogin()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ownerLogin, other.ownerLogin);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetOperatingSystem()).compareTo(other.isSetOperatingSystem());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetOperatingSystem()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operatingSystem, other.operatingSystem);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetIsValid()).compareTo(other.isSetIsValid());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetIsValid()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isValid, other.isValid);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetIsDeleted()).compareTo(other.isSetIsDeleted());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetIsDeleted()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isDeleted, other.isDeleted);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetDescription()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetFileSize()).compareTo(other.isSetFileSize());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetFileSize()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileSize, other.fileSize);
- 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("ImageData(");
- boolean first = true;
-
- sb.append("uuid:");
- if (this.uuid == null) {
- sb.append("null");
- } else {
- sb.append(this.uuid);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("revision:");
- sb.append(this.revision);
- first = false;
- if (!first) sb.append(", ");
- sb.append("title:");
- if (this.title == null) {
- sb.append("null");
- } else {
- sb.append(this.title);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("createTime:");
- sb.append(this.createTime);
- first = false;
- if (!first) sb.append(", ");
- sb.append("updateTime:");
- sb.append(this.updateTime);
- first = false;
- if (!first) sb.append(", ");
- sb.append("ownerLogin:");
- if (this.ownerLogin == null) {
- sb.append("null");
- } else {
- sb.append(this.ownerLogin);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("operatingSystem:");
- sb.append(this.operatingSystem);
- first = false;
- if (!first) sb.append(", ");
- sb.append("isValid:");
- sb.append(this.isValid);
- first = false;
- if (!first) sb.append(", ");
- sb.append("isDeleted:");
- sb.append(this.isDeleted);
- first = false;
- if (!first) sb.append(", ");
- sb.append("description:");
- if (this.description == null) {
- sb.append("null");
- } else {
- sb.append(this.description);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("fileSize:");
- sb.append(this.fileSize);
- 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 ImageDataStandardSchemeFactory implements SchemeFactory {
- public ImageDataStandardScheme getScheme() {
- return new ImageDataStandardScheme();
- }
- }
-
- private static class ImageDataStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ImageData 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: // UUID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.uuid = iprot.readString();
- struct.setUuidIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // REVISION
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.revision = iprot.readI32();
- struct.setRevisionIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // TITLE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.title = iprot.readString();
- struct.setTitleIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // CREATE_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.createTime = iprot.readI64();
- struct.setCreateTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // UPDATE_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.updateTime = iprot.readI64();
- struct.setUpdateTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // OWNER_LOGIN
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.ownerLogin = iprot.readString();
- struct.setOwnerLoginIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // OPERATING_SYSTEM
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.operatingSystem = iprot.readI32();
- struct.setOperatingSystemIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 8: // IS_VALID
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.isValid = iprot.readBool();
- struct.setIsValidIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 9: // IS_DELETED
- if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
- struct.isDeleted = iprot.readBool();
- struct.setIsDeletedIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 11: // DESCRIPTION
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.description = iprot.readString();
- struct.setDescriptionIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 12: // FILE_SIZE
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.fileSize = iprot.readI64();
- struct.setFileSizeIsSet(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, ImageData struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.uuid != null) {
- oprot.writeFieldBegin(UUID_FIELD_DESC);
- oprot.writeString(struct.uuid);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(REVISION_FIELD_DESC);
- oprot.writeI32(struct.revision);
- oprot.writeFieldEnd();
- if (struct.title != null) {
- oprot.writeFieldBegin(TITLE_FIELD_DESC);
- oprot.writeString(struct.title);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
- oprot.writeI64(struct.createTime);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(UPDATE_TIME_FIELD_DESC);
- oprot.writeI64(struct.updateTime);
- oprot.writeFieldEnd();
- if (struct.ownerLogin != null) {
- oprot.writeFieldBegin(OWNER_LOGIN_FIELD_DESC);
- oprot.writeString(struct.ownerLogin);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(OPERATING_SYSTEM_FIELD_DESC);
- oprot.writeI32(struct.operatingSystem);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(IS_VALID_FIELD_DESC);
- oprot.writeBool(struct.isValid);
- oprot.writeFieldEnd();
- oprot.writeFieldBegin(IS_DELETED_FIELD_DESC);
- oprot.writeBool(struct.isDeleted);
- oprot.writeFieldEnd();
- if (struct.description != null) {
- oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
- oprot.writeString(struct.description);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldBegin(FILE_SIZE_FIELD_DESC);
- oprot.writeI64(struct.fileSize);
- oprot.writeFieldEnd();
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ImageDataTupleSchemeFactory implements SchemeFactory {
- public ImageDataTupleScheme getScheme() {
- return new ImageDataTupleScheme();
- }
- }
-
- private static class ImageDataTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ImageData struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetUuid()) {
- optionals.set(0);
- }
- if (struct.isSetRevision()) {
- optionals.set(1);
- }
- if (struct.isSetTitle()) {
- optionals.set(2);
- }
- if (struct.isSetCreateTime()) {
- optionals.set(3);
- }
- if (struct.isSetUpdateTime()) {
- optionals.set(4);
- }
- if (struct.isSetOwnerLogin()) {
- optionals.set(5);
- }
- if (struct.isSetOperatingSystem()) {
- optionals.set(6);
- }
- if (struct.isSetIsValid()) {
- optionals.set(7);
- }
- if (struct.isSetIsDeleted()) {
- optionals.set(8);
- }
- if (struct.isSetDescription()) {
- optionals.set(9);
- }
- if (struct.isSetFileSize()) {
- optionals.set(10);
- }
- oprot.writeBitSet(optionals, 11);
- if (struct.isSetUuid()) {
- oprot.writeString(struct.uuid);
- }
- if (struct.isSetRevision()) {
- oprot.writeI32(struct.revision);
- }
- if (struct.isSetTitle()) {
- oprot.writeString(struct.title);
- }
- if (struct.isSetCreateTime()) {
- oprot.writeI64(struct.createTime);
- }
- if (struct.isSetUpdateTime()) {
- oprot.writeI64(struct.updateTime);
- }
- if (struct.isSetOwnerLogin()) {
- oprot.writeString(struct.ownerLogin);
- }
- if (struct.isSetOperatingSystem()) {
- oprot.writeI32(struct.operatingSystem);
- }
- if (struct.isSetIsValid()) {
- oprot.writeBool(struct.isValid);
- }
- if (struct.isSetIsDeleted()) {
- oprot.writeBool(struct.isDeleted);
- }
- if (struct.isSetDescription()) {
- oprot.writeString(struct.description);
- }
- if (struct.isSetFileSize()) {
- oprot.writeI64(struct.fileSize);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ImageData struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(11);
- if (incoming.get(0)) {
- struct.uuid = iprot.readString();
- struct.setUuidIsSet(true);
- }
- if (incoming.get(1)) {
- struct.revision = iprot.readI32();
- struct.setRevisionIsSet(true);
- }
- if (incoming.get(2)) {
- struct.title = iprot.readString();
- struct.setTitleIsSet(true);
- }
- if (incoming.get(3)) {
- struct.createTime = iprot.readI64();
- struct.setCreateTimeIsSet(true);
- }
- if (incoming.get(4)) {
- struct.updateTime = iprot.readI64();
- struct.setUpdateTimeIsSet(true);
- }
- if (incoming.get(5)) {
- struct.ownerLogin = iprot.readString();
- struct.setOwnerLoginIsSet(true);
- }
- if (incoming.get(6)) {
- struct.operatingSystem = iprot.readI32();
- struct.setOperatingSystemIsSet(true);
- }
- if (incoming.get(7)) {
- struct.isValid = iprot.readBool();
- struct.setIsValidIsSet(true);
- }
- if (incoming.get(8)) {
- struct.isDeleted = iprot.readBool();
- struct.setIsDeletedIsSet(true);
- }
- if (incoming.get(9)) {
- struct.description = iprot.readString();
- struct.setDescriptionIsSet(true);
- }
- if (incoming.get(10)) {
- struct.fileSize = iprot.readI64();
- struct.setFileSizeIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataError.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataError.java
deleted file mode 100644
index fdd7b81..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataError.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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 java.util.Map;
-import java.util.HashMap;
-import org.apache.thrift.TEnum;
-
-public enum ImageDataError implements org.apache.thrift.TEnum {
- INVALID_DATA(0),
- UNKNOWN_IMAGE(1);
-
- private final int value;
-
- private ImageDataError(int value) {
- this.value = value;
- }
-
- /**
- * Get the integer value of this enum value, as defined in the Thrift IDL.
- */
- public int getValue() {
- return value;
- }
-
- /**
- * Find a the enum type by its integer value, as defined in the Thrift IDL.
- * @return null if the value is not found.
- */
- public static ImageDataError findByValue(int value) {
- switch (value) {
- case 0:
- return INVALID_DATA;
- case 1:
- return UNKNOWN_IMAGE;
- default:
- return null;
- }
- }
-}
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataException.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataException.java
deleted file mode 100644
index a5ac923..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageDataException.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/**
- * 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 ImageDataException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImageDataException");
-
- private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (short)1);
- private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new ImageDataExceptionStandardSchemeFactory());
- schemes.put(TupleScheme.class, new ImageDataExceptionTupleSchemeFactory());
- }
-
- /**
- *
- * @see ImageDataError
- */
- public ImageDataError number; // required
- public String message; // 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 {
- /**
- *
- * @see ImageDataError
- */
- NUMBER((short)1, "number"),
- MESSAGE((short)2, "message");
-
- private static final Map byName = new HashMap();
-
- 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: // NUMBER
- return NUMBER;
- case 2: // MESSAGE
- return MESSAGE;
- 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ImageDataError.class)));
- tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(ImageDataException.class, metaDataMap);
- }
-
- public ImageDataException() {
- }
-
- public ImageDataException(
- ImageDataError number,
- String message)
- {
- this();
- this.number = number;
- this.message = message;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public ImageDataException(ImageDataException other) {
- if (other.isSetNumber()) {
- this.number = other.number;
- }
- if (other.isSetMessage()) {
- this.message = other.message;
- }
- }
-
- public ImageDataException deepCopy() {
- return new ImageDataException(this);
- }
-
- @Override
- public void clear() {
- this.number = null;
- this.message = null;
- }
-
- /**
- *
- * @see ImageDataError
- */
- public ImageDataError getNumber() {
- return this.number;
- }
-
- /**
- *
- * @see ImageDataError
- */
- public ImageDataException setNumber(ImageDataError number) {
- this.number = number;
- return this;
- }
-
- public void unsetNumber() {
- this.number = null;
- }
-
- /** Returns true if field number is set (has been assigned a value) and false otherwise */
- public boolean isSetNumber() {
- return this.number != null;
- }
-
- public void setNumberIsSet(boolean value) {
- if (!value) {
- this.number = null;
- }
- }
-
- public String getMessage() {
- return this.message;
- }
-
- public ImageDataException setMessage(String message) {
- this.message = message;
- return this;
- }
-
- public void unsetMessage() {
- this.message = null;
- }
-
- /** Returns true if field message is set (has been assigned a value) and false otherwise */
- public boolean isSetMessage() {
- return this.message != null;
- }
-
- public void setMessageIsSet(boolean value) {
- if (!value) {
- this.message = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case NUMBER:
- if (value == null) {
- unsetNumber();
- } else {
- setNumber((ImageDataError)value);
- }
- break;
-
- case MESSAGE:
- if (value == null) {
- unsetMessage();
- } else {
- setMessage((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case NUMBER:
- return getNumber();
-
- case MESSAGE:
- return getMessage();
-
- }
- 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 NUMBER:
- return isSetNumber();
- case MESSAGE:
- return isSetMessage();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ImageDataException)
- return this.equals((ImageDataException)that);
- return false;
- }
-
- public boolean equals(ImageDataException that) {
- if (that == null)
- return false;
-
- boolean this_present_number = true && this.isSetNumber();
- boolean that_present_number = true && that.isSetNumber();
- if (this_present_number || that_present_number) {
- if (!(this_present_number && that_present_number))
- return false;
- if (!this.number.equals(that.number))
- return false;
- }
-
- boolean this_present_message = true && this.isSetMessage();
- boolean that_present_message = true && that.isSetMessage();
- if (this_present_message || that_present_message) {
- if (!(this_present_message && that_present_message))
- return false;
- if (!this.message.equals(that.message))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(ImageDataException other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetNumber()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetMessage()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
- 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("ImageDataException(");
- boolean first = true;
-
- sb.append("number:");
- if (this.number == null) {
- sb.append("null");
- } else {
- sb.append(this.number);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("message:");
- if (this.message == null) {
- sb.append("null");
- } else {
- sb.append(this.message);
- }
- 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 ImageDataExceptionStandardSchemeFactory implements SchemeFactory {
- public ImageDataExceptionStandardScheme getScheme() {
- return new ImageDataExceptionStandardScheme();
- }
- }
-
- private static class ImageDataExceptionStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, ImageDataException 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: // NUMBER
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.number = ImageDataError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // MESSAGE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(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, ImageDataException struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.number != null) {
- oprot.writeFieldBegin(NUMBER_FIELD_DESC);
- oprot.writeI32(struct.number.getValue());
- oprot.writeFieldEnd();
- }
- if (struct.message != null) {
- oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
- oprot.writeString(struct.message);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class ImageDataExceptionTupleSchemeFactory implements SchemeFactory {
- public ImageDataExceptionTupleScheme getScheme() {
- return new ImageDataExceptionTupleScheme();
- }
- }
-
- private static class ImageDataExceptionTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, ImageDataException struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetNumber()) {
- optionals.set(0);
- }
- if (struct.isSetMessage()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetNumber()) {
- oprot.writeI32(struct.number.getValue());
- }
- if (struct.isSetMessage()) {
- oprot.writeString(struct.message);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, ImageDataException struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.number = ImageDataError.findByValue(iprot.readI32());
- struct.setNumberIsSet(true);
- }
- if (incoming.get(1)) {
- struct.message = iprot.readString();
- struct.setMessageIsSet(true);
- }
- }
- }
-
-}
-
diff --git a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java b/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java
deleted file mode 100644
index 82ff930..0000000
--- a/src/main/java/org/openslx/imagemaster/thrift/iface/ImageServer.java
+++ /dev/null
@@ -1,15606 +0,0 @@
-/**
- * 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 login, String password) throws AuthenticationException, org.apache.thrift.TException;
-
- public List getOrganizations() throws org.apache.thrift.TException;
-
- public List findUser(String sessionId, String organizationId, String searchTerm) throws AuthorizationException, org.apache.thrift.TException;
-
- public List getPublicImages(String sessionId, int page) throws AuthorizationException, org.apache.thrift.TException;
-
- public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException;
-
- public boolean isServerAuthenticated(String serverSessionId) throws org.apache.thrift.TException;
-
- public ByteBuffer startServerAuthentication(String organization) throws AuthenticationException, org.apache.thrift.TException;
-
- public ServerSessionData serverAuthenticate(String organizationId, ByteBuffer challengeResponse) throws AuthenticationException, org.apache.thrift.TException;
-
- public UploadData submitImage(String serverSessionId, ImageData imageDescription, List crcSums) throws AuthorizationException, ImageDataException, UploadException, org.apache.thrift.TException;
-
- public DownloadData getImage(String serverSessionId, String uuid) throws AuthorizationException, ImageDataException, org.apache.thrift.TException;
-
- public boolean publishUser(String serverSessionId, UserInfo user) throws AuthorizationException, org.apache.thrift.TException;
-
- public boolean registerSatellite(String organizationId, String address, String modulus, String exponent) throws org.apache.thrift.TException;
-
- public boolean updateSatelliteAddress(String serverSessionId, String address) throws org.apache.thrift.TException;
-
- public ServerSessionData addSession(String localPassword, UserInfo userInfo) throws 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 login, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getOrganizations(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void findUser(String sessionId, String organizationId, String searchTerm, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getPublicImages(String sessionId, int page, 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 isServerAuthenticated(String serverSessionId, 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 organizationId, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void submitImage(String serverSessionId, ImageData imageDescription, List crcSums, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getImage(String serverSessionId, String uuid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void publishUser(String serverSessionId, UserInfo user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void registerSatellite(String organizationId, String address, String modulus, String exponent, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void updateSatelliteAddress(String serverSessionId, String address, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void addSession(String localPassword, UserInfo userInfo, 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 {
- 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 login, String password) throws AuthenticationException, org.apache.thrift.TException
- {
- send_authenticate(login, password);
- return recv_authenticate();
- }
-
- public void send_authenticate(String login, String password) throws org.apache.thrift.TException
- {
- authenticate_args args = new authenticate_args();
- args.setLogin(login);
- 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 List getOrganizations() throws org.apache.thrift.TException
- {
- send_getOrganizations();
- return recv_getOrganizations();
- }
-
- public void send_getOrganizations() throws org.apache.thrift.TException
- {
- getOrganizations_args args = new getOrganizations_args();
- sendBase("getOrganizations", args);
- }
-
- public List recv_getOrganizations() throws org.apache.thrift.TException
- {
- getOrganizations_result result = new getOrganizations_result();
- receiveBase(result, "getOrganizations");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOrganizations failed: unknown result");
- }
-
- public List findUser(String sessionId, String organizationId, String searchTerm) throws AuthorizationException, org.apache.thrift.TException
- {
- send_findUser(sessionId, organizationId, searchTerm);
- return recv_findUser();
- }
-
- public void send_findUser(String sessionId, String organizationId, String searchTerm) throws org.apache.thrift.TException
- {
- findUser_args args = new findUser_args();
- args.setSessionId(sessionId);
- args.setOrganizationId(organizationId);
- args.setSearchTerm(searchTerm);
- sendBase("findUser", args);
- }
-
- public List recv_findUser() throws AuthorizationException, org.apache.thrift.TException
- {
- findUser_result result = new findUser_result();
- receiveBase(result, "findUser");
- 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, "findUser failed: unknown result");
- }
-
- public List getPublicImages(String sessionId, int page) throws AuthorizationException, org.apache.thrift.TException
- {
- send_getPublicImages(sessionId, page);
- return recv_getPublicImages();
- }
-
- public void send_getPublicImages(String sessionId, int page) throws org.apache.thrift.TException
- {
- getPublicImages_args args = new getPublicImages_args();
- args.setSessionId(sessionId);
- args.setPage(page);
- sendBase("getPublicImages", args);
- }
-
- public List recv_getPublicImages() throws AuthorizationException, org.apache.thrift.TException
- {
- getPublicImages_result result = new getPublicImages_result();
- receiveBase(result, "getPublicImages");
- 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, "getPublicImages 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 boolean isServerAuthenticated(String serverSessionId) throws org.apache.thrift.TException
- {
- send_isServerAuthenticated(serverSessionId);
- return recv_isServerAuthenticated();
- }
-
- public void send_isServerAuthenticated(String serverSessionId) throws org.apache.thrift.TException
- {
- isServerAuthenticated_args args = new isServerAuthenticated_args();
- args.setServerSessionId(serverSessionId);
- sendBase("isServerAuthenticated", args);
- }
-
- public boolean recv_isServerAuthenticated() throws org.apache.thrift.TException
- {
- isServerAuthenticated_result result = new isServerAuthenticated_result();
- receiveBase(result, "isServerAuthenticated");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "isServerAuthenticated failed: unknown result");
- }
-
- public ByteBuffer startServerAuthentication(String organization) throws AuthenticationException, 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 ByteBuffer recv_startServerAuthentication() throws AuthenticationException, 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 organizationId, ByteBuffer challengeResponse) throws AuthenticationException, org.apache.thrift.TException
- {
- send_serverAuthenticate(organizationId, challengeResponse);
- return recv_serverAuthenticate();
- }
-
- public void send_serverAuthenticate(String organizationId, ByteBuffer challengeResponse) throws org.apache.thrift.TException
- {
- serverAuthenticate_args args = new serverAuthenticate_args();
- args.setOrganizationId(organizationId);
- args.setChallengeResponse(challengeResponse);
- sendBase("serverAuthenticate", args);
- }
-
- public ServerSessionData recv_serverAuthenticate() throws AuthenticationException, 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 UploadData submitImage(String serverSessionId, ImageData imageDescription, List crcSums) throws AuthorizationException, ImageDataException, UploadException, org.apache.thrift.TException
- {
- send_submitImage(serverSessionId, imageDescription, crcSums);
- return recv_submitImage();
- }
-
- public void send_submitImage(String serverSessionId, ImageData imageDescription, List crcSums) throws org.apache.thrift.TException
- {
- submitImage_args args = new submitImage_args();
- args.setServerSessionId(serverSessionId);
- args.setImageDescription(imageDescription);
- args.setCrcSums(crcSums);
- sendBase("submitImage", args);
- }
-
- public UploadData recv_submitImage() throws AuthorizationException, ImageDataException, UploadException, 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;
- }
- if (result.failure3 != null) {
- throw result.failure3;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "submitImage failed: unknown result");
- }
-
- public DownloadData getImage(String serverSessionId, String uuid) throws AuthorizationException, ImageDataException, org.apache.thrift.TException
- {
- send_getImage(serverSessionId, uuid);
- return recv_getImage();
- }
-
- public void send_getImage(String serverSessionId, String uuid) throws org.apache.thrift.TException
- {
- getImage_args args = new getImage_args();
- args.setServerSessionId(serverSessionId);
- args.setUuid(uuid);
- sendBase("getImage", args);
- }
-
- public DownloadData recv_getImage() throws AuthorizationException, ImageDataException, org.apache.thrift.TException
- {
- getImage_result result = new getImage_result();
- receiveBase(result, "getImage");
- 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, "getImage failed: unknown result");
- }
-
- public boolean publishUser(String serverSessionId, UserInfo user) throws AuthorizationException, org.apache.thrift.TException
- {
- send_publishUser(serverSessionId, user);
- return recv_publishUser();
- }
-
- public void send_publishUser(String serverSessionId, UserInfo user) throws org.apache.thrift.TException
- {
- publishUser_args args = new publishUser_args();
- args.setServerSessionId(serverSessionId);
- args.setUser(user);
- sendBase("publishUser", args);
- }
-
- public boolean recv_publishUser() throws AuthorizationException, org.apache.thrift.TException
- {
- publishUser_result result = new publishUser_result();
- receiveBase(result, "publishUser");
- 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, "publishUser failed: unknown result");
- }
-
- public boolean registerSatellite(String organizationId, String address, String modulus, String exponent) throws org.apache.thrift.TException
- {
- send_registerSatellite(organizationId, address, modulus, exponent);
- return recv_registerSatellite();
- }
-
- public void send_registerSatellite(String organizationId, String address, String modulus, String exponent) throws org.apache.thrift.TException
- {
- registerSatellite_args args = new registerSatellite_args();
- args.setOrganizationId(organizationId);
- args.setAddress(address);
- args.setModulus(modulus);
- args.setExponent(exponent);
- sendBase("registerSatellite", args);
- }
-
- public boolean recv_registerSatellite() throws org.apache.thrift.TException
- {
- registerSatellite_result result = new registerSatellite_result();
- receiveBase(result, "registerSatellite");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "registerSatellite failed: unknown result");
- }
-
- public boolean updateSatelliteAddress(String serverSessionId, String address) throws org.apache.thrift.TException
- {
- send_updateSatelliteAddress(serverSessionId, address);
- return recv_updateSatelliteAddress();
- }
-
- public void send_updateSatelliteAddress(String serverSessionId, String address) throws org.apache.thrift.TException
- {
- updateSatelliteAddress_args args = new updateSatelliteAddress_args();
- args.setServerSessionId(serverSessionId);
- args.setAddress(address);
- sendBase("updateSatelliteAddress", args);
- }
-
- public boolean recv_updateSatelliteAddress() throws org.apache.thrift.TException
- {
- updateSatelliteAddress_result result = new updateSatelliteAddress_result();
- receiveBase(result, "updateSatelliteAddress");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateSatelliteAddress failed: unknown result");
- }
-
- public ServerSessionData addSession(String localPassword, UserInfo userInfo) throws org.apache.thrift.TException
- {
- send_addSession(localPassword, userInfo);
- return recv_addSession();
- }
-
- public void send_addSession(String localPassword, UserInfo userInfo) throws org.apache.thrift.TException
- {
- addSession_args args = new addSession_args();
- args.setLocalPassword(localPassword);
- args.setUserInfo(userInfo);
- sendBase("addSession", args);
- }
-
- public ServerSessionData recv_addSession() throws org.apache.thrift.TException
- {
- addSession_result result = new addSession_result();
- receiveBase(result, "addSession");
- if (result.isSetSuccess()) {
- return result.success;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addSession 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 {
- 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 login, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- authenticate_call method_call = new authenticate_call(login, 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 login;
- private String password;
- public authenticate_call(String login, 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.login = login;
- 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.setLogin(login);
- 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 getOrganizations(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getOrganizations_call method_call = new getOrganizations_call(resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getOrganizations_call extends org.apache.thrift.async.TAsyncMethodCall {
- public getOrganizations_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("getOrganizations", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getOrganizations_args args = new getOrganizations_args();
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List 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_getOrganizations();
- }
- }
-
- public void findUser(String sessionId, String organizationId, String searchTerm, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- findUser_call method_call = new findUser_call(sessionId, organizationId, searchTerm, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class findUser_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String sessionId;
- private String organizationId;
- private String searchTerm;
- public findUser_call(String sessionId, String organizationId, String searchTerm, 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.sessionId = sessionId;
- this.organizationId = organizationId;
- this.searchTerm = searchTerm;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("findUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
- findUser_args args = new findUser_args();
- args.setSessionId(sessionId);
- args.setOrganizationId(organizationId);
- args.setSearchTerm(searchTerm);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List getResult() throws AuthorizationException, 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_findUser();
- }
- }
-
- public void getPublicImages(String sessionId, int page, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getPublicImages_call method_call = new getPublicImages_call(sessionId, page, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getPublicImages_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String sessionId;
- private int page;
- public getPublicImages_call(String sessionId, int page, 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.sessionId = sessionId;
- this.page = page;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getPublicImages", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getPublicImages_args args = new getPublicImages_args();
- args.setSessionId(sessionId);
- args.setPage(page);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public List getResult() throws AuthorizationException, 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_getPublicImages();
- }
- }
-
- 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 isServerAuthenticated(String serverSessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- isServerAuthenticated_call method_call = new isServerAuthenticated_call(serverSessionId, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class isServerAuthenticated_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String serverSessionId;
- public isServerAuthenticated_call(String serverSessionId, 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;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("isServerAuthenticated", org.apache.thrift.protocol.TMessageType.CALL, 0));
- isServerAuthenticated_args args = new isServerAuthenticated_args();
- args.setServerSessionId(serverSessionId);
- 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_isServerAuthenticated();
- }
- }
-
- 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 ByteBuffer 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_startServerAuthentication();
- }
- }
-
- public void serverAuthenticate(String organizationId, ByteBuffer challengeResponse, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- serverAuthenticate_call method_call = new serverAuthenticate_call(organizationId, 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 organizationId;
- private ByteBuffer challengeResponse;
- public serverAuthenticate_call(String organizationId, 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.organizationId = organizationId;
- 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.setOrganizationId(organizationId);
- args.setChallengeResponse(challengeResponse);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public ServerSessionData 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_serverAuthenticate();
- }
- }
-
- public void submitImage(String serverSessionId, ImageData imageDescription, List crcSums, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- submitImage_call method_call = new submitImage_call(serverSessionId, imageDescription, crcSums, 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;
- private List crcSums;
- public submitImage_call(String serverSessionId, ImageData imageDescription, List crcSums, 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;
- this.crcSums = crcSums;
- }
-
- 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.setCrcSums(crcSums);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public UploadData getResult() throws AuthorizationException, ImageDataException, UploadException, 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 getImage(String serverSessionId, String uuid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getImage_call method_call = new getImage_call(serverSessionId, uuid, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getImage_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String serverSessionId;
- private String uuid;
- public getImage_call(String serverSessionId, String uuid, 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.uuid = uuid;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getImage", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getImage_args args = new getImage_args();
- args.setServerSessionId(serverSessionId);
- args.setUuid(uuid);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public DownloadData 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_getImage();
- }
- }
-
- public void publishUser(String serverSessionId, UserInfo user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- publishUser_call method_call = new publishUser_call(serverSessionId, user, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class publishUser_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String serverSessionId;
- private UserInfo user;
- public publishUser_call(String serverSessionId, UserInfo user, 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.user = user;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("publishUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
- publishUser_args args = new publishUser_args();
- args.setServerSessionId(serverSessionId);
- args.setUser(user);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public boolean getResult() throws AuthorizationException, 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_publishUser();
- }
- }
-
- public void registerSatellite(String organizationId, String address, String modulus, String exponent, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- registerSatellite_call method_call = new registerSatellite_call(organizationId, address, modulus, exponent, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class registerSatellite_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String organizationId;
- private String address;
- private String modulus;
- private String exponent;
- public registerSatellite_call(String organizationId, String address, String modulus, String exponent, 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.organizationId = organizationId;
- this.address = address;
- this.modulus = modulus;
- this.exponent = exponent;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerSatellite", org.apache.thrift.protocol.TMessageType.CALL, 0));
- registerSatellite_args args = new registerSatellite_args();
- args.setOrganizationId(organizationId);
- args.setAddress(address);
- args.setModulus(modulus);
- args.setExponent(exponent);
- 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_registerSatellite();
- }
- }
-
- public void updateSatelliteAddress(String serverSessionId, String address, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- updateSatelliteAddress_call method_call = new updateSatelliteAddress_call(serverSessionId, address, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class updateSatelliteAddress_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String serverSessionId;
- private String address;
- public updateSatelliteAddress_call(String serverSessionId, String address, 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.address = address;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateSatelliteAddress", org.apache.thrift.protocol.TMessageType.CALL, 0));
- updateSatelliteAddress_args args = new updateSatelliteAddress_args();
- args.setServerSessionId(serverSessionId);
- args.setAddress(address);
- 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_updateSatelliteAddress();
- }
- }
-
- public void addSession(String localPassword, UserInfo userInfo, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- addSession_call method_call = new addSession_call(localPassword, userInfo, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class addSession_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String localPassword;
- private UserInfo userInfo;
- public addSession_call(String localPassword, UserInfo userInfo, 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.localPassword = localPassword;
- this.userInfo = userInfo;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addSession", org.apache.thrift.protocol.TMessageType.CALL, 0));
- addSession_args args = new addSession_args();
- args.setLocalPassword(localPassword);
- args.setUserInfo(userInfo);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public ServerSessionData 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_addSession();
- }
- }
-
- }
-
- public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
- public Processor(I iface) {
- super(iface, getProcessMap(new HashMap>()));
- }
-
- protected Processor(I iface, Map> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static Map> getProcessMap(Map> processMap) {
- processMap.put("ping", new ping());
- processMap.put("authenticate", new authenticate());
- processMap.put("getOrganizations", new getOrganizations());
- processMap.put("findUser", new findUser());
- processMap.put("getPublicImages", new getPublicImages());
- processMap.put("getUserFromToken", new getUserFromToken());
- processMap.put("isServerAuthenticated", new isServerAuthenticated());
- processMap.put("startServerAuthentication", new startServerAuthentication());
- processMap.put("serverAuthenticate", new serverAuthenticate());
- processMap.put("submitImage", new submitImage());
- processMap.put("getImage", new getImage());
- processMap.put("publishUser", new publishUser());
- processMap.put("registerSatellite", new registerSatellite());
- processMap.put("updateSatelliteAddress", new updateSatelliteAddress());
- processMap.put("addSession", new addSession());
- return processMap;
- }
-
- public static class ping extends org.apache.thrift.ProcessFunction {
- 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 extends org.apache.thrift.ProcessFunction {
- 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.login, args.password);
- } catch (AuthenticationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class getOrganizations extends org.apache.thrift.ProcessFunction {
- public getOrganizations() {
- super("getOrganizations");
- }
-
- public getOrganizations_args getEmptyArgsInstance() {
- return new getOrganizations_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getOrganizations_result getResult(I iface, getOrganizations_args args) throws org.apache.thrift.TException {
- getOrganizations_result result = new getOrganizations_result();
- result.success = iface.getOrganizations();
- return result;
- }
- }
-
- public static class findUser extends org.apache.thrift.ProcessFunction {
- public findUser() {
- super("findUser");
- }
-
- public findUser_args getEmptyArgsInstance() {
- return new findUser_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public findUser_result getResult(I iface, findUser_args args) throws org.apache.thrift.TException {
- findUser_result result = new findUser_result();
- try {
- result.success = iface.findUser(args.sessionId, args.organizationId, args.searchTerm);
- } catch (AuthorizationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class getPublicImages extends org.apache.thrift.ProcessFunction {
- public getPublicImages() {
- super("getPublicImages");
- }
-
- public getPublicImages_args getEmptyArgsInstance() {
- return new getPublicImages_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getPublicImages_result getResult(I iface, getPublicImages_args args) throws org.apache.thrift.TException {
- getPublicImages_result result = new getPublicImages_result();
- try {
- result.success = iface.getPublicImages(args.sessionId, args.page);
- } catch (AuthorizationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class getUserFromToken extends org.apache.thrift.ProcessFunction {
- 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 isServerAuthenticated extends org.apache.thrift.ProcessFunction {
- public isServerAuthenticated() {
- super("isServerAuthenticated");
- }
-
- public isServerAuthenticated_args getEmptyArgsInstance() {
- return new isServerAuthenticated_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public isServerAuthenticated_result getResult(I iface, isServerAuthenticated_args args) throws org.apache.thrift.TException {
- isServerAuthenticated_result result = new isServerAuthenticated_result();
- result.success = iface.isServerAuthenticated(args.serverSessionId);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- public static class startServerAuthentication extends org.apache.thrift.ProcessFunction {
- 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 (AuthenticationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class serverAuthenticate extends org.apache.thrift.ProcessFunction {
- 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.organizationId, args.challengeResponse);
- } catch (AuthenticationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class submitImage extends org.apache.thrift.ProcessFunction {
- 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, args.crcSums);
- } catch (AuthorizationException failure) {
- result.failure = failure;
- } catch (ImageDataException failure2) {
- result.failure2 = failure2;
- } catch (UploadException failure3) {
- result.failure3 = failure3;
- }
- return result;
- }
- }
-
- public static class getImage extends org.apache.thrift.ProcessFunction {
- public getImage() {
- super("getImage");
- }
-
- public getImage_args getEmptyArgsInstance() {
- return new getImage_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getImage_result getResult(I iface, getImage_args args) throws org.apache.thrift.TException {
- getImage_result result = new getImage_result();
- try {
- result.success = iface.getImage(args.serverSessionId, args.uuid);
- } catch (AuthorizationException failure) {
- result.failure = failure;
- } catch (ImageDataException failure2) {
- result.failure2 = failure2;
- }
- return result;
- }
- }
-
- public static class publishUser extends org.apache.thrift.ProcessFunction {
- public publishUser() {
- super("publishUser");
- }
-
- public publishUser_args getEmptyArgsInstance() {
- return new publishUser_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public publishUser_result getResult(I iface, publishUser_args args) throws org.apache.thrift.TException {
- publishUser_result result = new publishUser_result();
- try {
- result.success = iface.publishUser(args.serverSessionId, args.user);
- result.setSuccessIsSet(true);
- } catch (AuthorizationException failure) {
- result.failure = failure;
- }
- return result;
- }
- }
-
- public static class registerSatellite extends org.apache.thrift.ProcessFunction {
- public registerSatellite() {
- super("registerSatellite");
- }
-
- public registerSatellite_args getEmptyArgsInstance() {
- return new registerSatellite_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public registerSatellite_result getResult(I iface, registerSatellite_args args) throws org.apache.thrift.TException {
- registerSatellite_result result = new registerSatellite_result();
- result.success = iface.registerSatellite(args.organizationId, args.address, args.modulus, args.exponent);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- public static class updateSatelliteAddress extends org.apache.thrift.ProcessFunction {
- public updateSatelliteAddress() {
- super("updateSatelliteAddress");
- }
-
- public updateSatelliteAddress_args getEmptyArgsInstance() {
- return new updateSatelliteAddress_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public updateSatelliteAddress_result getResult(I iface, updateSatelliteAddress_args args) throws org.apache.thrift.TException {
- updateSatelliteAddress_result result = new updateSatelliteAddress_result();
- result.success = iface.updateSatelliteAddress(args.serverSessionId, args.address);
- result.setSuccessIsSet(true);
- return result;
- }
- }
-
- public static class addSession extends org.apache.thrift.ProcessFunction {
- public addSession() {
- super("addSession");
- }
-
- public addSession_args getEmptyArgsInstance() {
- return new addSession_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public addSession_result getResult(I iface, addSession_args args) throws org.apache.thrift.TException {
- addSession_result result = new addSession_result();
- result.success = iface.addSession(args.localPassword, args.userInfo);
- return result;
- }
- }
-
- }
-
- public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
- private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
- public AsyncProcessor(I iface) {
- super(iface, getProcessMap(new HashMap>()));
- }
-
- protected AsyncProcessor(I iface, Map> processMap) {
- super(iface, getProcessMap(processMap));
- }
-
- private static Map> getProcessMap(Map> processMap) {
- processMap.put("ping", new ping());
- processMap.put("authenticate", new authenticate());
- processMap.put("getOrganizations", new getOrganizations());
- processMap.put("findUser", new findUser());
- processMap.put("getPublicImages", new getPublicImages());
- processMap.put("getUserFromToken", new getUserFromToken());
- processMap.put("isServerAuthenticated", new isServerAuthenticated());
- processMap.put("startServerAuthentication", new startServerAuthentication());
- processMap.put("serverAuthenticate", new serverAuthenticate());
- processMap.put("submitImage", new submitImage());
- processMap.put("getImage", new getImage());
- processMap.put("publishUser", new publishUser());
- processMap.put("registerSatellite", new registerSatellite());
- processMap.put("updateSatelliteAddress", new updateSatelliteAddress());
- processMap.put("addSession", new addSession());
- return processMap;
- }
-
- public static class ping extends org.apache.thrift.AsyncProcessFunction {
- public ping() {
- super("ping");
- }
-
- public ping_args getEmptyArgsInstance() {
- return new ping_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- 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 resultHandler) throws TException {
- iface.ping(resultHandler);
- }
- }
-
- public static class authenticate extends org.apache.thrift.AsyncProcessFunction {
- public authenticate() {
- super("authenticate");
- }
-
- public authenticate_args getEmptyArgsInstance() {
- return new authenticate_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- 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 resultHandler) throws TException {
- iface.authenticate(args.login, args.password,resultHandler);
- }
- }
-
- public static class getOrganizations extends org.apache.thrift.AsyncProcessFunction> {
- public getOrganizations() {
- super("getOrganizations");
- }
-
- public getOrganizations_args getEmptyArgsInstance() {
- return new getOrganizations_args();
- }
-
- public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback>() {
- public void onComplete(List o) {
- getOrganizations_result result = new getOrganizations_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;
- getOrganizations_result result = new getOrganizations_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, getOrganizations_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
- iface.getOrganizations(resultHandler);
- }
- }
-
- public static class findUser extends org.apache.thrift.AsyncProcessFunction> {
- public findUser() {
- super("findUser");
- }
-
- public findUser_args getEmptyArgsInstance() {
- return new findUser_args();
- }
-
- public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback>() {
- public void onComplete(List o) {
- findUser_result result = new findUser_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;
- findUser_result result = new findUser_result();
- if (e instanceof AuthorizationException) {
- result.failure = (AuthorizationException) 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, findUser_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
- iface.findUser(args.sessionId, args.organizationId, args.searchTerm,resultHandler);
- }
- }
-
- public static class getPublicImages extends org.apache.thrift.AsyncProcessFunction> {
- public getPublicImages() {
- super("getPublicImages");
- }
-
- public getPublicImages_args getEmptyArgsInstance() {
- return new getPublicImages_args();
- }
-
- public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback>() {
- public void onComplete(List o) {
- getPublicImages_result result = new getPublicImages_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;
- getPublicImages_result result = new getPublicImages_result();
- if (e instanceof AuthorizationException) {
- result.failure = (AuthorizationException) 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, getPublicImages_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
- iface.getPublicImages(args.sessionId, args.page,resultHandler);
- }
- }
-
- public static class getUserFromToken extends org.apache.thrift.AsyncProcessFunction {
- public getUserFromToken() {
- super("getUserFromToken");
- }
-
- public getUserFromToken_args getEmptyArgsInstance() {
- return new getUserFromToken_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- 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 resultHandler) throws TException {
- iface.getUserFromToken(args.token,resultHandler);
- }
- }
-
- public static class isServerAuthenticated extends org.apache.thrift.AsyncProcessFunction {
- public isServerAuthenticated() {
- super("isServerAuthenticated");
- }
-
- public isServerAuthenticated_args getEmptyArgsInstance() {
- return new isServerAuthenticated_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(Boolean o) {
- isServerAuthenticated_result result = new isServerAuthenticated_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;
- isServerAuthenticated_result result = new isServerAuthenticated_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, isServerAuthenticated_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.isServerAuthenticated(args.serverSessionId,resultHandler);
- }
- }
-
- public static class startServerAuthentication extends org.apache.thrift.AsyncProcessFunction {
- public startServerAuthentication() {
- super("startServerAuthentication");
- }
-
- public startServerAuthentication_args getEmptyArgsInstance() {
- return new startServerAuthentication_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(ByteBuffer 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 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, startServerAuthentication_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.startServerAuthentication(args.organization,resultHandler);
- }
- }
-
- public static class serverAuthenticate extends org.apache.thrift.AsyncProcessFunction {
- public serverAuthenticate() {
- super("serverAuthenticate");
- }
-
- public serverAuthenticate_args getEmptyArgsInstance() {
- return new serverAuthenticate_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- 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 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, serverAuthenticate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.serverAuthenticate(args.organizationId, args.challengeResponse,resultHandler);
- }
- }
-
- public static class submitImage extends org.apache.thrift.AsyncProcessFunction {
- public submitImage() {
- super("submitImage");
- }
-
- public submitImage_args getEmptyArgsInstance() {
- return new submitImage_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(UploadData 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 if (e instanceof UploadException) {
- result.failure3 = (UploadException) e;
- result.setFailure3IsSet(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 resultHandler) throws TException {
- iface.submitImage(args.serverSessionId, args.imageDescription, args.crcSums,resultHandler);
- }
- }
-
- public static class getImage extends org.apache.thrift.AsyncProcessFunction {
- public getImage() {
- super("getImage");
- }
-
- public getImage_args getEmptyArgsInstance() {
- return new getImage_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(DownloadData o) {
- getImage_result result = new getImage_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;
- getImage_result result = new getImage_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, getImage_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.getImage(args.serverSessionId, args.uuid,resultHandler);
- }
- }
-
- public static class publishUser extends org.apache.thrift.AsyncProcessFunction {
- public publishUser() {
- super("publishUser");
- }
-
- public publishUser_args getEmptyArgsInstance() {
- return new publishUser_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(Boolean o) {
- publishUser_result result = new publishUser_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;
- publishUser_result result = new publishUser_result();
- if (e instanceof AuthorizationException) {
- result.failure = (AuthorizationException) 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, publishUser_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.publishUser(args.serverSessionId, args.user,resultHandler);
- }
- }
-
- public static class registerSatellite extends org.apache.thrift.AsyncProcessFunction {
- public registerSatellite() {
- super("registerSatellite");
- }
-
- public registerSatellite_args getEmptyArgsInstance() {
- return new registerSatellite_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(Boolean o) {
- registerSatellite_result result = new registerSatellite_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;
- registerSatellite_result result = new registerSatellite_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, registerSatellite_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.registerSatellite(args.organizationId, args.address, args.modulus, args.exponent,resultHandler);
- }
- }
-
- public static class updateSatelliteAddress extends org.apache.thrift.AsyncProcessFunction {
- public updateSatelliteAddress() {
- super("updateSatelliteAddress");
- }
-
- public updateSatelliteAddress_args getEmptyArgsInstance() {
- return new updateSatelliteAddress_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(Boolean o) {
- updateSatelliteAddress_result result = new updateSatelliteAddress_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;
- updateSatelliteAddress_result result = new updateSatelliteAddress_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, updateSatelliteAddress_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.updateSatelliteAddress(args.serverSessionId, args.address,resultHandler);
- }
- }
-
- public static class addSession extends org.apache.thrift.AsyncProcessFunction {
- public addSession() {
- super("addSession");
- }
-
- public addSession_args getEmptyArgsInstance() {
- return new addSession_args();
- }
-
- public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
- final org.apache.thrift.AsyncProcessFunction fcall = this;
- return new AsyncMethodCallback() {
- public void onComplete(ServerSessionData o) {
- addSession_result result = new addSession_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;
- addSession_result result = new addSession_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, addSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
- iface.addSession(args.localPassword, args.userInfo,resultHandler);
- }
- }
-
- }
-
- public static class ping_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args");
-
-
- private static final Map, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
-
- 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 other.
- */
- 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 {
-
- 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 {
-
- @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, java.io.Serializable, Cloneable, Comparable {
- 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
-
- 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 other.
- */
- 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 {
-
- 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 {
-
- @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, java.io.Serializable, Cloneable, Comparable {
- 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 LOGIN_FIELD_DESC = new org.apache.thrift.protocol.TField("login", 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, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new authenticate_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new authenticate_argsTupleSchemeFactory());
- }
-
- public String login; // 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 {
- LOGIN((short)1, "login"),
- PASSWORD((short)2, "password");
-
- private static final Map byName = new HashMap();
-
- 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: // LOGIN
- return LOGIN;
- 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.LOGIN, new org.apache.thrift.meta_data.FieldMetaData("login", 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 login,
- String password)
- {
- this();
- this.login = login;
- this.password = password;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public authenticate_args(authenticate_args other) {
- if (other.isSetLogin()) {
- this.login = other.login;
- }
- if (other.isSetPassword()) {
- this.password = other.password;
- }
- }
-
- public authenticate_args deepCopy() {
- return new authenticate_args(this);
- }
-
- @Override
- public void clear() {
- this.login = null;
- this.password = null;
- }
-
- public String getLogin() {
- return this.login;
- }
-
- public authenticate_args setLogin(String login) {
- this.login = login;
- return this;
- }
-
- public void unsetLogin() {
- this.login = null;
- }
-
- /** Returns true if field login is set (has been assigned a value) and false otherwise */
- public boolean isSetLogin() {
- return this.login != null;
- }
-
- public void setLoginIsSet(boolean value) {
- if (!value) {
- this.login = 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 LOGIN:
- if (value == null) {
- unsetLogin();
- } else {
- setLogin((String)value);
- }
- break;
-
- case PASSWORD:
- if (value == null) {
- unsetPassword();
- } else {
- setPassword((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case LOGIN:
- return getLogin();
-
- 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 LOGIN:
- return isSetLogin();
- 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_login = true && this.isSetLogin();
- boolean that_present_login = true && that.isSetLogin();
- if (this_present_login || that_present_login) {
- if (!(this_present_login && that_present_login))
- return false;
- if (!this.login.equals(that.login))
- 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(isSetLogin()).compareTo(other.isSetLogin());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetLogin()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.login, other.login);
- 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("login:");
- if (this.login == null) {
- sb.append("null");
- } else {
- sb.append(this.login);
- }
- 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 {
-
- 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: // LOGIN
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.login = iprot.readString();
- struct.setLoginIsSet(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.login != null) {
- oprot.writeFieldBegin(LOGIN_FIELD_DESC);
- oprot.writeString(struct.login);
- 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 {
-
- @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.isSetLogin()) {
- optionals.set(0);
- }
- if (struct.isSetPassword()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetLogin()) {
- oprot.writeString(struct.login);
- }
- 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.login = iprot.readString();
- struct.setLoginIsSet(true);
- }
- if (incoming.get(1)) {
- struct.password = iprot.readString();
- struct.setPasswordIsSet(true);
- }
- }
- }
-
- }
-
- public static class authenticate_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap();
-
- 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 other.
- */
- 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 {
-
- 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 {
-
- @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 getOrganizations_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrganizations_args");
-
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getOrganizations_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getOrganizations_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 byName = new HashMap();
-
- 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(getOrganizations_args.class, metaDataMap);
- }
-
- public getOrganizations_args() {
- }
-
- /**
- * Performs a deep copy on other.
- */
- public getOrganizations_args(getOrganizations_args other) {
- }
-
- public getOrganizations_args deepCopy() {
- return new getOrganizations_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 getOrganizations_args)
- return this.equals((getOrganizations_args)that);
- return false;
- }
-
- public boolean equals(getOrganizations_args that) {
- if (that == null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(getOrganizations_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("getOrganizations_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 getOrganizations_argsStandardSchemeFactory implements SchemeFactory {
- public getOrganizations_argsStandardScheme getScheme() {
- return new getOrganizations_argsStandardScheme();
- }
- }
-
- private static class getOrganizations_argsStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getOrganizations_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, getOrganizations_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getOrganizations_argsTupleSchemeFactory implements SchemeFactory {
- public getOrganizations_argsTupleScheme getScheme() {
- return new getOrganizations_argsTupleScheme();
- }
- }
-
- private static class getOrganizations_argsTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getOrganizations_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getOrganizations_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- }
- }
-
- }
-
- public static class getOrganizations_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOrganizations_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getOrganizations_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getOrganizations_resultTupleSchemeFactory());
- }
-
- public List 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 byName = new HashMap();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, OrganizationData.class))));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOrganizations_result.class, metaDataMap);
- }
-
- public getOrganizations_result() {
- }
-
- public getOrganizations_result(
- List success)
- {
- this();
- this.success = success;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public getOrganizations_result(getOrganizations_result other) {
- if (other.isSetSuccess()) {
- List __this__success = new ArrayList(other.success.size());
- for (OrganizationData other_element : other.success) {
- __this__success.add(new OrganizationData(other_element));
- }
- this.success = __this__success;
- }
- }
-
- public getOrganizations_result deepCopy() {
- return new getOrganizations_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- }
-
- public int getSuccessSize() {
- return (this.success == null) ? 0 : this.success.size();
- }
-
- public java.util.Iterator getSuccessIterator() {
- return (this.success == null) ? null : this.success.iterator();
- }
-
- public void addToSuccess(OrganizationData elem) {
- if (this.success == null) {
- this.success = new ArrayList