Skip to content

Server #23

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

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

Server #23

wants to merge 21 commits into from

Conversation

LeanderK
Copy link
Contributor

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

please visit intellimate/Izou#52 for further information about the motivation.

This pull request introduces the package server to the SDK which contains an simple rest-compatible server-framework used for answering requests from the router.

package server:

  • BadRequestException: this exception can be thrown inside the routing-handlers to signal an BadRequest (400)
  • DefaultHandler: the default implementation of the Handler-interface which checks for the correct method on handle
  • Handler: the handler is a simple functional interface called by Route when the route matches, it can either return an response or declare itself for responsible
  • HandlerHelper: contains various utility methods for handling requests
  • InternalServerErrorException: his exception can be thrown inside the routing-handlers to signal an InternalServerError (500)
  • Method: this enum represents the different commonly used methods for http-requests
  • NotFoundException: this exception can be thrown inside the routing-handlers to signal an NotFound (404)
  • Request: this class implements the Request interface from Izou and extends it with various useful functionality
  • Response: an Response implementation and various useful methods
  • Route: this class represents a single route in the Router, e.g. /static
  • Router: this class gets called in the sdk when an request from the server was made. The Add-on can specify multiple routes and error-handlers and the router processes the request accordingly.
  • SDKRouter: the Router for the SDK, it also serves as an example-implementation. It servers an static html file on index and provides an html file used to render the properties-files for other addons on /template/properties
  • PropertiesRouter: the default Router for addons. It forwards calls on / oder /index.html to /template/properties of the SDK with some query parameters to populate the template. It also has an endpoint for the actual properties-file and a (optional) markdown description of it which will be rendered by /template/properties from the SDK.

package util:

  • ResourceUser: clarified TODO

package add-on

  • AddOn: updated to the new interface wich includes the handling of requests and links it to the default implementation (PropertiesRouter)

package sdk:
changes:

  • Context: reflected changes in the Interface specified in Izou

added:

  • AddOnImpl: the SDK now needs an AddonImplementation to serve the http-requests.

some non-java changes:
added the necessary html-files to the resources folder and updated the pom.xml

@LeanderK
Copy link
Contributor Author

there are some small things to fix, but it is largely done

@LeanderK LeanderK mentioned this pull request Jun 7, 2016
@LeanderK
Copy link
Contributor Author

LeanderK commented Jun 9, 2016

mostly tested and done

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.

1 participant