Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server communication #52

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open

Server communication #52

wants to merge 92 commits into from

Conversation

LeanderK
Copy link
Contributor

@LeanderK LeanderK commented May 29, 2016

This pull-request adds full support for the upcoming cloud-infrastructure

Motivation:

With this pull request Izou is able to respond to request from the server and automatically download/update itself and the apps. The related issue is #19.
It introduces 3 new packages, server, config, org.intellimate.server.proto and adds needed functionality to existing ones:

package server:
  • CommunicationManager: this class servers as the interface for other packages and provides a small API to deal with the server-communication.
  • DelegatingInputstream: A InputStream that has does nothing on close(), it is used for as the InputStream for the Request since we don't want anybody to close our socket connection after reading from the input
  • Request: The Interface for the Requests coming from the server to Izou (maybe originating from an http-connection to the server). This interface is AddonAccessible
  • RequestImpl: The implementation for the Request interface.
  • RequestHandler: this class is responsible for the handling of the Requests from the server. It answers the request intended for izou (get/patch of state, get/patch/put of AddOns etc.) and delegates to the AddOns if requested.
  • Response: the interface for the Response to an Request from the server. This interface is AddonAccessible.
  • ResponseImpl: The Implementation of the Response interface used for the Responses originating from izou and not the addons
  • ServerRequestHandler: The Functional Interface used in ServerRequest to dynamically bind handlers
  • ServerRequests: Here the actual communication with the Server happens. Requests from the Server get deserialised and responses serialised. It also contains various methods for normal http-request to the server used in other packages.
  • SSLCertificateHelper: This class is needed because java does not trust out lets-encrypt certificate yet, it alters the keystone and adds the needed certificate on startup
package org.intellimate.server.proto:

This class contains the compiled prototbuf-files which specify the communication with the server

package config:
  • AddOn: the representation of AddOns for the internal-config file
  • Config: the representation of the Config file. This file should be created/edited by the user and contains a few entries to fully configure izou (for example the refresh-token).
  • InternalConfig: the internal configuration used to persist the selected Addons and the state for restart
  • Version: a simple version class used for interacting with the addons in the internal-config file
package addon:

added:

  • AddOnFileManager: this class is has methods used to get information about the addOn-files (getInstalled, getScheduledToInstall, getScheduledToDelete etc.)
  • SynchronizationManager: this class is responsible for the synchronisation of the AddOns. It takes the selected Addons, then builds the dependency tree and compares that to the installed addons. If there is a new one available it downloads the add-on or creates an entry for future deletion. It also copies the new addons/delete unnecessary ones on startup.

changed:

  • AddOnManager: integrated the functionality from the SynchronizationManager and exposes a clean interface for the new functionality for other packages
package identification:
  • AddOnInformationImpl: improved code quality
  • AddOnInformationManager: integrated information obtained from the internal-config file into the AddOnInformationManager
  • IdentificationManagerImpl: improved code quality
package main:

added:

  • IzouSynchronization: contains the code to query & download new Izou versions
  • UpdateManager: used to bundle the necessary function calls for the update-functionality in one place and provide one clean interface

changed:

  • Main: updated the startup-procedure to incorporate the new sub-systems
package system:

added:

  • ServerInformation: exposes information about the communication with the server to the addons

changed:

  • Context: integrated the new interface ServerInformation
  • FileSystemManager: adds the new newLib directory where the new versions for the addons get downloaded to
  • ContextImplementation: adapted to the changes specified above
non-java changes:

added needed certificates to the resources which are needed to convince java that letsencrypt-certificates are safe.
There are 2 config-files: izou.yml and internal.yml. Only izou.yml is expected to be present on startup and should be edited by the user.
The maven pom was updated, some new dependencies were added.

@LeanderK
Copy link
Contributor Author

I did some breaking changes since i last tested it, so no merge yet.
Also some documentation is lacking for a few classes

@LeanderK LeanderK force-pushed the server_communication branch from e069319 to d2641b0 Compare May 31, 2016 15:35
@jundl77
Copy link
Member

jundl77 commented Jun 1, 2016

Ok not bad overall, but you do know that there was an izou.properties file before that was supposed to be the config file for izou (that is why you sometimes got the error, not fully configuered yet, izou is quitting). So do you wanna remove that? Both seem redundant.

@LeanderK
Copy link
Contributor Author

LeanderK commented Jun 9, 2016

it is mostly done

@LeanderK
Copy link
Contributor Author

@jundl77 i think this is ready to merge now

@jundl77
Copy link
Member

jundl77 commented Jun 10, 2016

Did you remove the izou properties stuff?

@LeanderK
Copy link
Contributor Author

i don't have Izou-properties in my repo...i think. Where is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants