= 0) {
+
+ // this doesn't support showing urls in the form of
+ // "page.html#nameLink"
+ rt.exec("rundll32 url.dll,FileProtocolHandler " + otrs);
+
+ } else if (os.indexOf("Mac") >= 0) {
+
+ rt.exec("open " + otrs);
+
+ } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
+
+ // Do a best guess on unix until we get a platform independent
+ // way
+ // Build a list of browsers to try, in this order.
+ String[] browsers = { "epiphany", "firefox", "mozilla",
+ "konqueror", "netscape", "opera", "links", "lynx" };
+
+ // Build a command string which looks like
+ // "browser1 "url" || browser2 "url" ||..."
+ StringBuffer cmd = new StringBuffer();
+ for (int i = 0; i < browsers.length; i++)
+ cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
+ + otrs + "\" ");
+
+ rt.exec(new String[] { "sh", "-c", cmd.toString() });
+ }
+
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ }
+
+ public static String getUriWindows() {
+ return uriWindows;
+ }
+
+ public static String getUriLinux() {
+ return uriLinux;
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/models/SessionData.java b/Dozentenmodul/src/main/java/models/SessionData.java
new file mode 100644
index 00000000..187dc59f
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/SessionData.java
@@ -0,0 +1,30 @@
+package models;
+
+public class SessionData {
+
+ private String sessionID;
+ private String authToken;
+ private String serverAdress;
+ public static SessionData session =new SessionData();
+
+ public String getSessionID() {
+ return sessionID;
+ }
+ public void setSessionID(String sessionID) {
+ this.sessionID = sessionID;
+ }
+ public String getAuthToken() {
+ return authToken;
+ }
+ public void setAuthToken(String authToken) {
+ this.authToken = authToken;
+ }
+ public String getServerAdress() {
+ return serverAdress;
+ }
+ public void setServerAdress(String serverAdress) {
+ this.serverAdress = serverAdress;
+ }
+
+
+}
diff --git a/Dozentenmodul/src/main/java/models/person.java b/Dozentenmodul/src/main/java/models/person.java
new file mode 100644
index 00000000..6e066730
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/person.java
@@ -0,0 +1,121 @@
+package models;
+
+public class person{
+
+ private String username;
+
+ private String Name;
+
+ private String Vorname;
+
+ private String Hochschule;
+
+ private String EMail;
+
+ private String Tel;
+
+ private String Fakultaet;
+
+ private boolean ischecked;
+
+ public static person verantwortlicher=new person();
+
+
+
+ public String getUsername() {
+
+ return username;
+
+ }
+
+ public void setUsername(String username) {
+
+ this.username = username;
+
+ }
+
+ public String getName() {
+
+ return Name;
+
+ }
+
+ public void setName(String name) {
+
+ Name = name;
+
+ }
+
+ public String getVorname() {
+
+ return Vorname;
+
+ }
+
+ public void setVorname(String vorname) {
+
+ Vorname = vorname;
+
+ }
+
+ public String getHochschule() {
+
+ return Hochschule;
+
+ }
+
+ public void setHochschule(String hochschule) {
+
+ Hochschule = hochschule;
+
+ }
+
+ public String getEMail() {
+
+ return EMail;
+
+ }
+
+ public void setEMail(String eMail) {
+
+ EMail = eMail;
+
+ }
+
+ public String getTel() {
+
+ return Tel;
+
+ }
+
+ public void setTel(String tel) {
+
+ Tel = tel;
+
+ }
+
+ public String getFakultaet() {
+
+ return Fakultaet;
+
+ }
+
+ public void setFakultaet(String fakultaet) {
+
+ Fakultaet = fakultaet;
+
+ }
+
+ public boolean isIschecked() {
+
+ return ischecked;
+
+ }
+
+ public void setIschecked(boolean ischecked) {
+
+ this.ischecked = ischecked;
+
+ }
+
+}
diff --git a/Dozentenmodul/src/main/java/models/user.java b/Dozentenmodul/src/main/java/models/user.java
new file mode 100644
index 00000000..9aa958a4
--- /dev/null
+++ b/Dozentenmodul/src/main/java/models/user.java
@@ -0,0 +1,23 @@
+package models;
+
+public class user {
+
+ private String userName;
+ private String Password;
+
+ public String getUserName() {
+ return userName;
+ }
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+ public String getPassword() {
+ return Password;
+ }
+ public void setPassword(String password) {
+ Password = password;
+ }
+
+
+
+}
diff --git a/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java b/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java
new file mode 100644
index 00000000..8b6d4cc3
--- /dev/null
+++ b/Dozentenmodul/src/main/java/org/eclipse/wb/swt/SWTResourceManager.java
@@ -0,0 +1,447 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Google, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Google, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wb.swt;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
+ *
+ * !!! IMPORTANT !!! Application code must explicitly invoke the dispose()
method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ *
+ * This class may be freely distributed as part of any application or plugin.
+ *
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map m_colorMap = new HashMap();
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map m_imageMap = new HashMap();
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with '/'
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+ private static final int MISSING_IMAGE_SIZE = 10;
+ /**
+ * @return the small {@link Image} that can be used as placeholder for missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+ /**
+ * Style constant for placing decorator image in top left corner of base image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map m_fontMap = new HashMap();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map m_fontToBoldFontMap = new HashMap();
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+ /**
+ * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline
+ * flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map m_idToCursorMap = new HashMap();
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}
\ No newline at end of file
diff --git a/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java b/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java
new file mode 100644
index 00000000..11a27368
--- /dev/null
+++ b/Dozentenmodul/src/main/java/thrift/MasterThriftConnection.java
@@ -0,0 +1,46 @@
+package thrift;
+
+import javax.swing.JOptionPane;
+
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+import thrift.ImageServer.Client;
+
+
+
+public class MasterThriftConnection {
+
+ public static final String MASTERSERVERIP="132.230.4.16";
+ //public static final String MASTERSERVERIP="127.0.0.1";
+
+ final TTransport transport = new TSocket(MASTERSERVERIP, 9090);
+
+ public Client getMasterThriftConnection()
+ {
+
+ try {
+ transport.open();
+ } catch (TTransportException e) {
+ System.out.println("Keine Verbindung m\u00f6glich!");
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ return null;
+ }
+
+ final TProtocol protocol = new TBinaryProtocol(transport);
+ final Client client = new Client(protocol);
+ System.out.println("Masterserver erreichbar.");
+
+ return client;
+ }
+
+ public void closeMasterThriftConnection()
+ {
+ transport.close();
+ }
+}
diff --git a/Dozentenmodul/src/main/java/thrift/ThriftConnection.java b/Dozentenmodul/src/main/java/thrift/ThriftConnection.java
new file mode 100644
index 00000000..3eec5d25
--- /dev/null
+++ b/Dozentenmodul/src/main/java/thrift/ThriftConnection.java
@@ -0,0 +1,53 @@
+package thrift;
+
+import javax.swing.JOptionPane;
+
+import models.SessionData;
+
+import org.apache.thrift.protocol.TBinaryProtocol;
+import org.apache.thrift.protocol.TProtocol;
+import org.apache.thrift.transport.TSocket;
+import org.apache.thrift.transport.TTransport;
+import org.apache.thrift.transport.TTransportException;
+
+import server.Server;
+import server.Server.Client;
+
+public class ThriftConnection {
+
+ private String satAddress = ""+SessionData.session.getServerAdress();
+ final TTransport transport = new TSocket(satAddress, 9090);
+
+ public ThriftConnection() {
+ // TODO Auto-generated constructor stub
+ }
+
+ public Client getThriftConnection()
+ {
+
+ try {
+ transport.open();
+ } catch (TTransportException e) {
+ System.out.println("Keine Verbindung m\u00f6glich! Satellit="+satAddress);
+ e.printStackTrace();
+ JOptionPane.showMessageDialog(null,
+ e.getCause()+"\n"+e.getMessage(),
+ "Debug-Message", JOptionPane.ERROR_MESSAGE);
+ //System.out.println("Keine Verbindung moeglich! Satellit=");
+ return null;
+ }
+
+ final TProtocol protocol = new TBinaryProtocol(transport);
+
+ final Server.Client client = new Server.Client(protocol);
+ System.out.println("Verbindung zu "+satAddress+" wurde aufgebaut.");
+
+ return client;
+ }
+
+ public void closeThriftConnection()
+ {
+ System.out.println("Verbindung wird geplant getrennt...");
+ transport.close();
+ }
+}
diff --git a/Dozentenmodul/src/main/java/util/GuiOrganizer.java b/Dozentenmodul/src/main/java/util/GuiOrganizer.java
new file mode 100644
index 00000000..f03c3811
--- /dev/null
+++ b/Dozentenmodul/src/main/java/util/GuiOrganizer.java
@@ -0,0 +1,26 @@
+package util;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.Window;
+
+public abstract class GuiOrganizer {
+
+
+
+
+ /*receive GUI, set it to center of the screen*/
+ public static void centerGUI(Window gui)
+ {
+ Dimension dm = Toolkit.getDefaultToolkit().getScreenSize();
+ double width = dm.getWidth();
+ double height = dm.getHeight();
+ double xPosition = (width / 2 - gui.getWidth() / 2);
+ double yPosition = (height / 2 - gui.getHeight() / 2);
+ gui.setLocation((int) xPosition, (int) yPosition);
+ }
+
+
+
+
+}
diff --git a/Dozentenmodul/src/main/java/util/OpenLinks.java b/Dozentenmodul/src/main/java/util/OpenLinks.java
new file mode 100644
index 00000000..a3968825
--- /dev/null
+++ b/Dozentenmodul/src/main/java/util/OpenLinks.java
@@ -0,0 +1,20 @@
+package util;
+
+import java.awt.Desktop;
+import java.net.URI;
+
+public class OpenLinks {
+
+
+ public static void openWebpage(URI uri) {
+ Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
+ if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
+ try {
+ desktop.browse(uri);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }// end openWebpage
+
+}
diff --git a/Dozentenmodul/src/models/Client.java b/Dozentenmodul/src/models/Client.java
deleted file mode 100644
index 42eccdec..00000000
--- a/Dozentenmodul/src/models/Client.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package models;
-
-public class Client {
-
- private server.Server.Client client;
- public static Client clientcon=new Client();
-
- public server.Server.Client getClient() {
- return client;
- }
-
- public void setClient(server.Server.Client client) {
- this.client = client;
- }
-
-
-
-}
diff --git a/Dozentenmodul/src/models/Image.java b/Dozentenmodul/src/models/Image.java
deleted file mode 100644
index 86bc1e48..00000000
--- a/Dozentenmodul/src/models/Image.java
+++ /dev/null
@@ -1,172 +0,0 @@
-package models;
-
-public class Image {
-
-
-
- private String ImageId;
-
- private String version;
-
- private String imagename;
-
- private String newName;
-
- private String imagepath;
-
- private int shareMode;
-
- private boolean licensed;
-
- private boolean internet;
-
- private int ram;
-
- private int cpu;
-
- private long filesize;
-
- public static Image image =new Image();
-
-
-
-
-
-
-
- public int getShareMode() {
-
- return shareMode;
-
- }
-
- public void setShareMode(int shareMode) {
-
- this.shareMode = shareMode;
-
- }
-
- public String getImagepath() {
-
- return imagepath;
-
- }
-
- public void setImagepath(String imagepath) {
-
- this.imagepath = imagepath;
-
- }
-
- public String getImagename() {
-
- return imagename;
-
- }
-
- public void setImagename(String imagename) {
-
- this.imagename = imagename;
-
- }
-
- public boolean isLicensed() {
-
- return licensed;
-
- }
-
- public void setLicensed(boolean licensed) {
-
- this.licensed = licensed;
-
- }
-
- public boolean isInternet() {
-
- return internet;
-
- }
-
- public void setInternet(boolean internet) {
-
- this.internet = internet;
-
- }
-
- public int getRam() {
-
- return ram;
-
- }
-
- public void setRam(int ram) {
-
- this.ram = ram;
-
- }
-
- public int getCpu() {
-
- return cpu;
-
- }
-
- public void setCpu(int cpu) {
-
- this.cpu = cpu;
-
- }
-
- public String getNewName() {
-
- return newName;
-
- }
-
- public void setNewName(String newName) {
-
- this.newName = newName;
-
- }
-
- public String getImageId() {
-
- return ImageId;
-
- }
-
- public void setImageId(String imageId) {
-
- ImageId = imageId;
-
- }
-
- public String getVersion() {
-
- return version;
-
- }
-
- public void setVersion(String version) {
-
- this.version = version;
-
- }
-
- public long getFilesize() {
-
- return filesize;
-
- }
-
- public void setFilesize(long filesize) {
-
- this.filesize = filesize;
-
- }
-
-
-
-}
-
diff --git a/Dozentenmodul/src/models/Lecture.java b/Dozentenmodul/src/models/Lecture.java
deleted file mode 100644
index 8f67baba..00000000
--- a/Dozentenmodul/src/models/Lecture.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package models;
-
-import java.util.Date;
-
-public class Lecture {
-
- private String name;
-
- private String newName;
-
- private String shortDesc;
-
- private String desc;
-
- private Date startdate;
-
- private Date enddate;
-
- private boolean active;
-
- private String id;
-
- private String linkedImagename;
-
- public static Lecture lecture =new Lecture();
-
-
-
- public String getNewName() {
-
- return newName;
-
- }
-
- public void setNewName(String newName) {
-
- this.newName = newName;
-
- }
-
- public String getLinkedImagename() {
-
- return linkedImagename;
-
- }
-
- public void setLinkedImagename(String linkedImagename) {
-
- this.linkedImagename = linkedImagename;
-
- }
-
- public String getid() {
-
- return id;
-
- }
-
- public void setid(String id) {
-
- this.id = id;
-
- }
-
- public String getName() {
-
- return name;
-
- }
-
- public void setName(String name) {
-
- this.name = name;
-
- }
-
- public String getShortDesc() {
-
- return shortDesc;
-
- }
-
- public void setShortDesc(String shortDesc) {
-
- this.shortDesc = shortDesc;
-
- }
-
- public String getDesc() {
-
- return desc;
-
- }
-
- public void setDesc(String desc) {
-
- this.desc = desc;
-
- }
-
- public Date getStartdate() {
-
- return startdate;
-
- }
-
- public void setStartdate(Date startdate) {
-
- this.startdate = startdate;
-
- }
-
- public Date getEnddate() {
-
- return enddate;
-
- }
-
- public void setEnddate(Date enddate) {
-
- this.enddate = enddate;
-
- }
-
- public boolean isActive() {
-
- return active;
-
- }
-
- public void setActive(boolean active) {
-
- this.active = active;
-
- }
-
-
-
-
-
-}
diff --git a/Dozentenmodul/src/models/Links.java b/Dozentenmodul/src/models/Links.java
deleted file mode 100644
index 693fbb3e..00000000
--- a/Dozentenmodul/src/models/Links.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package models;
-
-import java.awt.Desktop;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-public class Links {
-
- private static String FAQ = "http://bwlehrpool.hs-offenburg.de/";
- private static String OTRS = "https://bwlehrpool-otrs.rz.hs-offenburg.de/otrs/customer.pl";
- private static String uriWindows = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
- private static String uriLinux = "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0";
-
- public static String getFAQ() {
- return FAQ;
- }
-
- public static String getOTRS() {
- return OTRS;
- }
-
- public static void openFAQ() {
-
- String faq = FAQ;
- Runtime rt = Runtime.getRuntime();
- String os = System.getProperty("os.name");
-
- try {
-
-
- if (os.indexOf( "Win" ) >= 0) {
-
- rt.exec( "rundll32 url.dll,FileProtocolHandler " + faq);
-
- } else if (os.indexOf( "Mac" ) >= 0) {
-
- rt.exec( "open " + faq);
-
- } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) {
-
- // Do a best guess on unix until we get a platform independent way
- // Build a list of browsers to try, in this order.
- String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
- "netscape","opera","links","lynx"};
-
- StringBuffer cmd = new StringBuffer();
- for (int i=0; i= 0) {
-
- // this doesn't support showing urls in the form of
- // "page.html#nameLink"
- rt.exec("rundll32 url.dll,FileProtocolHandler " + faq);
-
- } else if (os.indexOf("Mac") >= 0) {
-
- rt.exec("open " + faq);
-
- } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
-
- // Do a best guess on unix until we get a platform independent
- // way
- // Build a list of browsers to try, in this order.
- String[] browsers = { "epiphany", "firefox", "mozilla",
- "konqueror", "netscape", "opera", "links", "lynx" };
-
- // Build a command string which looks like
- // "browser1 "url" || browser2 "url" ||..."
- StringBuffer cmd = new StringBuffer();
- for (int i = 0; i < browsers.length; i++)
- cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
- + faq + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- public static void openOTRS() {
-
- String otrs = OTRS;
- Runtime rt = Runtime.getRuntime();
- String os = System.getProperty("os.name");
-
- try {
-
- if (os.indexOf( "Win" ) >= 0) {
-
- rt.exec( "rundll32 url.dll,FileProtocolHandler " + otrs);
-
- } else if (os.indexOf( "Mac" ) >= 0) {
-
- rt.exec( "open " + otrs);
-
- } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) {
-
- String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror",
- "netscape","opera","links","lynx"};
-
- StringBuffer cmd = new StringBuffer();
- for (int i=0; i= 0) {
-
- // this doesn't support showing urls in the form of
- // "page.html#nameLink"
- rt.exec("rundll32 url.dll,FileProtocolHandler " + otrs);
-
- } else if (os.indexOf("Mac") >= 0) {
-
- rt.exec("open " + otrs);
-
- } else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) {
-
- // Do a best guess on unix until we get a platform independent
- // way
- // Build a list of browsers to try, in this order.
- String[] browsers = { "epiphany", "firefox", "mozilla",
- "konqueror", "netscape", "opera", "links", "lynx" };
-
- // Build a command string which looks like
- // "browser1 "url" || browser2 "url" ||..."
- StringBuffer cmd = new StringBuffer();
- for (int i = 0; i < browsers.length; i++)
- cmd.append((i == 0 ? "" : " || ") + browsers[i] + " \""
- + otrs + "\" ");
-
- rt.exec(new String[] { "sh", "-c", cmd.toString() });
- }
-
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
-
- public static String getUriWindows() {
- return uriWindows;
- }
-
- public static String getUriLinux() {
- return uriLinux;
- }
-
-}
diff --git a/Dozentenmodul/src/models/SessionData.java b/Dozentenmodul/src/models/SessionData.java
deleted file mode 100644
index 187dc59f..00000000
--- a/Dozentenmodul/src/models/SessionData.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package models;
-
-public class SessionData {
-
- private String sessionID;
- private String authToken;
- private String serverAdress;
- public static SessionData session =new SessionData();
-
- public String getSessionID() {
- return sessionID;
- }
- public void setSessionID(String sessionID) {
- this.sessionID = sessionID;
- }
- public String getAuthToken() {
- return authToken;
- }
- public void setAuthToken(String authToken) {
- this.authToken = authToken;
- }
- public String getServerAdress() {
- return serverAdress;
- }
- public void setServerAdress(String serverAdress) {
- this.serverAdress = serverAdress;
- }
-
-
-}
diff --git a/Dozentenmodul/src/models/person.java b/Dozentenmodul/src/models/person.java
deleted file mode 100644
index 6e066730..00000000
--- a/Dozentenmodul/src/models/person.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package models;
-
-public class person{
-
- private String username;
-
- private String Name;
-
- private String Vorname;
-
- private String Hochschule;
-
- private String EMail;
-
- private String Tel;
-
- private String Fakultaet;
-
- private boolean ischecked;
-
- public static person verantwortlicher=new person();
-
-
-
- public String getUsername() {
-
- return username;
-
- }
-
- public void setUsername(String username) {
-
- this.username = username;
-
- }
-
- public String getName() {
-
- return Name;
-
- }
-
- public void setName(String name) {
-
- Name = name;
-
- }
-
- public String getVorname() {
-
- return Vorname;
-
- }
-
- public void setVorname(String vorname) {
-
- Vorname = vorname;
-
- }
-
- public String getHochschule() {
-
- return Hochschule;
-
- }
-
- public void setHochschule(String hochschule) {
-
- Hochschule = hochschule;
-
- }
-
- public String getEMail() {
-
- return EMail;
-
- }
-
- public void setEMail(String eMail) {
-
- EMail = eMail;
-
- }
-
- public String getTel() {
-
- return Tel;
-
- }
-
- public void setTel(String tel) {
-
- Tel = tel;
-
- }
-
- public String getFakultaet() {
-
- return Fakultaet;
-
- }
-
- public void setFakultaet(String fakultaet) {
-
- Fakultaet = fakultaet;
-
- }
-
- public boolean isIschecked() {
-
- return ischecked;
-
- }
-
- public void setIschecked(boolean ischecked) {
-
- this.ischecked = ischecked;
-
- }
-
-}
diff --git a/Dozentenmodul/src/models/user.java b/Dozentenmodul/src/models/user.java
deleted file mode 100644
index 9aa958a4..00000000
--- a/Dozentenmodul/src/models/user.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package models;
-
-public class user {
-
- private String userName;
- private String Password;
-
- public String getUserName() {
- return userName;
- }
- public void setUserName(String userName) {
- this.userName = userName;
- }
- public String getPassword() {
- return Password;
- }
- public void setPassword(String password) {
- Password = password;
- }
-
-
-
-}
diff --git a/Dozentenmodul/src/org/eclipse/wb/swt/SWTResourceManager.java b/Dozentenmodul/src/org/eclipse/wb/swt/SWTResourceManager.java
deleted file mode 100644
index 8b6d4cc3..00000000
--- a/Dozentenmodul/src/org/eclipse/wb/swt/SWTResourceManager.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Google, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Google, Inc. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wb.swt;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
- *
- * !!! IMPORTANT !!! Application code must explicitly invoke the dispose()
method to release the
- * operating system resources managed by cached objects when those objects and OS resources are no longer
- * needed (e.g. on application shutdown)
- *
- * This class may be freely distributed as part of any application or plugin.
- *
- * @author scheglov_ke
- * @author Dan Rubel
- */
-public class SWTResourceManager {
- ////////////////////////////////////////////////////////////////////////////
- //
- // Color
- //
- ////////////////////////////////////////////////////////////////////////////
- private static Map m_colorMap = new HashMap();
- /**
- * Returns the system {@link Color} matching the specific ID.
- *
- * @param systemColorID
- * the ID value for the color
- * @return the system {@link Color} matching the specific ID
- */
- public static Color getColor(int systemColorID) {
- Display display = Display.getCurrent();
- return display.getSystemColor(systemColorID);
- }
- /**
- * Returns a {@link Color} given its red, green and blue component values.
- *
- * @param r
- * the red component of the color
- * @param g
- * the green component of the color
- * @param b
- * the blue component of the color
- * @return the {@link Color} matching the given red, green and blue component values
- */
- public static Color getColor(int r, int g, int b) {
- return getColor(new RGB(r, g, b));
- }
- /**
- * Returns a {@link Color} given its RGB value.
- *
- * @param rgb
- * the {@link RGB} value of the color
- * @return the {@link Color} matching the RGB value
- */
- public static Color getColor(RGB rgb) {
- Color color = m_colorMap.get(rgb);
- if (color == null) {
- Display display = Display.getCurrent();
- color = new Color(display, rgb);
- m_colorMap.put(rgb, color);
- }
- return color;
- }
- /**
- * Dispose of all the cached {@link Color}'s.
- */
- public static void disposeColors() {
- for (Color color : m_colorMap.values()) {
- color.dispose();
- }
- m_colorMap.clear();
- }
- ////////////////////////////////////////////////////////////////////////////
- //
- // Image
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Maps image paths to images.
- */
- private static Map m_imageMap = new HashMap();
- /**
- * Returns an {@link Image} encoded by the specified {@link InputStream}.
- *
- * @param stream
- * the {@link InputStream} encoding the image data
- * @return the {@link Image} encoded by the specified input stream
- */
- protected static Image getImage(InputStream stream) throws IOException {
- try {
- Display display = Display.getCurrent();
- ImageData data = new ImageData(stream);
- if (data.transparentPixel > 0) {
- return new Image(display, data, data.getTransparencyMask());
- }
- return new Image(display, data);
- } finally {
- stream.close();
- }
- }
- /**
- * Returns an {@link Image} stored in the file at the specified path.
- *
- * @param path
- * the path to the image file
- * @return the {@link Image} stored in the file at the specified path
- */
- public static Image getImage(String path) {
- Image image = m_imageMap.get(path);
- if (image == null) {
- try {
- image = getImage(new FileInputStream(path));
- m_imageMap.put(path, image);
- } catch (Exception e) {
- image = getMissingImage();
- m_imageMap.put(path, image);
- }
- }
- return image;
- }
- /**
- * Returns an {@link Image} stored in the file at the specified path relative to the specified class.
- *
- * @param clazz
- * the {@link Class} relative to which to find the image
- * @param path
- * the path to the image file, if starts with '/'
- * @return the {@link Image} stored in the file at the specified path
- */
- public static Image getImage(Class> clazz, String path) {
- String key = clazz.getName() + '|' + path;
- Image image = m_imageMap.get(key);
- if (image == null) {
- try {
- image = getImage(clazz.getResourceAsStream(path));
- m_imageMap.put(key, image);
- } catch (Exception e) {
- image = getMissingImage();
- m_imageMap.put(key, image);
- }
- }
- return image;
- }
- private static final int MISSING_IMAGE_SIZE = 10;
- /**
- * @return the small {@link Image} that can be used as placeholder for missing image.
- */
- private static Image getMissingImage() {
- Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
- //
- GC gc = new GC(image);
- gc.setBackground(getColor(SWT.COLOR_RED));
- gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
- gc.dispose();
- //
- return image;
- }
- /**
- * Style constant for placing decorator image in top left corner of base image.
- */
- public static final int TOP_LEFT = 1;
- /**
- * Style constant for placing decorator image in top right corner of base image.
- */
- public static final int TOP_RIGHT = 2;
- /**
- * Style constant for placing decorator image in bottom left corner of base image.
- */
- public static final int BOTTOM_LEFT = 3;
- /**
- * Style constant for placing decorator image in bottom right corner of base image.
- */
- public static final int BOTTOM_RIGHT = 4;
- /**
- * Internal value.
- */
- protected static final int LAST_CORNER_KEY = 5;
- /**
- * Maps images to decorated images.
- */
- @SuppressWarnings("unchecked")
- private static Map>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
- /**
- * Returns an {@link Image} composed of a base image decorated by another image.
- *
- * @param baseImage
- * the base {@link Image} that should be decorated
- * @param decorator
- * the {@link Image} to decorate the base image
- * @return {@link Image} The resulting decorated image
- */
- public static Image decorateImage(Image baseImage, Image decorator) {
- return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
- }
- /**
- * Returns an {@link Image} composed of a base image decorated by another image.
- *
- * @param baseImage
- * the base {@link Image} that should be decorated
- * @param decorator
- * the {@link Image} to decorate the base image
- * @param corner
- * the corner to place decorator image
- * @return the resulting decorated {@link Image}
- */
- public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
- if (corner <= 0 || corner >= LAST_CORNER_KEY) {
- throw new IllegalArgumentException("Wrong decorate corner");
- }
- Map> cornerDecoratedImageMap = m_decoratedImageMap[corner];
- if (cornerDecoratedImageMap == null) {
- cornerDecoratedImageMap = new HashMap>();
- m_decoratedImageMap[corner] = cornerDecoratedImageMap;
- }
- Map decoratedMap = cornerDecoratedImageMap.get(baseImage);
- if (decoratedMap == null) {
- decoratedMap = new HashMap();
- cornerDecoratedImageMap.put(baseImage, decoratedMap);
- }
- //
- Image result = decoratedMap.get(decorator);
- if (result == null) {
- Rectangle bib = baseImage.getBounds();
- Rectangle dib = decorator.getBounds();
- //
- result = new Image(Display.getCurrent(), bib.width, bib.height);
- //
- GC gc = new GC(result);
- gc.drawImage(baseImage, 0, 0);
- if (corner == TOP_LEFT) {
- gc.drawImage(decorator, 0, 0);
- } else if (corner == TOP_RIGHT) {
- gc.drawImage(decorator, bib.width - dib.width, 0);
- } else if (corner == BOTTOM_LEFT) {
- gc.drawImage(decorator, 0, bib.height - dib.height);
- } else if (corner == BOTTOM_RIGHT) {
- gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
- }
- gc.dispose();
- //
- decoratedMap.put(decorator, result);
- }
- return result;
- }
- /**
- * Dispose all of the cached {@link Image}'s.
- */
- public static void disposeImages() {
- // dispose loaded images
- {
- for (Image image : m_imageMap.values()) {
- image.dispose();
- }
- m_imageMap.clear();
- }
- // dispose decorated images
- for (int i = 0; i < m_decoratedImageMap.length; i++) {
- Map> cornerDecoratedImageMap = m_decoratedImageMap[i];
- if (cornerDecoratedImageMap != null) {
- for (Map decoratedMap : cornerDecoratedImageMap.values()) {
- for (Image image : decoratedMap.values()) {
- image.dispose();
- }
- decoratedMap.clear();
- }
- cornerDecoratedImageMap.clear();
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////
- //
- // Font
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Maps font names to fonts.
- */
- private static Map m_fontMap = new HashMap();
- /**
- * Maps fonts to their bold versions.
- */
- private static Map m_fontToBoldFontMap = new HashMap();
- /**
- * Returns a {@link Font} based on its name, height and style.
- *
- * @param name
- * the name of the font
- * @param height
- * the height of the font
- * @param style
- * the style of the font
- * @return {@link Font} The font matching the name, height and style
- */
- public static Font getFont(String name, int height, int style) {
- return getFont(name, height, style, false, false);
- }
- /**
- * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline
- * flags are also supported.
- *
- * @param name
- * the name of the font
- * @param size
- * the size of the font
- * @param style
- * the style of the font
- * @param strikeout
- * the strikeout flag (warning: Windows only)
- * @param underline
- * the underline flag (warning: Windows only)
- * @return {@link Font} The font matching the name, height, style, strikeout and underline
- */
- public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
- String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
- Font font = m_fontMap.get(fontName);
- if (font == null) {
- FontData fontData = new FontData(name, size, style);
- if (strikeout || underline) {
- try {
- Class> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
- Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
- if (logFont != null && logFontClass != null) {
- if (strikeout) {
- logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
- }
- if (underline) {
- logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
- }
- }
- } catch (Throwable e) {
- System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
- font = new Font(Display.getCurrent(), fontData);
- m_fontMap.put(fontName, font);
- }
- return font;
- }
- /**
- * Returns a bold version of the given {@link Font}.
- *
- * @param baseFont
- * the {@link Font} for which a bold version is desired
- * @return the bold version of the given {@link Font}
- */
- public static Font getBoldFont(Font baseFont) {
- Font font = m_fontToBoldFontMap.get(baseFont);
- if (font == null) {
- FontData fontDatas[] = baseFont.getFontData();
- FontData data = fontDatas[0];
- font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
- m_fontToBoldFontMap.put(baseFont, font);
- }
- return font;
- }
- /**
- * Dispose all of the cached {@link Font}'s.
- */
- public static void disposeFonts() {
- // clear fonts
- for (Font font : m_fontMap.values()) {
- font.dispose();
- }
- m_fontMap.clear();
- // clear bold fonts
- for (Font font : m_fontToBoldFontMap.values()) {
- font.dispose();
- }
- m_fontToBoldFontMap.clear();
- }
- ////////////////////////////////////////////////////////////////////////////
- //
- // Cursor
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Maps IDs to cursors.
- */
- private static Map m_idToCursorMap = new HashMap();
- /**
- * Returns the system cursor matching the specific ID.
- *
- * @param id
- * int The ID value for the cursor
- * @return Cursor The system cursor matching the specific ID
- */
- public static Cursor getCursor(int id) {
- Integer key = Integer.valueOf(id);
- Cursor cursor = m_idToCursorMap.get(key);
- if (cursor == null) {
- cursor = new Cursor(Display.getDefault(), id);
- m_idToCursorMap.put(key, cursor);
- }
- return cursor;
- }
- /**
- * Dispose all of the cached cursors.
- */
- public static void disposeCursors() {
- for (Cursor cursor : m_idToCursorMap.values()) {
- cursor.dispose();
- }
- m_idToCursorMap.clear();
- }
- ////////////////////////////////////////////////////////////////////////////
- //
- // General
- //
- ////////////////////////////////////////////////////////////////////////////
- /**
- * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
- * objects are no longer needed (e.g. on application shutdown).
- */
- public static void dispose() {
- disposeColors();
- disposeImages();
- disposeFonts();
- disposeCursors();
- }
-}
\ No newline at end of file
diff --git a/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java b/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java
new file mode 100644
index 00000000..ffcdcc2e
--- /dev/null
+++ b/Dozentenmodul/src/test/java/bwlehrpool/AppTest.java
@@ -0,0 +1,38 @@
+package bwlehrpool;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
diff --git a/Dozentenmodul/src/thrift/AuthenticationError.java b/Dozentenmodul/src/thrift/AuthenticationError.java
deleted file mode 100644
index 7d543832..00000000
--- a/Dozentenmodul/src/thrift/AuthenticationError.java
+++ /dev/null
@@ -1,51 +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 thrift;
-
-
-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),
- BANNED_NETWORK(3);
-
- 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 BANNED_NETWORK;
- default:
- return null;
- }
- }
-}
diff --git a/Dozentenmodul/src/thrift/AuthenticationException.java b/Dozentenmodul/src/thrift/AuthenticationException.java
deleted file mode 100644
index d416cacf..00000000
--- a/Dozentenmodul/src/thrift/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 thrift;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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/Dozentenmodul/src/thrift/AuthorizationError.java b/Dozentenmodul/src/thrift/AuthorizationError.java
deleted file mode 100644
index 443be4f4..00000000
--- a/Dozentenmodul/src/thrift/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 thrift;
-
-
-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/Dozentenmodul/src/thrift/AuthorizationException.java b/Dozentenmodul/src/thrift/AuthorizationException.java
deleted file mode 100644
index 0d5320c2..00000000
--- a/Dozentenmodul/src/thrift/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 thrift;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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/Dozentenmodul/src/thrift/ImageServer.java b/Dozentenmodul/src/thrift/ImageServer.java
deleted file mode 100644
index 410f437b..00000000
--- a/Dozentenmodul/src/thrift/ImageServer.java
+++ /dev/null
@@ -1,2871 +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 thrift;
-
-import org.apache.thrift.scheme.IScheme;
-import org.apache.thrift.scheme.SchemeFactory;
-import org.apache.thrift.scheme.StandardScheme;
-
-import org.apache.thrift.scheme.TupleScheme;
-import org.apache.thrift.protocol.TTupleProtocol;
-import org.apache.thrift.protocol.TProtocolException;
-import org.apache.thrift.EncodingUtils;
-import org.apache.thrift.TException;
-import org.apache.thrift.async.AsyncMethodCallback;
-import org.apache.thrift.server.AbstractNonblockingServer.*;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.EnumMap;
-import java.util.Set;
-import java.util.HashSet;
-import java.util.EnumSet;
-import java.util.Collections;
-import java.util.BitSet;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ImageServer {
-
- public interface Iface {
-
- public boolean ping() throws org.apache.thrift.TException;
-
- public SessionData authenticate(String username, String password) throws AuthenticationException, org.apache.thrift.TException;
-
- public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException;
-
- }
-
- public interface AsyncIface {
-
- public void ping(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void authenticate(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
-
- }
-
- public 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 username, String password) throws AuthenticationException, org.apache.thrift.TException
- {
- send_authenticate(username, password);
- return recv_authenticate();
- }
-
- public void send_authenticate(String username, String password) throws org.apache.thrift.TException
- {
- authenticate_args args = new authenticate_args();
- args.setUsername(username);
- args.setPassword(password);
- sendBase("authenticate", args);
- }
-
- public SessionData recv_authenticate() throws AuthenticationException, org.apache.thrift.TException
- {
- authenticate_result result = new authenticate_result();
- receiveBase(result, "authenticate");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.failure != null) {
- throw result.failure;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "authenticate failed: unknown result");
- }
-
- public UserInfo getUserFromToken(String token) throws InvalidTokenException, org.apache.thrift.TException
- {
- send_getUserFromToken(token);
- return recv_getUserFromToken();
- }
-
- public void send_getUserFromToken(String token) throws org.apache.thrift.TException
- {
- getUserFromToken_args args = new getUserFromToken_args();
- args.setToken(token);
- sendBase("getUserFromToken", args);
- }
-
- public UserInfo recv_getUserFromToken() throws InvalidTokenException, org.apache.thrift.TException
- {
- getUserFromToken_result result = new getUserFromToken_result();
- receiveBase(result, "getUserFromToken");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.failure != null) {
- throw result.failure;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUserFromToken failed: unknown result");
- }
-
- }
- public 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 username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- authenticate_call method_call = new authenticate_call(username, password, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class authenticate_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String username;
- private String password;
- public authenticate_call(String username, String password, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.username = username;
- this.password = password;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("authenticate", org.apache.thrift.protocol.TMessageType.CALL, 0));
- authenticate_args args = new authenticate_args();
- args.setUsername(username);
- args.setPassword(password);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public SessionData getResult() throws AuthenticationException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_authenticate();
- }
- }
-
- public void getUserFromToken(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getUserFromToken_call method_call = new getUserFromToken_call(token, resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getUserFromToken_call extends org.apache.thrift.async.TAsyncMethodCall {
- private String token;
- public getUserFromToken_call(String token, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- this.token = token;
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUserFromToken", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getUserFromToken_args args = new getUserFromToken_args();
- args.setToken(token);
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public UserInfo getResult() throws InvalidTokenException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getUserFromToken();
- }
- }
-
- }
-
- public 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("getUserFromToken", new getUserFromToken());
- 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.username, args.password);
- } catch (AuthenticationException 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 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("getUserFromToken", new getUserFromToken());
- 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.username, args.password,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 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 USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);
-
- private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new authenticate_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new authenticate_argsTupleSchemeFactory());
- }
-
- public String username; // required
- public String password; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- USERNAME((short)1, "username"),
- PASSWORD((short)2, "password");
-
- private static final Map 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: // USERNAME
- return USERNAME;
- case 2: // PASSWORD
- return PASSWORD;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(authenticate_args.class, metaDataMap);
- }
-
- public authenticate_args() {
- }
-
- public authenticate_args(
- String username,
- String password)
- {
- this();
- this.username = username;
- this.password = password;
- }
-
- /**
- * Performs a deep copy on other.
- */
- public authenticate_args(authenticate_args other) {
- if (other.isSetUsername()) {
- this.username = other.username;
- }
- if (other.isSetPassword()) {
- this.password = other.password;
- }
- }
-
- public authenticate_args deepCopy() {
- return new authenticate_args(this);
- }
-
- @Override
- public void clear() {
- this.username = null;
- this.password = null;
- }
-
- public String getUsername() {
- return this.username;
- }
-
- public authenticate_args setUsername(String username) {
- this.username = username;
- return this;
- }
-
- public void unsetUsername() {
- this.username = null;
- }
-
- /** Returns true if field username is set (has been assigned a value) and false otherwise */
- public boolean isSetUsername() {
- return this.username != null;
- }
-
- public void setUsernameIsSet(boolean value) {
- if (!value) {
- this.username = null;
- }
- }
-
- public String getPassword() {
- return this.password;
- }
-
- public authenticate_args setPassword(String password) {
- this.password = password;
- return this;
- }
-
- public void unsetPassword() {
- this.password = null;
- }
-
- /** Returns true if field password is set (has been assigned a value) and false otherwise */
- public boolean isSetPassword() {
- return this.password != null;
- }
-
- public void setPasswordIsSet(boolean value) {
- if (!value) {
- this.password = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case USERNAME:
- if (value == null) {
- unsetUsername();
- } else {
- setUsername((String)value);
- }
- break;
-
- case PASSWORD:
- if (value == null) {
- unsetPassword();
- } else {
- setPassword((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case USERNAME:
- return getUsername();
-
- case PASSWORD:
- return getPassword();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case USERNAME:
- return isSetUsername();
- case PASSWORD:
- return isSetPassword();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof authenticate_args)
- return this.equals((authenticate_args)that);
- return false;
- }
-
- public boolean equals(authenticate_args that) {
- if (that == null)
- return false;
-
- boolean this_present_username = true && this.isSetUsername();
- boolean that_present_username = true && that.isSetUsername();
- if (this_present_username || that_present_username) {
- if (!(this_present_username && that_present_username))
- return false;
- if (!this.username.equals(that.username))
- return false;
- }
-
- boolean this_present_password = true && this.isSetPassword();
- boolean that_present_password = true && that.isSetPassword();
- if (this_present_password || that_present_password) {
- if (!(this_present_password && that_present_password))
- return false;
- if (!this.password.equals(that.password))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(authenticate_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUsername()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetPassword()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("authenticate_args(");
- boolean first = true;
-
- sb.append("username:");
- if (this.username == null) {
- sb.append("null");
- } else {
- sb.append(this.username);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("password:");
- if (this.password == null) {
- sb.append("null");
- } else {
- sb.append(this.password);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class authenticate_argsStandardSchemeFactory implements SchemeFactory {
- public authenticate_argsStandardScheme getScheme() {
- return new authenticate_argsStandardScheme();
- }
- }
-
- private static class authenticate_argsStandardScheme extends StandardScheme {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, authenticate_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // USERNAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.username = iprot.readString();
- struct.setUsernameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // PASSWORD
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.password = iprot.readString();
- struct.setPasswordIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, authenticate_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.username != null) {
- oprot.writeFieldBegin(USERNAME_FIELD_DESC);
- oprot.writeString(struct.username);
- oprot.writeFieldEnd();
- }
- if (struct.password != null) {
- oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
- oprot.writeString(struct.password);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class authenticate_argsTupleSchemeFactory implements SchemeFactory {
- public authenticate_argsTupleScheme getScheme() {
- return new authenticate_argsTupleScheme();
- }
- }
-
- private static class authenticate_argsTupleScheme extends TupleScheme {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, authenticate_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetUsername()) {
- optionals.set(0);
- }
- if (struct.isSetPassword()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetUsername()) {
- oprot.writeString(struct.username);
- }
- if (struct.isSetPassword()) {
- oprot.writeString(struct.password);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, authenticate_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.username = iprot.readString();
- struct.setUsernameIsSet(true);
- }
- if (incoming.get(1)) {
- struct.password = iprot.readString();
- struct.setPasswordIsSet(true);
- }
- }
- }
-
- }
-
- public static class authenticate_result implements org.apache.thrift.TBase, 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 getUserFromToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable