text:
package ru.tolsi.matcher.naive

import scala.collection.mutable
import ru.tolsi.matcher.{ClientInfo, UnitSpec}

class ThreadUnsafeClientRepositorySpec extends UnitSpec {
  implicit val ec = scala.concurrent.ExecutionContext.global
  describe("apply method") {
    it("should create ThreadUnsafeClientRepository with given clients") {
      val c = ThreadUnsafeClient.fromClientInfo(ClientInfo("1", 0, 1, 2, 3, 4))
      val repo = ThreadUnsafeClientRepository(Seq(c))
      whenReady(repo.getAll) { users =>
        val user = users.head.asInstanceOf[ThreadUnsafeClient]
        user.id should be("1")
        user.balances should be({
          val m = new mutable.AnyRefMap[String, Long]
          m += "USD" -> 0
          m += "A" -> 1
          m += "B" -> 2
          m += "C" -> 3
          m += "D" -> 4
          m
        })
      }
    }
  }
  describe("get method") {
    it("should return user by id") {
      val c = ThreadUnsafeClient.fromClientInfo(ClientInfo("1", 0, 1, 2, 3, 4))
      val repo = ThreadUnsafeClientRepository(Seq(c))
      whenReady(repo.get("1")) { userOpt =>
        val user = userOpt.get.asInstanceOf[ThreadUnsafeClient]
        user.id should be("1")
        user.balances should be({
          val m = new mutable.AnyRefMap[String, Long]
          m += "USD" -> 0
          m += "A" -> 1
          m += "B" -> 2
          m += "C" -> 3
          m += "D" -> 4
          m
        })
      }
    }
    it("should return none for unexisted user by id") {
      val c = ThreadUnsafeClient.fromClientInfo(ClientInfo("1", 0, 1, 2, 3, 4))
      val repo = ThreadUnsafeClientRepository(Seq(c))
      whenReady(repo.get("2")) { userOpt =>
        userOpt should be ('empty)
      }
    }
  }
}


text:
package aerospike

import (
	"testing"

	"github.com/influxdata/telegraf/testutil"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

func TestAerospikeStatistics(t *testing.T) {
	if testing.Short() {
		t.Skip("Skipping aerospike integration tests.")
	}

	a := &Aerospike{
		Servers: []string{testutil.GetLocalHost() + ":3000"},
	}

	var acc testutil.Accumulator

	err := acc.GatherError(a.Gather)
	require.NoError(t, err)

	assert.True(t, acc.HasMeasurement("aerospike_node"))
	assert.True(t, acc.HasTag("aerospike_node", "node_name"))
	assert.True(t, acc.HasMeasurement("aerospike_namespace"))
	assert.True(t, acc.HasTag("aerospike_namespace", "node_name"))
	assert.True(t, acc.HasInt64Field("aerospike_node", "batch_error"))
}

func TestAerospikeStatisticsPartialErr(t *testing.T) {
	if testing.Short() {
		t.Skip("Skipping aerospike integration tests.")
	}

	a := &Aerospike{
		Servers: []string{
			testutil.GetLocalHost() + ":3000",
			testutil.GetLocalHost() + ":9999",
		},
	}

	var acc testutil.Accumulator

	require.Error(t, acc.GatherError(a.Gather))

	assert.True(t, acc.HasMeasurement("aerospike_node"))
	assert.True(t, acc.HasMeasurement("aerospike_namespace"))
	assert.True(t, acc.HasInt64Field("aerospike_node", "batch_error"))
}

func TestAerospikeParseValue(t *testing.T) {
	// uint64 with value bigger than int64 max
	val := parseValue("18446744041841121751")
	require.Equal(t, uint64(18446744041841121751), val)

	// int values
	val = parseValue("42")
	require.Equal(t, val, int64(42), "must be parsed as int")

	// string values
	val = parseValue("BB977942A2CA502")
	require.Equal(t, val, `BB977942A2CA502`, "must be left as string")
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>Profile Editor</title>

  <link rel="stylesheet" href="bower_components/materialize/dist/css/materialize.css" media="screen,projection"/>
  <link rel="stylesheet" href="bower_components/ngImgCrop/compile/minified/ng-img-crop.css"/>
  <link rel="stylesheet" href="css/style.css"/>

  <link rel="shortcut icon" type="img/png" href="images/favicon.png">
  <link rel="manifest" href="manifest.json">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

{{pageTitle}}
               0">...{{profile.toLoad}} loading
              {{pageTitleExtra}}

View

Edit

<profile-card></profile-card>

              Edit profile

              People you know

              Share my WebID

              Logout

              Login

          © 2015
          |  Issue tracker
          | GitHub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using JabbR.Infrastructure;
using JabbR.Models;

namespace JabbR.Services
{
    public class InMemoryRepository : IJabbrRepository
    {
        private readonly ICollection<ChatUser> _users;
        private readonly ICollection<ChatUserIdentity> _identities;
        private readonly ICollection<ChatRoom> _rooms;

        public InMemoryRepository()
        {
            _users = new SafeCollection<ChatUser>();
            _rooms = new SafeCollection<ChatRoom>();
            _identities = new SafeCollection<ChatUserIdentity>();
        }

        public IQueryable<ChatRoom> Rooms { get { return _rooms.AsQueryable(); } }

        public IQueryable<ChatUser> Users { get { return _users.AsQueryable(); } }

        public void Add(ChatRoom room)
        {
            _rooms.Add(room);
        }

        public void Add(ChatUser user)
        {
            _users.Add(user);
        }

        public void Add(ChatUserIdentity identity)
        {
            _identities.Add(identity);
            if (identity.User != null)
            {
                identity.User.Identities.Add(identity);
            }
        }

        public void Add(ChatMessage message)
        {
            // There's no need to keep a collection of messages outside of a room
            var room = _rooms.First(r => r == message.Room);
            room.Messages.Add(message);
        }

        public void Add(ChatClient client)
        {
            var user = _users.FirstOrDefault(u => client.User == u);
            user.ConnectedClients.Add(client);
        }

        public void Remove(ChatClient client)
        {
            var user = _users.FirstOrDefault(u => client.User == u);
            user.ConnectedClients.Remove(client);
        }

        public void Remove(ChatRoom room)
        {
            _rooms.Remove(room);
        }

        public void Remove(ChatUser user)
        {
            _users.Remove(user);
        }

        public void Remove(ChatUserIdentity identity)
        {
            _identities.Remove(identity);
        }

        public void CommitChanges()
        {
            // no-op since this is an in-memory impl' of the repo
        }

        public void Dispose()
        {
        }

        public ChatUser GetUserById(string userId)
        {
            return _users.FirstOrDefault(u => u.Id != null && u.Id.Equals(userId, StringComparison.OrdinalIgnoreCase));
        }

        public ChatUser GetUserByName(string userName)
        {
            return _users.FirstOrDefault(u => u.Name != null && u.Name.Equals(userName, StringComparison.OrdinalIgnoreCase));
        }

        public ChatRoom GetRoomByName(string roomName)
        {
            return _rooms.FirstOrDefault(r => r.Name != null && r.Name.Equals(roomName, StringComparison.OrdinalIgnoreCase));
        }

        public ChatRoom GetRoomByName(string roomName, bool includeUsers = false, bool includeOwners = false)
        {
            return GetRoomByName(roomName);
        }

        public ChatRoom GetRoomAndUsersByName(string roomName)
        {
            return GetRoomByName(roomName);
        }

        public IQueryable<ChatRoom> GetAllowedRooms(ChatUser user)
        {
            return _rooms
                .Where(r =>
                    (!r.Private) ||
                    (r.Private && r.AllowedUsers.Contains(user)))
                .AsQueryable();
        }

        public IQueryable<ChatMessage> GetMessagesByRoom(ChatRoom room)
        {
            return room.Messages.AsQueryable();
        }

        public IQueryable<ChatUser> GetOnlineUsers(ChatRoom room)
        {
            return room.Users.Online().AsQueryable();
        }

        public IQueryable<ChatUser> GetOnlineUsers()
        {
            return _users.Online().AsQueryable();
        }

        public IQueryable<ChatUser> SearchUsers(string name)
        {
            return _users.Online()
                         .Where(u => u.Name.IndexOf(name, StringComparison.OrdinalIgnoreCase) != -1)
                         .AsQueryable();
        }

        public ChatUser GetUserByClientId(string clientId)
        {
            return _users.FirstOrDefault(u => u.ConnectedClients.Any(c => c.Id == clientId));
        }

        public ChatUser GetUserByLegacyIdentity(string userIdentity)
        {
            return _users.FirstOrDefault(u => u.Identity == userIdentity);
        }

        public ChatUser GetUserByIdentity(string providerName, string userIdentity)
        {
            var identity = _identities.FirstOrDefault(u => u.Identity == userIdentity && u.ProviderName == providerName);
            if (identity != null)
            {
                return identity.User;
            }
            return null;
        }

        public ChatClient GetClientById(string clientId, bool includeUser = false)
        {
            return _users.SelectMany(u => u.ConnectedClients).FirstOrDefault(c => c.Id == clientId);
        }

        public IQueryable<ChatMessage> GetPreviousMessages(string messageId)
        {
            // Ineffcient since we don't have a messages collection

            return (from r in _rooms
                    let message = r.Messages.FirstOrDefault(m => m.Id == messageId)
                    where message != null
                    from m in r.Messages
                    where m.When < message.When
                    select m).AsQueryable();
        }

        public void RemoveAllClients()
        {
            // No need to do anything here since this is only called on App_Start
            // if we're using the in memory repository all the data has been purged anyways
        }

        public ChatMessage GetMessageById(string id)
        {
            return (from r in _rooms
                    let message = r.Messages.FirstOrDefault(m => m.Id == id)
                    where message != null
                    select message).FirstOrDefault();
        }

        public bool IsUserInRoom(ChatUser user, ChatRoom room)
        {
            // REVIEW: Inefficient, bu only users for unit tests right now
            return room.Users.Any(u => u.Name == user.Name);
        }

        public void AddUserRoom(ChatUser user, ChatRoom room)
        {
            user.Rooms.Add(room);

            room.Users.Add(user);
        }

        public void RemoveUserRoom(ChatUser user, ChatRoom room)
        {
            user.Rooms.Remove(room);

            room.Users.Remove(user);
        }

        public void Reload(object entity)
        {
        }
    }
}


text:
[![GoDoc](https://godoc.org/github.com/raitucarp/faker?status.svg)](https://godoc.org/github.com/raitucarp/faker)

another go faker data generator, with some features

This package and its definitions is inspired by [faker.js](https://github.com/Marak/faker.js)

Readme, license and complete documentation will updated soon.

Thanks


text:
"""Analyse top maven popular projects."""

import bs4
from collections import OrderedDict
import os
import re
import requests
import tempfile
from selinon import StoragePool
from shutil import rmtree

from .base import AnalysesBaseHandler
from f8a_worker.utils import cwd, TimedCommand
from f8a_worker.errors import TaskError

class MavenPopularAnalyses(AnalysesBaseHandler):
    """Analyse top maven popular projects."""

    _BASE_URL = 'http://mvnrepository.com'
    _MAX_PAGES = 10

    def __init__(self, *args, **kwargs):
        """Create and instance of this analyse handler."""
        super().__init__(*args, **kwargs)
        self.projects = OrderedDict()
        self.nprojects = 0

    @staticmethod
    def _find_versions(project_page, latest_version_only=False):
        def _has_numeric_usages(tag):
            return tag.has_attr('href') and \
                   tag.get('href').endswith('/usages') and \
                   tag.get_text().replace(',', '').isnumeric()
        usage_tags = project_page.find_all(_has_numeric_usages)
        if usage_tags and not latest_version_only:
            # sort according to usage
            usage_tags = sorted(usage_tags, key=lambda u: int(u.text.replace(',', '')),
                                reverse=True)
            # [64]
            versions = [v.get('href').split('/')[-2] for v in usage_tags]
        else:  # no usage stats, get the versions other way
            versions = project_page.find_all('a', class_=re.compile('vbtn *'))
            # [3.8]
            if latest_version_only:
                # take the first one (always the latest version)
                versions = versions[:1]
            else:
                versions = sorted(versions, key=lambda v: v.text, reverse=True)
            versions = [v.text for v in versions]
        return versions

    def _projects_from(self, url_suffix):
        """Scrape the selected page @ http://mvnrepository.com.

        :param url_suffix: to add to _BASE_URL
        :return: 2-tuple of (dict of {project_name: [versions]}, number of found projects)
        """
        if not url_suffix.startswith('/'):
            url_suffix = '/' + url_suffix
        for page in range(1, self._MAX_PAGES + 1):
            page_link = '{base_url}{url_suffix}?p={page}'.format(base_url=self._BASE_URL,
                                                                 url_suffix=url_suffix,
                                                                 page=page)
            pop = requests.get(page_link)
            poppage = bs4.BeautifulSoup(pop.text, 'html.parser')
            for link in poppage.find_all('a', class_='im-usage'):
                # 56,752 usages
                artifact = link.get('href')[0:-len('/usages')]
                artifact_link = '{url}{a}'.format(url=self._BASE_URL, a=artifact)
                art = requests.get(artifact_link)
                artpage = bs4.BeautifulSoup(art.text, 'html.parser')
                name = artifact[len('/artifact/'):].replace('/', ':')
                all_versions = self._find_versions(artpage, self.nversions == 1)
                if name not in self.projects and all_versions:
                    versions = all_versions[:self.nversions]
                    self.log.debug("Scheduling #%d. (number versions: %d)",
                                   self.nprojects, self.nversions)
                    self.projects[name] = versions
                    self.nprojects += 1
                    for version in versions:
                        # TODO: this can be unrolled
                        if self.count.min <= self.nprojects <= self.count.max:
                            self.analyses_selinon_flow(name, version)
                        else:
                            self.log.debug("Skipping scheduling for #%d. (min=%d, max=%d, "
                                           "name=%s, version=%s)",
                                           self.nprojects, self.count.min, self.count.max, name,
                                           version)

                    if self.nprojects >= self.count.max:
                        return

    def _top_projects(self):
        """Scrape Top Projects page @ http://mvnrepository.com/popular."""
        self.log.debug('Scraping Top Projects page http://mvnrepository.com/popular')
        self._projects_from('/popular')

    def _top_categories_projects(self):
        """Scrape Top Categories page @ http://mvnrepository.com/open-source."""
        for page in range(1, self._MAX_PAGES + 1):
            page_link = '{url}/open-source?p={page}'.format(url=self._BASE_URL, page=page)
            self.log.debug('Scraping Top Categories page %s' % page_link)
            cat = requests.get(page_link)
            catpage = bs4.BeautifulSoup(cat.text, 'html.parser')
            # [more...]
            for link in catpage.find_all('a', text='more...'):
                category = link.get('href')
                self._projects_from(category)
                if self.nprojects >= self.count.max:
                    return

    def _top_tags_projects(self):
        """Scrape Popular Tags page @ http://mvnrepository.com/tags."""
        page_link = '{url}/tags'.format(url=self._BASE_URL)
        self.log.debug('Scraping Popular Tags page %s' % page_link)
        tags_page = requests.get(page_link)
        tagspage = bs4.BeautifulSoup(tags_page.text, 'html.parser')
        tags_a = tagspage.find_all('a', class_=re.compile('t[1-9]'))
        # [accumulo,
        #  actor]
        tags_a = sorted(tags_a, key=lambda x: x.get('class'), reverse=True)
        for link in tags_a:
            tag = link.get('href')
            self._projects_from(tag)
            if self.nprojects >= self.count.max:
                return

    def _use_maven_index_checker(self):
        maven_index_checker_dir = os.getenv('MAVEN_INDEX_CHECKER_PATH')
        maven_index_checker_data_dir = os.environ.get('MAVEN_INDEX_CHECKER_DATA_PATH',
                                                      '/tmp/index-checker')
        os.makedirs(maven_index_checker_data_dir, exist_ok=True)
        central_index_dir = os.path.join(maven_index_checker_data_dir, 'central-index')
        timestamp_path = os.path.join(central_index_dir, 'timestamp')

        s3 = StoragePool.get_connected_storage('S3MavenIndex')
        self.log.info('Fetching pre-built maven index from S3, if available.')
        s3.retrieve_index_if_exists(maven_index_checker_data_dir)

        old_timestamp = 0
        try:
            old_timestamp = int(os.stat(timestamp_path).st_mtime)
        except OSError:
            self.log.info('Timestamp is missing, we will probably need to build the index '
                          'from scratch.')
            pass

        java_temp_dir = tempfile.mkdtemp(prefix='tmp-', dir=os.environ.get('PV_DIR', '/tmp'))

        index_range = '{}-{}'.format(self.count.min, self.count.max)
        command = ['java', '-Xmx768m',
                   '-Djava.io.tmpdir={}'.format(java_temp_dir),
                   '-DcentralIndexDir={}'.format(central_index_dir),
                   '-jar', 'maven-index-checker.jar', '-r', index_range]
        if self.nversions == 1:
            command.append('-l')
        with cwd(maven_index_checker_dir):
            try:
                output = TimedCommand.get_command_output(command, is_json=True, graceful=False,
                                                         timeout=1200)

                new_timestamp = int(os.stat(timestamp_path).st_mtime)
                if old_timestamp != new_timestamp:
                    self.log.info('Storing pre-built maven index to S3...')
                    s3.store_index(maven_index_checker_data_dir)
                    self.log.debug('Stored. Index in S3 is up-to-date.')
                else:
                    self.log.info('Index in S3 is up-to-date.')
            except TaskError as e:
                self.log.exception(e)
                raise
            finally:
                rmtree(central_index_dir)
                self.log.debug('central-index/ deleted')
                rmtree(java_temp_dir)

            s3data = StoragePool.get_connected_storage('S3Data')
            bucket = s3data._s3.Bucket(s3data.bucket_name)
            for idx, release in enumerate(output):
                name = '{}:{}'.format(release['groupId'], release['artifactId'])
                version = release['version']
                # For now (can change in future) we want to analyze only ONE version of each package
                try:
                    next(iter(bucket.objects.filter(Prefix='{e}/{p}/'.format(
                        e=self.ecosystem, p=name)).limit(1)))
                    self.log.info("Analysis of some version of %s has already been scheduled, "
                                  "skipping version %s", name, version)
                    continue
                except StopIteration:
                    self.log.info("Scheduling #%d.", self.count.min + idx)
                    self.analyses_selinon_flow(name, version)

    def do_execute(self, popular=True):
        """Run core analyse on maven projects.

        :param popular: boolean, sort index by popularity
        """
        if popular:
            self._top_projects()

            if self.nprojects < self.count.max:
                # There's only 100 projects on Top Projects page, look at top categories
                self._top_categories_projects()

            if self.nprojects < self.count.max:
                # Still not enough ? Ok, let's try popular tags
                self._top_tags_projects()

            if self.nprojects < self.count.max:
                self.log.warning("No more sources of popular projects. "
                                 "%d will be scheduled instead of requested %d" % (self.nprojects,
                                                                                self.count.max))
        else:
            self._use_maven_index_checker()


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Constant Field Values (rdfutils 1.0 API)</title>
<meta name="date" content="2015-04-13">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Constant Field Values

Contents

de.i3mainz.*

de.i3mainz.*

de.i3mainz.ls.Config.Config

Modifier and Type
Constant Field
Value

public static final String
FILE_STORE_PATH
"/tmp/"

public static final String
FILE_STORE_PATH_PUBLIC
"/usr/share/apache-tomcat-7.0.50/webapps/labelingserver/"

public static final String
Instance_AGENT
"http://143.93.114.137/agent#"

public static final String
Instance_GUI
"http://143.93.114.137/gui#"

public static final String
Instance_LABEL
"http://143.93.114.137/label#"

public static final String
Instance_LOG
"http://143.93.114.137/log#"

public static final String
Instance_PROJECT
"http://143.93.114.137/project#"

public static final String
Instance_SPARQLENDPOINT
"http://143.93.114.137/sparqlendpoint#"

public static final String
Instance_VOCABULARY
"http://143.93.114.137/vocabulary#"

public static final String
INSTANCEHOST
"http://143.93.114.137/"

public static final String
LABELINGSERVER
"http://labeling.i3mainz.hs-mainz.de/labelingserver/"

public static final String
LOGIN
""

public static final String
PASSWORD
""

public static final String
PREFIX_DCELEMENTS
"http://purl.org/dc/elements/1.1/"

public static final String
PREFIX_DCTERMS
"http://purl.org/dc/terms/"

public static final String
PREFIX_FOAF
"http://xmlns.com/foaf/0.1/"

public static final String
PREFIX_LABELINGSYSTEM
"http://143.93.114.137/vocab#"

public static final String
PREFIX_OWL
"http://www.w3.org/2002/07/owl#"

public static final String
PREFIX_RDF
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"

public static final String
PREFIX_RDFS
"http://www.w3.org/2000/01/rdf-schema#"

public static final String
PREFIX_SKOS
"http://www.w3.org/2004/02/skos/core#"

public static final String
REST
"http://labeling.i3mainz.hs-mainz.de/rest/"

public static final String
Rest_VOCABS
"http://labeling.i3mainz.hs-mainz.de/rest/vocabs/"

public static final String
SERVER
"http://labeling.i3mainz.hs-mainz.de/"

public static final String
TRIPLESTORE_SERVER
"http://labeling.i3mainz.hs-mainz.de/openrdf-sesame"

public static final String
TRIPLESTORE_WORKBENCH
"http://labeling.i3mainz.hs-mainz.de/openrdf-workbench"

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015. All rights reserved.


text:
__author__ = 'Williewonka'
__version__ = 1.2

import socket
import time
import sys
import queue
from PySide.QtGui import *
from PySide import QtCore
import LoginGui
import ChatGui
import json
# import ssl
from math import floor
import base64
from cryptography.fernet import Fernet

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# sock = ssl.wrap_socket(s, ca_certs="server.crt", cert_reqs=ssl.CERT_REQUIRED)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
MAXROOM = 0
NAME = ""
succes = False
dropdown = []
ROOM = 0
verficationpipe = queue.Queue()
whisper = ""

# class Signals(QtCore.QObject):
#     UpdateMenu = QtCore.Signal()
#     UpdatingMenu = False
#
# signals = Signals()

class LoginWindow(QMainWindow, LoginGui.Ui_LoginWindow):

    def __init__(self, parent=None):
        super(LoginWindow, self).__init__(parent)
        self.setupUi(self)

        # noinspection PyTypeChecker
        QApplication.setStyle(QStyleFactory.create("plastique"))

        #debug:
        self.txt_serverip_port.setText("192.168.1.81:600")

        self.bt_close.clicked.connect(self.Close)
        self.bt_login.clicked.connect(self.LoginProcedure)
        self.txt_username.returnPressed.connect(self.LoginProcedure)
        self.txt_password.returnPressed.connect(self.LoginProcedure)
        self.txt_serverip_port.returnPressed.connect(self.LoginProcedure)

    def Close(self):
        self.close()

    def CreateFernet(self, passw):
        global PERSONALFERNET
        if len(passw) >= 32:
            PERSONALFERNET = Fernet(base64.urlsafe_b64encode(str.encode(passw[:32])))
            return
        reuse = floor(32/len(passw))
        temp = ""
        for i in range(0, reuse):
            temp += passw
        rest = 32 - len(temp)
        for i in range(0,rest):
            temp += "z"
        PERSONALFERNET = Fernet(base64.urlsafe_b64encode(str.encode(temp)))

    def LoginProcedure(self):
        global sock
        global MAXROOM
        global ROOM
        global PERSONALFERNET

        if ":" in self.txt_serverip_port.text() and self.txt_username.text() != "" and self.txt_password.text() != "":
            try:
                global NAME
                NAME = self.txt_username.text()
                HOST = self.txt_serverip_port.text().split(":")[0]
                PORT = int(self.txt_serverip_port.text().split(":")[1])
            except:
                QMessageBox.information(self, "Error", "Invalid entry for host and port")
                return
            print('settings: ip: ' + HOST + ' port: ' + str(PORT))
            Echo(self, "setting up connection ...")
            time.sleep(1)
            try:
                sock.connect((HOST, PORT))
            except:
                print("connection failed")
                self.statusbar.showMessage("connection failed")
                QMessageBox.information(self, "Error", "Connection failed, are you sure you put in the right ip and port?")
                sock.close()
                return

            Echo(self, "Connected! Logging in to system ...")
            time.sleep(1)
            logindata = {
                "username": self.txt_username.text(),
                "password": self.txt_password.text(),
                "version": str(__version__)
            }
            loginpackage = json.dumps(logindata)
            try:
                sock.sendall(bytes(loginpackage, "utf-8"))
                #from here on communication is encrypted
                self.CreateFernet(self.txt_password.text())
                answer = str(PERSONALFERNET.decrypt(sock.recv(1024)), "utf-8")
            except:
                print("server disconnected during login communication")
                QMessageBox.information(self, "Error", "server disconnected during login communication")
                sock.close()
                return

            if answer.split(" ")[0] == "OK":
                MAXROOM = int(answer.split(" ")[1])
                Echo(self, "Userlogin succesfull!, Choosing room...")
                while True:
                    #room = input("please select a room(0,"+str(MAXROOM)+"): ")
                    ROOM, ok = QInputDialog.getInteger(self, "Please specify a roomnumber", "Roomnumber:", 0, 0, MAXROOM, 1)
                    if not ok:
                        self.statusbar.showMessage("Aborted")
                        return
                    sock.sendall(PERSONALFERNET.encrypt(str.encode(str(ROOM))))
                    try:
                        answer2 = str(PERSONALFERNET.decrypt(sock.recv(1024)), "utf-8")
                    except:
                        print("server disconnected during login communication, abort")
                        sock.close()
                        QMessageBox.information(self, "Error", "server disconnected during login communication, aborted login sequence")
                    if answer2 != "OK":
                        print("invalid room number, please try again")
                        QMessageBox.informatio(self, "Error", "invalid room number, please try again")
                    else:
                        break

                Echo(self, "Roomlogin succesfull!")

                time.sleep(1)
                global succes
                succes = True
                self.close()
                return
            else:
                Echo(self, "login failed: "+answer.split(":")[1])
                QMessageBox.information(self, "Error", "Login failed!: "+answer.split(":")[1])
                sock.close()
                return

        else:
            QMessageBox.information(self, "Error", "Please check if you have entered all fields correctly")
            return

class ChatWindow(QMainWindow, ChatGui.Ui_MainWindow):
    global sock
    global verficationpipe
    # global signals

    # noinspection PyUnresolvedReferences
    def __init__(self, parent=None):
        global dropdown
        global ROOM
        global MAXROOM
        super(ChatWindow, self).__init__(parent)
        self.setupUi(self)

        # noinspection PyTypeChecker
        QApplication.setStyle(QStyleFactory.create("plastique"))

        Echo(self, "Setting up gui ...")

        try:
            sock.sendall(PERSONALFERNET.encrypt(str.encode("amiadmin")))
            Level = int(PERSONALFERNET.decrypt(sock.recv(1024)))
            sock.sendall(PERSONALFERNET.encrypt(str.encode("list")))
            List = str(PERSONALFERNET.decrypt(sock.recv(1024)), "utf-8")
            sock.sendall(PERSONALFERNET.encrypt(str.encode("banlist")))
            BanList = str(PERSONALFERNET.decrypt(sock.recv(1024)), "utf-8")
        except:
            Echo(self, "Server disconnected")
            QMessageBox.information(self, "Error", "Server disconnected during initializing")
            sock.close()
            return
        # print("DEBUG: Loaded info from server")

        self.UpdateMenu(List, BanList)
        self.cmb_userlists.setCurrentIndex(ROOM)
        self.cmb_userlists.setEnabled(True)
        self.ChangeList()
        # print("DEBUG: updated menu")
        self.bt_send.setEnabled(True)
        self.bt_whisper.setEnabled(True)
        self.bt_logout.setEnabled(True)
        self.txt_message.setReadOnly(False)
        if Level > 0:
            self.bt_kick.setEnabled(True)
        if Level > 1:
            self.bt_ban.setEnabled(True)
            self.bt_ipban.setEnabled(True)
        # print("DEBUG: enabled buttons")
        self.thread = ServerHandler(self)
        self.thread.start()
        # print("DEBUG: thread started")
        self.cmb_userlists.currentIndexChanged.connect(self.ChangeList)
        self.bt_logout.clicked.connect(self.Logout)
        self.bt_send.clicked.connect(self.Send)
        self.txt_message.returnPressed.connect(self.Send)
        self.thread.terminated.connect(self.ServerDrop)
        self.bt_switch.clicked.connect(self.RoomSwitch)
        self.bt_whisper.clicked.connect(self.Whisper)
        self.bt_kick.clicked.connect(self.Kick)
        self.bt_ban.clicked.connect(self.Ban)
        self.bt_ipban.clicked.connect(self.IpBan)
        #signals.UpdateMenu.connect(self.UpdateMenu)
        # print("DEBUG: connected signals")
        self.statusbar.showMessage("Server status: connected")

    def Kick(self):
        if self.cmb_userlists.currentText() is not "Banned Users":
            for user in self.lst_users.selectedItems():
                message = "kick " + user.text()
                self.SendServer(message, "OK")

    def IpBan(self):
        if self.cmb_userlists.currentText() is not "Banned Users":
            for user in self.lst_users.selectedItems():
                message = "ipban " + user.text()
                self.SendServer(message, "OK")

    def Ban(self):
        if self.cmb_userlists.currentText() is not "Banned Users":
            for user in self.lst_users.selectedItems():
                message = "ban " + user.text()
                self.SendServer(message, "OK")
        else:
            for user in self.lst_users.selectedItems():
                message = "unban " + user.text()
                self.SendServer(message, "OK")

    def Whisper(self):
        global whisper

        try:
            whisper = self.lst_users.selectedItems()[0].text()
            # self.bt_whisper.setText("whisper")
            self.bt_whisper.setStyleSheet("color: rgb(255,0,0)")
        except:
            whisper = ""
            self.bt_whisper.setStyleSheet("color: rgb(0,0,0)")
            # self.bt_whisper.setText("whisper")

    def RoomSwitch(self):
        self.SendServer("switch "+str(self.cmb_userlists.currentIndex()), "OK")

    def ServerDrop(self):
        Echo(self, "Server disconnected!")
        self.bt_send.setEnabled(False)
        self.bt_whisper.setEnabled(False)
        self.bt_logout.setEnabled(False)
        self.txt_message.setReadOnly(False)
        self.bt_kick.setEnabled(False)
        self.bt_ban.setEnabled(False)
        self.bt_ipban.setEnabled(False)
        self.cmb_userlists.setEnabled(False)

    def Send(self):
        if whisper is "":
            self.SendServer(self.txt_message.text(), "OK")
        else:
            self.SendServer("whisper " + whisper + ":" + self.txt_message.text(), "OK")

    def SendServer(self, message, token):
        global PERSONALFERNET
        self.txt_message.clear()
        if message.split(" ")[0] not in ["help", "switch", "ban", "unban", "ipban", "changepass", "changeownpass"]:
            self.txt_messages.append(NAME+": "+message)
        try:
            sock.sendall(PERSONALFERNET.encrypt(str.encode(message)))
        except:
            self.ServerDrop()

        verficationpipe.put(token)
        verficationpipe.join()

    def UpdateMenu(self, List, BanList):
        global dropdown
        global sock
        dropdown = []
        self.cmb_userlists.clear()
        for room in List.split("-")[1].split("|"):
            p = room.split(";")
            if p == "":
                continue
            self.cmb_userlists.addItem(p[0])
            del p[0]
            roomlist = []
            for user in p:
                if user != "":
                    roomlist.append(user)
            dropdown.append(roomlist)
        if "OK" not in BanList:
            banlist = []
            for user in BanList.split("\n"):
                banlist.append(user)
            dropdown.append(banlist)
            self.cmb_userlists.addItem("Banned Users")
        elif BanList == "":
            self.cmb_userlists.addItem("Banned Users")

    def ChangeList(self):
        self.lst_users.clear()
        self.lst_users.addItems(dropdown[self.cmb_userlists.currentIndex()])
        if self.cmb_userlists.currentIndex() != ROOM and not self.cmb_userlists.currentIndex() > MAXROOM:
            self.bt_switch.setEnabled(True)
        else:
            self.bt_switch.setEnabled(False)

    def Logout(self):
        self.thread.terminate()
        Echo(self, "Logging off...")
        sock.close()
        self.close()

def Echo(self, message):
    self.statusbar.showMessage(message)
    print(message)

LoginWindow.Echo = Echo
ChatWindow.Echo = Echo

class ServerHandler(QtCore.QThread):
    global verficationpipe
    global dropdown
    global sock
    # global signals

    def __init__(self, form, parent=None):
        super(ServerHandler, self).__init__(parent)
        self.form = form

    def UpdateGUI(self):
        try:
            sock.sendall(bytes("list", "utf-8"))
            List = str(sock.recv(1024), "utf-8")
            sock.sendall(bytes("banlist", "utf-8"))
            BanList = str(sock.recv(1024), "utf-8")
        except:
            sock.close()
            self.terminate()
            return
        form.UpdateMenu(List, BanList)

    def run(self):
        global ROOM
        global PERSONALFERNET
        while True:
            try:
                serverinput = str(PERSONALFERNET.decrypt(sock.recv(1024)), "utf-8")
            except:
                sock.close()
                self.terminate()
                return
            if not verficationpipe.empty():
                token = verficationpipe.get()
                if token not in serverinput:
                    self.form.txt_messages.append("verification with server failed!")
                    verficationpipe.task_done()
                    continue
                else:
                    if "-" in serverinput:
                        self.form.txt_messages.append("INFO: "+serverinput.split("-")[1]+"")
                        if "switched to room" in serverinput:
                            self.UpdateGUI()
                            try:
                                ROOM = int(serverinput.split(" ")[3])
                            except:
                                self.form.txt_messages.append("invalid serverresponse!")
                            form.cmb_userlists.setCurrentIndex(ROOM)
                    verficationpipe.task_done()
                    continue
            else:
                if serverinput != "":
                    if ("connected" in serverinput or "switched" in serverinput or "disconnected" in serverinput) and ":" not in serverinput:
                        self.form.txt_messages.append(" " + serverinput + " ")
                        self.UpdateGUI()
                        form.cmb_userlists.setCurrentIndex(ROOM)
                    elif "SERVER" in serverinput:
                        self.form.txt_messages.append(" " + serverinput + " ")
                    else:
                        self.form.txt_messages.append(serverinput)
                    continue

if __name__ == "__main__":
    app = QApplication(sys.argv)
    form = LoginWindow()
    form.show()
    app.exec_()

    if succes:
        form = ChatWindow()
        form.show()
        app.exec_()

        #print('you can now begin sending messages\ntype help for available commands')
        #while True:
        #    if not thread.is_alive():
        #        sock.close()
        #        sys.exit()
        #
        #    clientinput = input()
        #    if clientinput == "help":
        #        print("available commands:\n"
        #              "\tclose: disconnect from the server\n"
        #              "\tswitch <roomnumber>: switch chatroom\n"
        #              "\tkick <user>: kick user from room\n"
        #              "\tlist: list of connected users\n"
        #              "\twhisper <user>:<message> : send a private message to a connected user, crossroom supported\n"
        #              "\tchangeownpass <oldpass> <newpass> : changes your password\n"
        #              "commands below are for admins only\n"
        #              "\tipban <user>: bans the ip of the given user, you need to issue kick to end current session\n"
        #              "\tipunban <ip>: unbans given ip\n"
        #              "\tban <user>: bans the given user, same provision as ipban\n"
        #              "\tunban <user>: unbans given user\n"
        #              "\tadduser <user> <password> : creates a new user with the specified info\n"
        #              "\tchangepass <user> <newpassword> : changes the password of given user\n"
        #              "\thelp: this helpmessage")
        #    elif clientinput == "close":
        #        print("disconnecting client")
        #        sock.close()
        #        sys.exit()
        #    elif clientinput.split(" ")[0] == "switch":
        #        try:
        #            if int(clientinput.split(" ")[1]) > MAXROOM:
        #                print("ERROR: invalid roomnumber")
        #                continue
        #            else:
        #                SendServer(clientinput, sock, "OK")
        #                print("INFO: Room succesfully switched!")
        #                continue
        #        except:
        #            print("ERROR: wrong syntax")
        #    else:
        #        SendServer(clientinput, sock, "OK")


text:
default_target: all
.PHONY : default_target

#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =

.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

# The shell in which to execute make rules.
SHELL = /bin/sh

# The CMake executable.
CMAKE_COMMAND = /usr/bin/cmake

# The command to remove a file.
RM = /usr/bin/cmake -E remove -f

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = /projects/ros/surfer-main/lab3/rxtx

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = /projects/ros/surfer-main/lab3/rxtx/build

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
	/usr/bin/cmake -i .
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target install
install: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	/usr/bin/cmake -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast

# Special rule for the target list_install_components
list_install_components:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
	$(CMAKE_COMMAND) -E cmake_progress_start /projects/ros/surfer-main/lab3/rxtx/build/CMakeFiles /projects/ros/surfer-main/lab3/rxtx/build/CMakeFiles/progress.marks
	$(MAKE) -f CMakeFiles/Makefile2 all
	$(CMAKE_COMMAND) -E cmake_progress_start /projects/ros/surfer-main/lab3/rxtx/build/CMakeFiles 0
.PHONY : all

# The main clean target
clean:
	$(MAKE) -f CMakeFiles/Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
	$(MAKE) -f CMakeFiles/Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named ROSBUILD_genmsg_cpp

# Build rule for target.
ROSBUILD_genmsg_cpp: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_cpp
.PHONY : ROSBUILD_genmsg_cpp

# fast build rule for target.
ROSBUILD_genmsg_cpp/fast:
	$(MAKE) -f CMakeFiles/ROSBUILD_genmsg_cpp.dir/build.make CMakeFiles/ROSBUILD_genmsg_cpp.dir/build
.PHONY : ROSBUILD_genmsg_cpp/fast

#=============================================================================
# Target rules for targets named ROSBUILD_genmsg_lisp

# Build rule for target.
ROSBUILD_genmsg_lisp: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_lisp
.PHONY : ROSBUILD_genmsg_lisp

# fast build rule for target.
ROSBUILD_genmsg_lisp/fast:
	$(MAKE) -f CMakeFiles/ROSBUILD_genmsg_lisp.dir/build.make CMakeFiles/ROSBUILD_genmsg_lisp.dir/build
.PHONY : ROSBUILD_genmsg_lisp/fast

#=============================================================================
# Target rules for targets named ROSBUILD_genmsg_py

# Build rule for target.
ROSBUILD_genmsg_py: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_py
.PHONY : ROSBUILD_genmsg_py

# fast build rule for target.
ROSBUILD_genmsg_py/fast:
	$(MAKE) -f CMakeFiles/ROSBUILD_genmsg_py.dir/build.make CMakeFiles/ROSBUILD_genmsg_py.dir/build
.PHONY : ROSBUILD_genmsg_py/fast

#=============================================================================
# Target rules for targets named ROSBUILD_gensrv_cpp

# Build rule for target.
ROSBUILD_gensrv_cpp: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_cpp
.PHONY : ROSBUILD_gensrv_cpp

# fast build rule for target.
ROSBUILD_gensrv_cpp/fast:
	$(MAKE) -f CMakeFiles/ROSBUILD_gensrv_cpp.dir/build.make CMakeFiles/ROSBUILD_gensrv_cpp.dir/build
.PHONY : ROSBUILD_gensrv_cpp/fast

#=============================================================================
# Target rules for targets named ROSBUILD_gensrv_lisp

# Build rule for target.
ROSBUILD_gensrv_lisp: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_lisp
.PHONY : ROSBUILD_gensrv_lisp

# fast build rule for target.
ROSBUILD_gensrv_lisp/fast:
	$(MAKE) -f CMakeFiles/ROSBUILD_gensrv_lisp.dir/build.make CMakeFiles/ROSBUILD_gensrv_lisp.dir/build
.PHONY : ROSBUILD_gensrv_lisp/fast

#=============================================================================
# Target rules for targets named RxTx

# Build rule for target.
RxTx: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 RxTx
.PHONY : RxTx

# fast build rule for target.
RxTx/fast:
	$(MAKE) -f CMakeFiles/RxTx.dir/build.make CMakeFiles/RxTx.dir/build
.PHONY : RxTx/fast

#=============================================================================
# Target rules for targets named _catkin_empty_exported_target

# Build rule for target.
_catkin_empty_exported_target: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 _catkin_empty_exported_target
.PHONY : _catkin_empty_exported_target

# fast build rule for target.
_catkin_empty_exported_target/fast:
	$(MAKE) -f CMakeFiles/_catkin_empty_exported_target.dir/build.make CMakeFiles/_catkin_empty_exported_target.dir/build
.PHONY : _catkin_empty_exported_target/fast

#=============================================================================
# Target rules for targets named clean_test_results

# Build rule for target.
clean_test_results: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 clean_test_results
.PHONY : clean_test_results

# fast build rule for target.
clean_test_results/fast:
	$(MAKE) -f CMakeFiles/clean_test_results.dir/build.make CMakeFiles/clean_test_results.dir/build
.PHONY : clean_test_results/fast

#=============================================================================
# Target rules for targets named doxygen

# Build rule for target.
doxygen: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 doxygen
.PHONY : doxygen

# fast build rule for target.
doxygen/fast:
	$(MAKE) -f CMakeFiles/doxygen.dir/build.make CMakeFiles/doxygen.dir/build
.PHONY : doxygen/fast

#=============================================================================
# Target rules for targets named rosbuild_clean-test-results

# Build rule for target.
rosbuild_clean-test-results: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rosbuild_clean-test-results
.PHONY : rosbuild_clean-test-results

# fast build rule for target.
rosbuild_clean-test-results/fast:
	$(MAKE) -f CMakeFiles/rosbuild_clean-test-results.dir/build.make CMakeFiles/rosbuild_clean-test-results.dir/build
.PHONY : rosbuild_clean-test-results/fast

#=============================================================================
# Target rules for targets named rosbuild_precompile

# Build rule for target.
rosbuild_precompile: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rosbuild_precompile
.PHONY : rosbuild_precompile

# fast build rule for target.
rosbuild_precompile/fast:
	$(MAKE) -f CMakeFiles/rosbuild_precompile.dir/build.make CMakeFiles/rosbuild_precompile.dir/build
.PHONY : rosbuild_precompile/fast

#=============================================================================
# Target rules for targets named rosbuild_premsgsrvgen

# Build rule for target.
rosbuild_premsgsrvgen: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rosbuild_premsgsrvgen
.PHONY : rosbuild_premsgsrvgen

# fast build rule for target.
rosbuild_premsgsrvgen/fast:
	$(MAKE) -f CMakeFiles/rosbuild_premsgsrvgen.dir/build.make CMakeFiles/rosbuild_premsgsrvgen.dir/build
.PHONY : rosbuild_premsgsrvgen/fast

#=============================================================================
# Target rules for targets named rospack_genmsg

# Build rule for target.
rospack_genmsg: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg
.PHONY : rospack_genmsg

# fast build rule for target.
rospack_genmsg/fast:
	$(MAKE) -f CMakeFiles/rospack_genmsg.dir/build.make CMakeFiles/rospack_genmsg.dir/build
.PHONY : rospack_genmsg/fast

#=============================================================================
# Target rules for targets named rospack_genmsg_all

# Build rule for target.
rospack_genmsg_all: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_all
.PHONY : rospack_genmsg_all

# fast build rule for target.
rospack_genmsg_all/fast:
	$(MAKE) -f CMakeFiles/rospack_genmsg_all.dir/build.make CMakeFiles/rospack_genmsg_all.dir/build
.PHONY : rospack_genmsg_all/fast

#=============================================================================
# Target rules for targets named rospack_genmsg_libexe

# Build rule for target.
rospack_genmsg_libexe: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_libexe
.PHONY : rospack_genmsg_libexe

# fast build rule for target.
rospack_genmsg_libexe/fast:
	$(MAKE) -f CMakeFiles/rospack_genmsg_libexe.dir/build.make CMakeFiles/rospack_genmsg_libexe.dir/build
.PHONY : rospack_genmsg_libexe/fast

#=============================================================================
# Target rules for targets named rospack_gensrv

# Build rule for target.
rospack_gensrv: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 rospack_gensrv
.PHONY : rospack_gensrv

# fast build rule for target.
rospack_gensrv/fast:
	$(MAKE) -f CMakeFiles/rospack_gensrv.dir/build.make CMakeFiles/rospack_gensrv.dir/build
.PHONY : rospack_gensrv/fast

#=============================================================================
# Target rules for targets named run_tests

# Build rule for target.
run_tests: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 run_tests
.PHONY : run_tests

# fast build rule for target.
run_tests/fast:
	$(MAKE) -f CMakeFiles/run_tests.dir/build.make CMakeFiles/run_tests.dir/build
.PHONY : run_tests/fast

#=============================================================================
# Target rules for targets named test

# Build rule for target.
test: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test
.PHONY : test

# fast build rule for target.
test/fast:
	$(MAKE) -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build
.PHONY : test/fast

#=============================================================================
# Target rules for targets named test-future

# Build rule for target.
test-future: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test-future
.PHONY : test-future

# fast build rule for target.
test-future/fast:
	$(MAKE) -f CMakeFiles/test-future.dir/build.make CMakeFiles/test-future.dir/build
.PHONY : test-future/fast

#=============================================================================
# Target rules for targets named test-results

# Build rule for target.
test-results: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test-results
.PHONY : test-results

# fast build rule for target.
test-results/fast:
	$(MAKE) -f CMakeFiles/test-results.dir/build.make CMakeFiles/test-results.dir/build
.PHONY : test-results/fast

#=============================================================================
# Target rules for targets named test-results-run

# Build rule for target.
test-results-run: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 test-results-run
.PHONY : test-results-run

# fast build rule for target.
test-results-run/fast:
	$(MAKE) -f CMakeFiles/test-results-run.dir/build.make CMakeFiles/test-results-run.dir/build
.PHONY : test-results-run/fast

#=============================================================================
# Target rules for targets named tests

# Build rule for target.
tests: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 tests
.PHONY : tests

# fast build rule for target.
tests/fast:
	$(MAKE) -f CMakeFiles/tests.dir/build.make CMakeFiles/tests.dir/build
.PHONY : tests/fast

#=============================================================================
# Target rules for targets named gtest

# Build rule for target.
gtest: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 gtest
.PHONY : gtest

# fast build rule for target.
gtest/fast:
	$(MAKE) -f gtest/CMakeFiles/gtest.dir/build.make gtest/CMakeFiles/gtest.dir/build
.PHONY : gtest/fast

#=============================================================================
# Target rules for targets named gtest_main

# Build rule for target.
gtest_main: cmake_check_build_system
	$(MAKE) -f CMakeFiles/Makefile2 gtest_main
.PHONY : gtest_main

# fast build rule for target.
gtest_main/fast:
	$(MAKE) -f gtest/CMakeFiles/gtest_main.dir/build.make gtest/CMakeFiles/gtest_main.dir/build
.PHONY : gtest_main/fast

src/RxTx.o: src/RxTx.cpp.o
.PHONY : src/RxTx.o

# target to build an object file
src/RxTx.cpp.o:
	$(MAKE) -f CMakeFiles/RxTx.dir/build.make CMakeFiles/RxTx.dir/src/RxTx.cpp.o
.PHONY : src/RxTx.cpp.o

src/RxTx.i: src/RxTx.cpp.i
.PHONY : src/RxTx.i

# target to preprocess a source file
src/RxTx.cpp.i:
	$(MAKE) -f CMakeFiles/RxTx.dir/build.make CMakeFiles/RxTx.dir/src/RxTx.cpp.i
.PHONY : src/RxTx.cpp.i

src/RxTx.s: src/RxTx.cpp.s
.PHONY : src/RxTx.s

# target to generate assembly for a file
src/RxTx.cpp.s:
	$(MAKE) -f CMakeFiles/RxTx.dir/build.make CMakeFiles/RxTx.dir/src/RxTx.cpp.s
.PHONY : src/RxTx.cpp.s

# Help Target
help:
	@echo "The following are some of the valid targets for this Makefile:"
	@echo "... all (the default if no target is provided)"
	@echo "... clean"
	@echo "... depend"
	@echo "... ROSBUILD_genmsg_cpp"
	@echo "... ROSBUILD_genmsg_lisp"
	@echo "... ROSBUILD_genmsg_py"
	@echo "... ROSBUILD_gensrv_cpp"
	@echo "... ROSBUILD_gensrv_lisp"
	@echo "... RxTx"
	@echo "... _catkin_empty_exported_target"
	@echo "... clean_test_results"
	@echo "... doxygen"
	@echo "... edit_cache"
	@echo "... install"
	@echo "... install/local"
	@echo "... install/strip"
	@echo "... list_install_components"
	@echo "... rebuild_cache"
	@echo "... rosbuild_clean-test-results"
	@echo "... rosbuild_precompile"
	@echo "... rosbuild_premsgsrvgen"
	@echo "... rospack_genmsg"
	@echo "... rospack_genmsg_all"
	@echo "... rospack_genmsg_libexe"
	@echo "... rospack_gensrv"
	@echo "... run_tests"
	@echo "... test"
	@echo "... test-future"
	@echo "... test-results"
	@echo "... test-results-run"
	@echo "... tests"
	@echo "... gtest"
	@echo "... gtest_main"
	@echo "... src/RxTx.o"
	@echo "... src/RxTx.i"
	@echo "... src/RxTx.s"
.PHONY : help

#=============================================================================
# Special targets to cleanup operation of make.

# Special rule to run CMake to check the build system integrity.
# No rule that depends on this can have commands that come from listfiles
# because they might be regenerated.
cmake_check_build_system:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system


text:
/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.airavata.model.workspace;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)")
public class Project implements org.apache.thrift.TBase<Project, Project._Fields>, java.io.Serializable, Cloneable, Comparable<Project> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Project");

  private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectID", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("description", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField SHARED_USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("sharedUsers", org.apache.thrift.protocol.TType.LIST, (short)7);
  private static final org.apache.thrift.protocol.TField SHARED_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("sharedGroups", org.apache.thrift.protocol.TType.LIST, (short)8);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ProjectStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ProjectTupleSchemeFactory();

  private java.lang.String projectID; // required
  private java.lang.String owner; // required
  private java.lang.String gatewayId; // required
  private java.lang.String name; // required
  private java.lang.String description; // optional
  private long creationTime; // optional
  private java.util.List<java.lang.String> sharedUsers; // optional
  private java.util.List<java.lang.String> sharedGroups; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    PROJECT_ID((short)1, "projectID"),
    OWNER((short)2, "owner"),
    GATEWAY_ID((short)3, "gatewayId"),
    NAME((short)4, "name"),
    DESCRIPTION((short)5, "description"),
    CREATION_TIME((short)6, "creationTime"),
    SHARED_USERS((short)7, "sharedUsers"),
    SHARED_GROUPS((short)8, "sharedGroups");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.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: // PROJECT_ID
          return PROJECT_ID;
        case 2: // OWNER
          return OWNER;
        case 3: // GATEWAY_ID
          return GATEWAY_ID;
        case 4: // NAME
          return NAME;
        case 5: // DESCRIPTION
          return DESCRIPTION;
        case 6: // CREATION_TIME
          return CREATION_TIME;
        case 7: // SHARED_USERS
          return SHARED_USERS;
        case 8: // SHARED_GROUPS
          return SHARED_GROUPS;
        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 java.lang.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(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __CREATIONTIME_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DESCRIPTION,_Fields.CREATION_TIME,_Fields.SHARED_USERS,_Fields.SHARED_GROUPS};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectID", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("description", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CREATION_TIME, new org.apache.thrift.meta_data.FieldMetaData("creationTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.SHARED_USERS, new org.apache.thrift.meta_data.FieldMetaData("sharedUsers", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SHARED_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("sharedGroups", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Project.class, metaDataMap);
  }

  public Project() {
    this.projectID = "DO_NOT_SET_AT_CLIENTS";

  }

  public Project(
    java.lang.String projectID,
    java.lang.String owner,
    java.lang.String gatewayId,
    java.lang.String name)
  {
    this();
    this.projectID = projectID;
    this.owner = owner;
    this.gatewayId = gatewayId;
    this.name = name;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public Project(Project other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetProjectID()) {
      this.projectID = other.projectID;
    }
    if (other.isSetOwner()) {
      this.owner = other.owner;
    }
    if (other.isSetGatewayId()) {
      this.gatewayId = other.gatewayId;
    }
    if (other.isSetName()) {
      this.name = other.name;
    }
    if (other.isSetDescription()) {
      this.description = other.description;
    }
    this.creationTime = other.creationTime;
    if (other.isSetSharedUsers()) {
      java.util.List<java.lang.String> __this__sharedUsers = new java.util.ArrayList<java.lang.String>(other.sharedUsers);
      this.sharedUsers = __this__sharedUsers;
    }
    if (other.isSetSharedGroups()) {
      java.util.List<java.lang.String> __this__sharedGroups = new java.util.ArrayList<java.lang.String>(other.sharedGroups);
      this.sharedGroups = __this__sharedGroups;
    }
  }

  public Project deepCopy() {
    return new Project(this);
  }

  @Override
  public void clear() {
    this.projectID = "DO_NOT_SET_AT_CLIENTS";

    this.owner = null;
    this.gatewayId = null;
    this.name = null;
    this.description = null;
    setCreationTimeIsSet(false);
    this.creationTime = 0;
    this.sharedUsers = null;
    this.sharedGroups = null;
  }

  public java.lang.String getProjectID() {
    return this.projectID;
  }

  public void setProjectID(java.lang.String projectID) {
    this.projectID = projectID;
  }

  public void unsetProjectID() {
    this.projectID = null;
  }

  /** Returns true if field projectID is set (has been assigned a value) and false otherwise */
  public boolean isSetProjectID() {
    return this.projectID != null;
  }

  public void setProjectIDIsSet(boolean value) {
    if (!value) {
      this.projectID = null;
    }
  }

  public java.lang.String getOwner() {
    return this.owner;
  }

  public void setOwner(java.lang.String owner) {
    this.owner = owner;
  }

  public void unsetOwner() {
    this.owner = null;
  }

  /** Returns true if field owner is set (has been assigned a value) and false otherwise */
  public boolean isSetOwner() {
    return this.owner != null;
  }

  public void setOwnerIsSet(boolean value) {
    if (!value) {
      this.owner = null;
    }
  }

  public java.lang.String getGatewayId() {
    return this.gatewayId;
  }

  public void setGatewayId(java.lang.String gatewayId) {
    this.gatewayId = gatewayId;
  }

  public void unsetGatewayId() {
    this.gatewayId = null;
  }

  /** Returns true if field gatewayId is set (has been assigned a value) and false otherwise */
  public boolean isSetGatewayId() {
    return this.gatewayId != null;
  }

  public void setGatewayIdIsSet(boolean value) {
    if (!value) {
      this.gatewayId = null;
    }
  }

  public java.lang.String getName() {
    return this.name;
  }

  public void setName(java.lang.String name) {
    this.name = name;
  }

  public void unsetName() {
    this.name = null;
  }

  /** Returns true if field name is set (has been assigned a value) and false otherwise */
  public boolean isSetName() {
    return this.name != null;
  }

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  public java.lang.String getDescription() {
    return this.description;
  }

  public void setDescription(java.lang.String description) {
    this.description = description;
  }

  public void unsetDescription() {
    this.description = null;
  }

  /** Returns true if field description is set (has been assigned a value) and false otherwise */
  public boolean isSetDescription() {
    return this.description != null;
  }

  public void setDescriptionIsSet(boolean value) {
    if (!value) {
      this.description = null;
    }
  }

  public long getCreationTime() {
    return this.creationTime;
  }

  public void setCreationTime(long creationTime) {
    this.creationTime = creationTime;
    setCreationTimeIsSet(true);
  }

  public void unsetCreationTime() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __CREATIONTIME_ISSET_ID);
  }

  /** Returns true if field creationTime is set (has been assigned a value) and false otherwise */
  public boolean isSetCreationTime() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __CREATIONTIME_ISSET_ID);
  }

  public void setCreationTimeIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __CREATIONTIME_ISSET_ID, value);
  }

  public int getSharedUsersSize() {
    return (this.sharedUsers == null) ? 0 : this.sharedUsers.size();
  }

  public java.util.Iterator<java.lang.String> getSharedUsersIterator() {
    return (this.sharedUsers == null) ? null : this.sharedUsers.iterator();
  }

  public void addToSharedUsers(java.lang.String elem) {
    if (this.sharedUsers == null) {
      this.sharedUsers = new java.util.ArrayList<java.lang.String>();
    }
    this.sharedUsers.add(elem);
  }

  public java.util.List<java.lang.String> getSharedUsers() {
    return this.sharedUsers;
  }

  public void setSharedUsers(java.util.List<java.lang.String> sharedUsers) {
    this.sharedUsers = sharedUsers;
  }

  public void unsetSharedUsers() {
    this.sharedUsers = null;
  }

  /** Returns true if field sharedUsers is set (has been assigned a value) and false otherwise */
  public boolean isSetSharedUsers() {
    return this.sharedUsers != null;
  }

  public void setSharedUsersIsSet(boolean value) {
    if (!value) {
      this.sharedUsers = null;
    }
  }

  public int getSharedGroupsSize() {
    return (this.sharedGroups == null) ? 0 : this.sharedGroups.size();
  }

  public java.util.Iterator<java.lang.String> getSharedGroupsIterator() {
    return (this.sharedGroups == null) ? null : this.sharedGroups.iterator();
  }

  public void addToSharedGroups(java.lang.String elem) {
    if (this.sharedGroups == null) {
      this.sharedGroups = new java.util.ArrayList<java.lang.String>();
    }
    this.sharedGroups.add(elem);
  }

  public java.util.List<java.lang.String> getSharedGroups() {
    return this.sharedGroups;
  }

  public void setSharedGroups(java.util.List<java.lang.String> sharedGroups) {
    this.sharedGroups = sharedGroups;
  }

  public void unsetSharedGroups() {
    this.sharedGroups = null;
  }

  /** Returns true if field sharedGroups is set (has been assigned a value) and false otherwise */
  public boolean isSetSharedGroups() {
    return this.sharedGroups != null;
  }

  public void setSharedGroupsIsSet(boolean value) {
    if (!value) {
      this.sharedGroups = null;
    }
  }

  public void setFieldValue(_Fields field, java.lang.Object value) {
    switch (field) {
    case PROJECT_ID:
      if (value == null) {
        unsetProjectID();
      } else {
        setProjectID((java.lang.String)value);
      }
      break;

    case OWNER:
      if (value == null) {
        unsetOwner();
      } else {
        setOwner((java.lang.String)value);
      }
      break;

    case GATEWAY_ID:
      if (value == null) {
        unsetGatewayId();
      } else {
        setGatewayId((java.lang.String)value);
      }
      break;

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((java.lang.String)value);
      }
      break;

    case DESCRIPTION:
      if (value == null) {
        unsetDescription();
      } else {
        setDescription((java.lang.String)value);
      }
      break;

    case CREATION_TIME:
      if (value == null) {
        unsetCreationTime();
      } else {
        setCreationTime((java.lang.Long)value);
      }
      break;

    case SHARED_USERS:
      if (value == null) {
        unsetSharedUsers();
      } else {
        setSharedUsers((java.util.List<java.lang.String>)value);
      }
      break;

    case SHARED_GROUPS:
      if (value == null) {
        unsetSharedGroups();
      } else {
        setSharedGroups((java.util.List<java.lang.String>)value);
      }
      break;

    }
  }

  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case PROJECT_ID:
      return getProjectID();

    case OWNER:
      return getOwner();

    case GATEWAY_ID:
      return getGatewayId();

    case NAME:
      return getName();

    case DESCRIPTION:
      return getDescription();

    case CREATION_TIME:
      return getCreationTime();

    case SHARED_USERS:
      return getSharedUsers();

    case SHARED_GROUPS:
      return getSharedGroups();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case PROJECT_ID:
      return isSetProjectID();
    case OWNER:
      return isSetOwner();
    case GATEWAY_ID:
      return isSetGatewayId();
    case NAME:
      return isSetName();
    case DESCRIPTION:
      return isSetDescription();
    case CREATION_TIME:
      return isSetCreationTime();
    case SHARED_USERS:
      return isSetSharedUsers();
    case SHARED_GROUPS:
      return isSetSharedGroups();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that == null)
      return false;
    if (that instanceof Project)
      return this.equals((Project)that);
    return false;
  }

  public boolean equals(Project that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_projectID = true && this.isSetProjectID();
    boolean that_present_projectID = true && that.isSetProjectID();
    if (this_present_projectID || that_present_projectID) {
      if (!(this_present_projectID && that_present_projectID))
        return false;
      if (!this.projectID.equals(that.projectID))
        return false;
    }

    boolean this_present_owner = true && this.isSetOwner();
    boolean that_present_owner = true && that.isSetOwner();
    if (this_present_owner || that_present_owner) {
      if (!(this_present_owner && that_present_owner))
        return false;
      if (!this.owner.equals(that.owner))
        return false;
    }

    boolean this_present_gatewayId = true && this.isSetGatewayId();
    boolean that_present_gatewayId = true && that.isSetGatewayId();
    if (this_present_gatewayId || that_present_gatewayId) {
      if (!(this_present_gatewayId && that_present_gatewayId))
        return false;
      if (!this.gatewayId.equals(that.gatewayId))
        return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_description = true && this.isSetDescription();
    boolean that_present_description = true && that.isSetDescription();
    if (this_present_description || that_present_description) {
      if (!(this_present_description && that_present_description))
        return false;
      if (!this.description.equals(that.description))
        return false;
    }

    boolean this_present_creationTime = true && this.isSetCreationTime();
    boolean that_present_creationTime = true && that.isSetCreationTime();
    if (this_present_creationTime || that_present_creationTime) {
      if (!(this_present_creationTime && that_present_creationTime))
        return false;
      if (this.creationTime != that.creationTime)
        return false;
    }

    boolean this_present_sharedUsers = true && this.isSetSharedUsers();
    boolean that_present_sharedUsers = true && that.isSetSharedUsers();
    if (this_present_sharedUsers || that_present_sharedUsers) {
      if (!(this_present_sharedUsers && that_present_sharedUsers))
        return false;
      if (!this.sharedUsers.equals(that.sharedUsers))
        return false;
    }

    boolean this_present_sharedGroups = true && this.isSetSharedGroups();
    boolean that_present_sharedGroups = true && that.isSetSharedGroups();
    if (this_present_sharedGroups || that_present_sharedGroups) {
      if (!(this_present_sharedGroups && that_present_sharedGroups))
        return false;
      if (!this.sharedGroups.equals(that.sharedGroups))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetProjectID()) ? 131071 : 524287);
    if (isSetProjectID())
      hashCode = hashCode * 8191 + projectID.hashCode();

    hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287);
    if (isSetOwner())
      hashCode = hashCode * 8191 + owner.hashCode();

    hashCode = hashCode * 8191 + ((isSetGatewayId()) ? 131071 : 524287);
    if (isSetGatewayId())
      hashCode = hashCode * 8191 + gatewayId.hashCode();

    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
    if (isSetName())
      hashCode = hashCode * 8191 + name.hashCode();

    hashCode = hashCode * 8191 + ((isSetDescription()) ? 131071 : 524287);
    if (isSetDescription())
      hashCode = hashCode * 8191 + description.hashCode();

    hashCode = hashCode * 8191 + ((isSetCreationTime()) ? 131071 : 524287);
    if (isSetCreationTime())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(creationTime);

    hashCode = hashCode * 8191 + ((isSetSharedUsers()) ? 131071 : 524287);
    if (isSetSharedUsers())
      hashCode = hashCode * 8191 + sharedUsers.hashCode();

    hashCode = hashCode * 8191 + ((isSetSharedGroups()) ? 131071 : 524287);
    if (isSetSharedGroups())
      hashCode = hashCode * 8191 + sharedGroups.hashCode();

    return hashCode;
  }

  @Override
  public int compareTo(Project other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetProjectID()).compareTo(other.isSetProjectID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetProjectID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectID, other.projectID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOwner()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetGatewayId()).compareTo(other.isSetGatewayId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGatewayId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gatewayId, other.gatewayId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetDescription()).compareTo(other.isSetDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDescription()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.description, other.description);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetCreationTime()).compareTo(other.isSetCreationTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreationTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.creationTime, other.creationTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetSharedUsers()).compareTo(other.isSetSharedUsers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSharedUsers()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sharedUsers, other.sharedUsers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetSharedGroups()).compareTo(other.isSetSharedGroups());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSharedGroups()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sharedGroups, other.sharedGroups);
      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 {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("Project(");
    boolean first = true;

    sb.append("projectID:");
    if (this.projectID == null) {
      sb.append("null");
    } else {
      sb.append(this.projectID);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("owner:");
    if (this.owner == null) {
      sb.append("null");
    } else {
      sb.append(this.owner);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("gatewayId:");
    if (this.gatewayId == null) {
      sb.append("null");
    } else {
      sb.append(this.gatewayId);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (isSetDescription()) {
      if (!first) sb.append(", ");
      sb.append("description:");
      if (this.description == null) {
        sb.append("null");
      } else {
        sb.append(this.description);
      }
      first = false;
    }
    if (isSetCreationTime()) {
      if (!first) sb.append(", ");
      sb.append("creationTime:");
      sb.append(this.creationTime);
      first = false;
    }
    if (isSetSharedUsers()) {
      if (!first) sb.append(", ");
      sb.append("sharedUsers:");
      if (this.sharedUsers == null) {
        sb.append("null");
      } else {
        sb.append(this.sharedUsers);
      }
      first = false;
    }
    if (isSetSharedGroups()) {
      if (!first) sb.append(", ");
      sb.append("sharedGroups:");
      if (this.sharedGroups == null) {
        sb.append("null");
      } else {
        sb.append(this.sharedGroups);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (!isSetProjectID()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectID' is unset! Struct:" + toString());
    }

    if (!isSetOwner()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString());
    }

    if (!isSetGatewayId()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' is unset! Struct:" + toString());
    }

    if (!isSetName()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'name' is unset! Struct:" + toString());
    }

    // 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, java.lang.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 ProjectStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ProjectStandardScheme getScheme() {
      return new ProjectStandardScheme();
    }
  }

  private static class ProjectStandardScheme extends org.apache.thrift.scheme.StandardScheme<Project> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, Project 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: // PROJECT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.projectID = iprot.readString();
              struct.setProjectIDIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // OWNER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.owner = iprot.readString();
              struct.setOwnerIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // GATEWAY_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.gatewayId = iprot.readString();
              struct.setGatewayIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DESCRIPTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.description = iprot.readString();
              struct.setDescriptionIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CREATION_TIME
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.creationTime = iprot.readI64();
              struct.setCreationTimeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SHARED_USERS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.sharedUsers = new java.util.ArrayList<java.lang.String>(_list0.size);
                java.lang.String _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = iprot.readString();
                  struct.sharedUsers.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setSharedUsersIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // SHARED_GROUPS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                struct.sharedGroups = new java.util.ArrayList<java.lang.String>(_list3.size);
                java.lang.String _elem4;
                for (int _i5 = 0; _i5 < _list3.size; ++_i5)
                {
                  _elem4 = iprot.readString();
                  struct.sharedGroups.add(_elem4);
                }
                iprot.readListEnd();
              }
              struct.setSharedGroupsIsSet(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();
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, Project struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.projectID != null) {
        oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
        oprot.writeString(struct.projectID);
        oprot.writeFieldEnd();
      }
      if (struct.owner != null) {
        oprot.writeFieldBegin(OWNER_FIELD_DESC);
        oprot.writeString(struct.owner);
        oprot.writeFieldEnd();
      }
      if (struct.gatewayId != null) {
        oprot.writeFieldBegin(GATEWAY_ID_FIELD_DESC);
        oprot.writeString(struct.gatewayId);
        oprot.writeFieldEnd();
      }
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        oprot.writeString(struct.name);
        oprot.writeFieldEnd();
      }
      if (struct.description != null) {
        if (struct.isSetDescription()) {
          oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
          oprot.writeString(struct.description);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetCreationTime()) {
        oprot.writeFieldBegin(CREATION_TIME_FIELD_DESC);
        oprot.writeI64(struct.creationTime);
        oprot.writeFieldEnd();
      }
      if (struct.sharedUsers != null) {
        if (struct.isSetSharedUsers()) {
          oprot.writeFieldBegin(SHARED_USERS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sharedUsers.size()));
            for (java.lang.String _iter6 : struct.sharedUsers)
            {
              oprot.writeString(_iter6);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.sharedGroups != null) {
        if (struct.isSetSharedGroups()) {
          oprot.writeFieldBegin(SHARED_GROUPS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.sharedGroups.size()));
            for (java.lang.String _iter7 : struct.sharedGroups)
            {
              oprot.writeString(_iter7);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ProjectTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public ProjectTupleScheme getScheme() {
      return new ProjectTupleScheme();
    }
  }

  private static class ProjectTupleScheme extends org.apache.thrift.scheme.TupleScheme<Project> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Project struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.projectID);
      oprot.writeString(struct.owner);
      oprot.writeString(struct.gatewayId);
      oprot.writeString(struct.name);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetDescription()) {
        optionals.set(0);
      }
      if (struct.isSetCreationTime()) {
        optionals.set(1);
      }
      if (struct.isSetSharedUsers()) {
        optionals.set(2);
      }
      if (struct.isSetSharedGroups()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetDescription()) {
        oprot.writeString(struct.description);
      }
      if (struct.isSetCreationTime()) {
        oprot.writeI64(struct.creationTime);
      }
      if (struct.isSetSharedUsers()) {
        {
          oprot.writeI32(struct.sharedUsers.size());
          for (java.lang.String _iter8 : struct.sharedUsers)
          {
            oprot.writeString(_iter8);
          }
        }
      }
      if (struct.isSetSharedGroups()) {
        {
          oprot.writeI32(struct.sharedGroups.size());
          for (java.lang.String _iter9 : struct.sharedGroups)
          {
            oprot.writeString(_iter9);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Project struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.projectID = iprot.readString();
      struct.setProjectIDIsSet(true);
      struct.owner = iprot.readString();
      struct.setOwnerIsSet(true);
      struct.gatewayId = iprot.readString();
      struct.setGatewayIdIsSet(true);
      struct.name = iprot.readString();
      struct.setNameIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.description = iprot.readString();
        struct.setDescriptionIsSet(true);
      }
      if (incoming.get(1)) {
        struct.creationTime = iprot.readI64();
        struct.setCreationTimeIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list10 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.sharedUsers = new java.util.ArrayList<java.lang.String>(_list10.size);
          java.lang.String _elem11;
          for (int _i12 = 0; _i12 < _list10.size; ++_i12)
          {
            _elem11 = iprot.readString();
            struct.sharedUsers.add(_elem11);
          }
        }
        struct.setSharedUsersIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.sharedGroups = new java.util.ArrayList<java.lang.String>(_list13.size);
          java.lang.String _elem14;
          for (int _i15 = 0; _i15 < _list13.size; ++_i15)
          {
            _elem14 = iprot.readString();
            struct.sharedGroups.add(_elem14);
          }
        }
        struct.setSharedGroupsIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}