SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReSTful OSGi Web Applications Tutorial
Khawaja Shams & Jeff Norris
California Institute of Technology, Jet Propulsion Laboratory
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
AGENDA
• Who are we and how did we get here?
• Overview of key technologies
• Brief demo of tutorial application (ReSTBots)
• Tutorial exercises
• Best practices
• Conclusion
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Who are we?
• Developers of spacecraft
operations tools from NASA
• Long-time users of the
Eclipse Rich Client Platform
• Recent users of server-side
Equinox
• New fans of ReSTful web
application development
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
One of our rich client products: Maestro
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
What brought us to ReST & Equinox:
Migrating capabilities to the server
Search results view
plugins: Data
Client Server
Data searcher
Internet
Image view
Time functions
Performance degraded
by poor throughput
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
What brought us to ReST & Equinox:
Migrating capabilities to the server
Search results view
plugins: Data
Client Server
Internet
Image view
Data searcher
Data searcher
Time functions Time functions
Report generation
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Eclipse RCP + Server-side Equinox =
“Tierless Computing”
• Develop many plugins independent of deployment
environment
• Share some capabilities between server and client
• Freely migrate capabilities back and forth as needed
• Use a consistent development environment (Eclipse)
and component model (OSGi) throughout
• Debug clients and servers simultaneously!
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Why not SOAP?
• SOAP and ReST are both viable ways to deploy webapps
• In our experience, ReST services have been easier to develop
and, more importantly, easier for others to use.
• Your mileage may vary!
FLAME WARS
MAY RESULT
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Overview of Key Technologies
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReST and Resource Oriented Architectures
• Applications divided into resources (nouns), not
services (verbs)
• Relies on HTTP methods to define operations on
resources
• Communicate through exchanging representations of
resources : Representational State Transfer
• Stateless and asynchronous (just like HTTP)
Question: How would you make these servlet URLs ReSTful?
http://foobar.com/viewUserDetails?userId=123
http://foobar.com/addNewUser?userId=456&name=“Jeff”&team=“blue”
http://foobar.com/findUsers?nameContains=“Je”
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReST leverages http
• Standard, well-documented protocol for communication between a
client and server
• URIs for everything
 Universal addressability
 Easy linking among resources
• Provides the essential CRUD operations on resources
 PUT, GET, POST, DELETE
• Cacheable
• Easy to use in every programming language (even scripting
languages)
• Easy to test from a web browser (esp. Firefox with Poster plugin)
Question: When should you use POST instead of PUT?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Reporting status from ReSTful applications
• HTTP Status Codes provide a rich, standardized language for
describing the server’s response to a request. Examples:
• Successful Codes (2XX):
 200 OK
 201 Created
 202 Accepted
 204 No Content
• Redirection Codes (3XX):
 301 Moved Permanently
 304 Not Modified
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
• Client Error (4xx)
 400 Bad Request
 401 Unauthorized
 403 Forbidden
 404 Not Found
 405 Method Not Allowed
• Server Errors (5xx)
 500 Internal Server Error
Question: What code would you use to indicate that the client
included invalid characters in the request? To report that the
server ran out of memory? To reject a deletion request?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Equinox / OSGi
• The same plugin model as the RCP
• The same development environment as the RCP
• Inspection of running programs via an interactive
console
• Dynamic extensibility - add new plugins without
restarting server
• Scoping of modules
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Restlet (http://www.restlet.org/)
• API developed by Noelios Consulting
• Streamlines the development of ReSTful webapps
• Addresses some limitations of traditional servlets
 Provides powerful URI mapping and parsing capabilities
 Decouples IO from web applications
Restlet
Router
Restlet
Restlet
Restlet
http request
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Ensemble ReST Framework
• Simply an integration of the Restlet API with Equinox,
developed by NASA
• Allows easy definition of new Restlet Resources via
extension points
• Provides some convenience utilities for handling
requests
• Open source! All code provided in this tutorial will be
available online via the Open Channel Foundation
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Tutorial
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReSTBots
• ReSTBots are simple robot simulations with the following attributes:
 Name
 Position (x,y) - the current location of the ReSTBot
 Goal (x,y) - where the ReSTBot has been commanded to move to
 Direction (x,y) - current drive direction (velocity vector)
• ReSTBots repel each other like identically charged particles
• ReSTBots can be represented in XML
<Restbot name=“Foo”
x=“1” y=“2”
gx=“3” gy=“4”
dx=“.1” dy=“.1”/>
x,y
dx,dy
gx,gy
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReSTBot Server
• ReSTful server containing the following resources:
• http://localhost:8180/restbots RestbotListingResource
 All ReSTBots on the server
• http://localhost:8180/restbots/{name} RestbotResource
 A single named ReSTBot
• http://localhost:8180/restbots/{name}/pic RestbotPictureResource
 The picture for a named ReSTBot
Question: What would you expect to happen if you performed a
PUT on the second resource URL? How would you interpret a
return code of 409 (CONFLICT)?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
ReSTBot execution loops
• ReSTBots execute this loop:
 GET current position and goal
 Compute a new direction and POST it
• The ReSTBot server executes this loop:
 For each ReSTBot:
 Access its current position and direction
 Compute a new position based on the direction
• Other clients can inject new goals for ReSTBots
Yes, there is a synchronization problem here. Correcting it
would have made this tutorial a lot more complicated.!
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Overview of tutorial application
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Tutorial Plugins
• gov.nasa.ensemble.core.restlet
• gov.nasa.ensemble.restbots.client
gov.nasa.ensemble.restbots.common
gov.nasa.ensemble.restbots.server
• org.apache.commons.codec
org.apache.commons.httpclient
org.apache.log4j
org.apache.xalan-j
• org.restlet
Example plugins developed
specifically for this tutorial
Third-party utilities for http,
logging, and XML translation
Ensemble Equinox/ReSTlet System
Noelios ReSTlet API
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Exercise 0: Launch the ReSTBot System
• Switch to “workspace_0”
• Goals:
 Create and start a runtime config for the ReSTBot Server
 Start RestbotClient to visualize the arena
 Start RestbotInstaller to add robots to the arena
• You’ll need this command-line argument:
 -Dorg.eclipse.equinox.http.jetty.http.port=8180
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
1
2
3: Type Name “ReSTBot Server”
4
5
71
6: Scroll down, add
org.eclipse…jetty
8
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
-Dorg.eclipse.equinox.http.jetty.http.port=8180
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Startup Procedure
Start First
Start Second
Start Third
Normal
Startup
Output
First, stop all running applications
!
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
The OSGi Console
• Great tool for managing your OSGi environment
• Allows you to diagnose, install, uninstall, start, stop,
update bundles
• This functionality can be turned on when deploying to
a web application container (@see web.xml)
• Similar functionality available through a web interface:
 Knopflerfish http_console
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Firefox Poster Plugin (Testing)
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Exercise 1
• Switch to “workspace_1”
• Goals:
 Learn how to accept updates to a resource
 Write a client that updates a resource
• Classes to modify:
 gov.nasa.ensemble.restbots.server.RestbotResource
 handlePost() - accept updates to ReSTBot direction and goal
 gov.nasa.ensemble.restbots.common.Restbot
 updateGoal() - POST updated goal based on mouse click in
RestbotClient view
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
@Override
public void handlePost() {
String name = getRequestParameter("name");
Restbot restbot = Restbot.getRestbot(name);
try {
if (restbot == null ) {
//TODO send proper response if restbot is not found
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this name exists");
return;
}
InputStream inputStream = getRequest().getEntity().getStream();
if (restbot.updateFromXML(inputStream)) {
getResponse().setStatus(Status.SUCCESS_OK, "Restbot updated");
} else {
getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, "Check the XML in the body");
}
} catch (ParserConfigurationException e) {
trace.error(e);
getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());
} catch (NumberFormatException nfe) {
trace.error(nfe);
getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, nfe.getMessage());
} catch (IllegalStateException ise){
trace.info(ise);
getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST," The restbot name does in the body does not match
the URI");
} catch (IOException e) {
trace.error(e);
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "IOException while reading from input stream");
}
}
RestbotResource.handlePost()
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Restbot.updateGoal()
/**
* This method is used to update the server about the direction of the
* rover. The server may give consideration to the direction of the rover
* when calculating the new position of the rover. Before updating the
* server, the restbot will calculate its direction based on its current
* position and the goal position.
*/
public void updateGoal() {
Document doc;
HttpClient client = HttpClientUtils.getClient();
PostMethod post = new PostMethod(resbotURI);
try {
doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element restbotElement = doc.createElement("restbot");
doc.appendChild(restbotElement);
restbotElement.setAttribute(Restbot.NAME_ATTR, getName());
restbotElement.setAttribute(Restbot.GOAL_X_ATTR, String.valueOf(getGoalX()));
restbotElement.setAttribute(Restbot.GOAL_Y_ATTR, String.valueOf(getGoalY()));
String docAsStr = Restbot.serializeDocument(doc);
StringRequestEntity requestEntity = new StringRequestEntity(docAsStr, "text/xml", "UTF-8");
post.setRequestEntity(requestEntity);
int resp = client.executeMethod(post);
trace.info("Updated the server with my goal and received response:" + resp);
} catch (ParserConfigurationException e) {
trace.error(e);
} catch (IOException e) {
trace.error(e);
} finally {
post.releaseConnection();
}
}
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Exercise 2 : Your own resource
• Switch to “workspace_2”
• Goals:
 Create, register, and develop a new resource
 Leverage the ReSTlet API for operating on the resource
 Use HTTP status codes
• Tasks:
 Create a new resource
 Register the resource through extension point
 Implement required methods
 Modify client to access the resource
 Add status codes to your resource
 Modify client to interpret and handle status codes
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Adding a new Resource
• Open plugin.xml from gov.nasa.ensemble.restbots.server
• Switch to the Extensions tab
• Right-click on Extension point and add new Resource
• Fill out details
• Recommended class name:
gov.nasa.jpl.maestro.restbots.server.
RestbotPictureResource
• Move new extension point to top
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
RestbotPictureResource.handleGet()
@Override
public void handleGet() {
String restbotName = getRequestParameter("name");
Restbot restbot = Restbot.getRestbot(restbotName);
if (restbot == null) {
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot
with this name exists");
return;
}
byte[] image = restbot.getImageData(false);
if (image == null) {
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "This
restbot does not have a picture");
return;
}
getResponse().setEntity(new ByteArrayRepresentation(image));
}
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
RestbotPictureResource.handlePut()
@Override
public void handlePut() {
String restbotName = getRequestParameter("name");
Restbot restbot = Restbot.getRestbot(restbotName);
if (restbot == null) {
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this
name exists");
return;
}
try {
InputStream stream = getRequest().getEntity().getStream();
ByteArrayOutputStream bout = new ByteArrayOutputStream(stream.available());
byte[] buf = new byte[stream.available()];
int len = 0;
while ((len = stream.read(buf))>= 0){
bout.write(buf, 0, len);
}
restbot.setImageData(bout.toByteArray());
} catch (IOException e) {
trace.error(e);
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());
}
}
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
RestbotPictureResource.handleDelete()
@Override
public void handleDelete() {
String restbotName = getRequestParameter("name");
Restbot restbot = Restbot.getRestbot(restbotName);
if (restbot == null) {
getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot
with this name exists");
return;
}
restbot.setImageData(null);
}
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Tips, Tricks, and Best Practices
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
HTTP Methods
• Safe Methods
 GET
 HEAD
• Idempotent methods
 GET
 HEAD
 PUT
 DELETE
• Unsafe and non-idempotent method:
 POST
Question: Why is this important?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
More on Restlets
• Reslet vs. Resource
• Representations
• Security
 Guards
 Built in authentication schemes: HTTP BASIC, AWS
Authentication, HTTP DIGEST support coming in Restlet 1.1
 Extensibility
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Securing Your Restlets
• Container managed security vs. Restlet Security
• Guards
• Available authentication schemes
• Extending for custom authentication/authorization schemes
• Adding security to Ensemble ReST
• SSL
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Accessing a secured Restlet with HttpClient
• Authentications scheme supported:
 HTTP BASIC
 HTTP DIGEST
 NTLM
• Extensibility
 Custom authentication schemes allowed
 Implement the AuthScheme interface
 Register by invoking AuthPolicy.registerScheme()
• For more information:
 http://hc.apache.org/httpclient-3.x/authentication.html
Alert: Take precautions with custom authentication schemes!!!
!
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Authentication with HttpClient
• Create an AuthScope
• Create and set credentials
Question: Why is the AuthScope Important?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Apache HttpClient Performance
• Use only one client for your entire application
• Application multithreaded?
 Use MultiThreadedHttpConnectionManager
• Release a connection after you are done with EACH
request; eg: get.releaseConnection()
• Request and Response Streaming
 InputStreamRequestEntity
 getResponseBodyAsStream
Question: What if you need numerous simultaneous connections?
?
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Recipe for ReSTful Web Applications
• Identify Resources that you would like to expose
• Address addressability
• Decide which operations should be allowed
• Develop the resources (make extensive use of the
status codes)
• Test and Deploy
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Conclusion
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Ensemble ReST leverages…
Eclipse and OSGi
• Eclipse
 Rapid development with Eclipse (Launch Vehicle)
 Eclipse Debugger
 Test application from within IDE
 Easy export process to production servers
• OSGi
 Modularity in code
 Runtime extensibility
 Changes can be limited to specific modules
 Rapid deployment of modifications
 Minimizes risks when redeploying
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Ensemble ReST leverages …
HTTP and ReST
• HTTP Protocol
 Widely supported
 Programming Languages
 Web Browsers
 Resources are completely decoupled
 Fast performance, especially for binary transfers
 Standardized authentication and encryption schemes
• ReST
 Uniform interface to do operations on resources
 Hierarchical URIs makes writing and consuming sources
more intuitive
 Addressability
 Statelessness is great for performance
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
Key Development Considerations
• How modular is your code base? (OSGi)
• How easy is it to access you application? (ReST)
• How hard is it to debug the application (Eclipse)
• What impact does adding a resource have on:
 Existing clients
 Existing applications
• How can you test your application?
 JUnit
 Firefox Poster Plugin
• How to secure the application and still make it
accessible? (HTTP, SSL)
Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
For more information…
• ReSTful Web Services in Perl
 http://www.onlamp.com/pub/a/onlamp/2008/02/19/developing-
restful-web-services-in-perl.html
• OSGi on the Server Side
 http://dev2dev.bea.com/pub/a/2007/12/osgi-introduction.html
• Poster Plugin:
 https://addons.mozilla.org/en-US/firefox/addon/2691
• RESTful Web Services

Weitere ähnliche Inhalte

Was ist angesagt?

The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web ComponentsAndrew Rota
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSGunnar Hillert
 
MVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieMVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieOPEN KNOWLEDGE GmbH
 
Modularize JavaScript with RequireJS
Modularize JavaScript with RequireJSModularize JavaScript with RequireJS
Modularize JavaScript with RequireJSMinh Hoang
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Azilen Technologies Pvt. Ltd.
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersTeng Shiu Huang
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Michael Kurz
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook reactKeyup
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-SideReza Rahman
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptAkshay Mathur
 
Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)Michael Kurz
 

Was ist angesagt? (20)

The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
Angular beans
Angular beansAngular beans
Angular beans
 
MVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative WebtechnologieMVC 1.0 als alternative Webtechnologie
MVC 1.0 als alternative Webtechnologie
 
Modularize JavaScript with RequireJS
Modularize JavaScript with RequireJSModularize JavaScript with RequireJS
Modularize JavaScript with RequireJS
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
 
Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)Go Fullstack: JSF for Public Sites (CONFESS 2013)
Go Fullstack: JSF for Public Sites (CONFESS 2013)
 
Require.JS
Require.JSRequire.JS
Require.JS
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook react
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Java EE and Spring Side-by-Side
Java EE and Spring Side-by-SideJava EE and Spring Side-by-Side
Java EE and Spring Side-by-Side
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
Object Oriented Programing in JavaScript
Object Oriented Programing in JavaScriptObject Oriented Programing in JavaScript
Object Oriented Programing in JavaScript
 
Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)Go Fullstack: JSF for Public Sites (CONFESS 2012)
Go Fullstack: JSF for Public Sites (CONFESS 2012)
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 

Ähnlich wie RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris

ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...BIOVIA
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptxssuser35fdf2
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSTaiseer Joudeh
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testingrdekleijn
 
2010 code camp rest for the rest of us
2010 code camp   rest for the rest of us2010 code camp   rest for the rest of us
2010 code camp rest for the rest of usKen Yagen
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkFabio Tiriticco
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5Malam Team
 
Criteo meetup - S.R.E Tech Talk
Criteo meetup - S.R.E Tech TalkCriteo meetup - S.R.E Tech Talk
Criteo meetup - S.R.E Tech TalkPierre Mavro
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overviewNicolaas Matthijs
 
Oct meetup open stack 101 clean
Oct meetup open stack 101   cleanOct meetup open stack 101   clean
Oct meetup open stack 101 cleanbenrodrigue
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)Mirantis
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014Sanjay Manwani
 
Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010releasebeta
 
Cloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackCloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackMicrosoft
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018harvraja
 

Ähnlich wie RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris (20)

ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
(ATS6-DEV04) Building Web MashUp applications that include Accelrys Applicati...
 
Fluxible
FluxibleFluxible
Fluxible
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
Build Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJSBuild Modern Web Apps Using ASP.NET Web API and AngularJS
Build Modern Web Apps Using ASP.NET Web API and AngularJS
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testing
 
2010 code camp rest for the rest of us
2010 code camp   rest for the rest of us2010 code camp   rest for the rest of us
2010 code camp rest for the rest of us
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
Criteo meetup - S.R.E Tech Talk
Criteo meetup - S.R.E Tech TalkCriteo meetup - S.R.E Tech Talk
Criteo meetup - S.R.E Tech Talk
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overview
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Oct meetup open stack 101 clean
Oct meetup open stack 101   cleanOct meetup open stack 101   clean
Oct meetup open stack 101 clean
 
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
2 Day Bootcamp for OpenStack--Cloud Training by Mirantis (Preview)
 
MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014MySQL & Oracle Linux Keynote at Open Source India 2014
MySQL & Oracle Linux Keynote at Open Source India 2014
 
Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010Rocking the enterprise with Ruby - RubyKaigi 2010
Rocking the enterprise with Ruby - RubyKaigi 2010
 
Cloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: OpenstackCloud Architect Alliance #15: Openstack
Cloud Architect Alliance #15: Openstack
 
Coherence RoadMap 2018
Coherence RoadMap 2018Coherence RoadMap 2018
Coherence RoadMap 2018
 

Mehr von mfrancis

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...mfrancis
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)mfrancis
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)mfrancis
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruumfrancis
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...mfrancis
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...mfrancis
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...mfrancis
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)mfrancis
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...mfrancis
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)mfrancis
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...mfrancis
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...mfrancis
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)mfrancis
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)mfrancis
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)mfrancis
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...mfrancis
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)mfrancis
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...mfrancis
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)mfrancis
 

Mehr von mfrancis (20)

Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
Eclipse Modeling Framework and plain OSGi the easy way - Mark Hoffman (Data I...
 
OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)OSGi and Java 9+ - BJ Hargrave (IBM)
OSGi and Java 9+ - BJ Hargrave (IBM)
 
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
Simplify Web UX Coding using OSGi Modularity Magic - Paul Fraser (A2Z Living)
 
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank LyaruuOSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
OSGi for the data centre - Connecting OSGi to Kubernetes - Frank Lyaruu
 
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
Remote Management and Monitoring of Distributed OSGi Applications - Tim Verbe...
 
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
OSGi with Docker - a powerful way to develop Java systems - Udo Hafermann (So...
 
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
A real world use case with OSGi R7 - Jurgen Albert (Data In Motion Consulting...
 
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
OSGi Feature Model - Where Art Thou - David Bosschaert (Adobe)
 
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
Migrating from PDE to Bndtools in Practice - Amit Kumar Mondal (Deutsche Tele...
 
OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)OSGi CDI Integration Specification - Ray Augé (Liferay)
OSGi CDI Integration Specification - Ray Augé (Liferay)
 
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
How OSGi drives cross-sector energy management - Jörn Tümmler (SMA Solar Tech...
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
It Was Twenty Years Ago Today - Building an OSGi based Smart Home System - Ch...
 
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)Popular patterns revisited on OSGi - Christian Schneider (Adobe)
Popular patterns revisited on OSGi - Christian Schneider (Adobe)
 
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
Integrating SLF4J and the new OSGi LogService 1.4 - BJ Hargrave (IBM)
 
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
OSG(a)i: because AI needs a runtime - Tim Verbelen (imec)
 
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
Flying to Jupiter with OSGi - Tony Walsh (ESA) & Hristo Indzhov (Telespazio V...
 
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
MicroProfile, OSGi was meant for this - Ray Auge (Liferay)
 
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
Prototyping IoT systems with a hybrid OSGi & Node-RED platform - Bruce Jackso...
 
How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)How to connect your OSGi application - Dirk Fauth (Bosch)
How to connect your OSGi application - Dirk Fauth (Bosch)
 

Kürzlich hochgeladen

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Kürzlich hochgeladen (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

RESTful OSGi Web Applications Tutorial - Khawaja S Shams & Jeff Norris

  • 1. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReSTful OSGi Web Applications Tutorial Khawaja Shams & Jeff Norris California Institute of Technology, Jet Propulsion Laboratory
  • 2. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris AGENDA • Who are we and how did we get here? • Overview of key technologies • Brief demo of tutorial application (ReSTBots) • Tutorial exercises • Best practices • Conclusion
  • 3. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Who are we? • Developers of spacecraft operations tools from NASA • Long-time users of the Eclipse Rich Client Platform • Recent users of server-side Equinox • New fans of ReSTful web application development
  • 4. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris One of our rich client products: Maestro
  • 5. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris What brought us to ReST & Equinox: Migrating capabilities to the server Search results view plugins: Data Client Server Data searcher Internet Image view Time functions Performance degraded by poor throughput
  • 6. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris What brought us to ReST & Equinox: Migrating capabilities to the server Search results view plugins: Data Client Server Internet Image view Data searcher Data searcher Time functions Time functions Report generation
  • 7. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Eclipse RCP + Server-side Equinox = “Tierless Computing” • Develop many plugins independent of deployment environment • Share some capabilities between server and client • Freely migrate capabilities back and forth as needed • Use a consistent development environment (Eclipse) and component model (OSGi) throughout • Debug clients and servers simultaneously!
  • 8. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Why not SOAP? • SOAP and ReST are both viable ways to deploy webapps • In our experience, ReST services have been easier to develop and, more importantly, easier for others to use. • Your mileage may vary! FLAME WARS MAY RESULT
  • 9. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Overview of Key Technologies
  • 10. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReST and Resource Oriented Architectures • Applications divided into resources (nouns), not services (verbs) • Relies on HTTP methods to define operations on resources • Communicate through exchanging representations of resources : Representational State Transfer • Stateless and asynchronous (just like HTTP) Question: How would you make these servlet URLs ReSTful? http://foobar.com/viewUserDetails?userId=123 http://foobar.com/addNewUser?userId=456&name=“Jeff”&team=“blue” http://foobar.com/findUsers?nameContains=“Je” ?
  • 11. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReST leverages http • Standard, well-documented protocol for communication between a client and server • URIs for everything  Universal addressability  Easy linking among resources • Provides the essential CRUD operations on resources  PUT, GET, POST, DELETE • Cacheable • Easy to use in every programming language (even scripting languages) • Easy to test from a web browser (esp. Firefox with Poster plugin) Question: When should you use POST instead of PUT? ?
  • 12. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Reporting status from ReSTful applications • HTTP Status Codes provide a rich, standardized language for describing the server’s response to a request. Examples: • Successful Codes (2XX):  200 OK  201 Created  202 Accepted  204 No Content • Redirection Codes (3XX):  301 Moved Permanently  304 Not Modified See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html • Client Error (4xx)  400 Bad Request  401 Unauthorized  403 Forbidden  404 Not Found  405 Method Not Allowed • Server Errors (5xx)  500 Internal Server Error Question: What code would you use to indicate that the client included invalid characters in the request? To report that the server ran out of memory? To reject a deletion request? ?
  • 13. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Equinox / OSGi • The same plugin model as the RCP • The same development environment as the RCP • Inspection of running programs via an interactive console • Dynamic extensibility - add new plugins without restarting server • Scoping of modules
  • 14. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Restlet (http://www.restlet.org/) • API developed by Noelios Consulting • Streamlines the development of ReSTful webapps • Addresses some limitations of traditional servlets  Provides powerful URI mapping and parsing capabilities  Decouples IO from web applications Restlet Router Restlet Restlet Restlet http request
  • 15. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Ensemble ReST Framework • Simply an integration of the Restlet API with Equinox, developed by NASA • Allows easy definition of new Restlet Resources via extension points • Provides some convenience utilities for handling requests • Open source! All code provided in this tutorial will be available online via the Open Channel Foundation
  • 16. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Tutorial
  • 17. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReSTBots • ReSTBots are simple robot simulations with the following attributes:  Name  Position (x,y) - the current location of the ReSTBot  Goal (x,y) - where the ReSTBot has been commanded to move to  Direction (x,y) - current drive direction (velocity vector) • ReSTBots repel each other like identically charged particles • ReSTBots can be represented in XML <Restbot name=“Foo” x=“1” y=“2” gx=“3” gy=“4” dx=“.1” dy=“.1”/> x,y dx,dy gx,gy
  • 18. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReSTBot Server • ReSTful server containing the following resources: • http://localhost:8180/restbots RestbotListingResource  All ReSTBots on the server • http://localhost:8180/restbots/{name} RestbotResource  A single named ReSTBot • http://localhost:8180/restbots/{name}/pic RestbotPictureResource  The picture for a named ReSTBot Question: What would you expect to happen if you performed a PUT on the second resource URL? How would you interpret a return code of 409 (CONFLICT)? ?
  • 19. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris ReSTBot execution loops • ReSTBots execute this loop:  GET current position and goal  Compute a new direction and POST it • The ReSTBot server executes this loop:  For each ReSTBot:  Access its current position and direction  Compute a new position based on the direction • Other clients can inject new goals for ReSTBots Yes, there is a synchronization problem here. Correcting it would have made this tutorial a lot more complicated.!
  • 20. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Overview of tutorial application
  • 21. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Tutorial Plugins • gov.nasa.ensemble.core.restlet • gov.nasa.ensemble.restbots.client gov.nasa.ensemble.restbots.common gov.nasa.ensemble.restbots.server • org.apache.commons.codec org.apache.commons.httpclient org.apache.log4j org.apache.xalan-j • org.restlet Example plugins developed specifically for this tutorial Third-party utilities for http, logging, and XML translation Ensemble Equinox/ReSTlet System Noelios ReSTlet API
  • 22. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Exercise 0: Launch the ReSTBot System • Switch to “workspace_0” • Goals:  Create and start a runtime config for the ReSTBot Server  Start RestbotClient to visualize the arena  Start RestbotInstaller to add robots to the arena • You’ll need this command-line argument:  -Dorg.eclipse.equinox.http.jetty.http.port=8180
  • 23. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris 1 2 3: Type Name “ReSTBot Server” 4 5 71 6: Scroll down, add org.eclipse…jetty 8
  • 24. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris -Dorg.eclipse.equinox.http.jetty.http.port=8180
  • 25. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Startup Procedure Start First Start Second Start Third Normal Startup Output First, stop all running applications !
  • 26. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris The OSGi Console • Great tool for managing your OSGi environment • Allows you to diagnose, install, uninstall, start, stop, update bundles • This functionality can be turned on when deploying to a web application container (@see web.xml) • Similar functionality available through a web interface:  Knopflerfish http_console
  • 27. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Firefox Poster Plugin (Testing)
  • 28. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Exercise 1 • Switch to “workspace_1” • Goals:  Learn how to accept updates to a resource  Write a client that updates a resource • Classes to modify:  gov.nasa.ensemble.restbots.server.RestbotResource  handlePost() - accept updates to ReSTBot direction and goal  gov.nasa.ensemble.restbots.common.Restbot  updateGoal() - POST updated goal based on mouse click in RestbotClient view
  • 29. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris @Override public void handlePost() { String name = getRequestParameter("name"); Restbot restbot = Restbot.getRestbot(name); try { if (restbot == null ) { //TODO send proper response if restbot is not found getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this name exists"); return; } InputStream inputStream = getRequest().getEntity().getStream(); if (restbot.updateFromXML(inputStream)) { getResponse().setStatus(Status.SUCCESS_OK, "Restbot updated"); } else { getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, "Check the XML in the body"); } } catch (ParserConfigurationException e) { trace.error(e); getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage()); } catch (NumberFormatException nfe) { trace.error(nfe); getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST, nfe.getMessage()); } catch (IllegalStateException ise){ trace.info(ise); getResponse().setStatus(Status.CLIENT_ERROR_BAD_REQUEST," The restbot name does in the body does not match the URI"); } catch (IOException e) { trace.error(e); getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, "IOException while reading from input stream"); } } RestbotResource.handlePost()
  • 30. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Restbot.updateGoal() /** * This method is used to update the server about the direction of the * rover. The server may give consideration to the direction of the rover * when calculating the new position of the rover. Before updating the * server, the restbot will calculate its direction based on its current * position and the goal position. */ public void updateGoal() { Document doc; HttpClient client = HttpClientUtils.getClient(); PostMethod post = new PostMethod(resbotURI); try { doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Element restbotElement = doc.createElement("restbot"); doc.appendChild(restbotElement); restbotElement.setAttribute(Restbot.NAME_ATTR, getName()); restbotElement.setAttribute(Restbot.GOAL_X_ATTR, String.valueOf(getGoalX())); restbotElement.setAttribute(Restbot.GOAL_Y_ATTR, String.valueOf(getGoalY())); String docAsStr = Restbot.serializeDocument(doc); StringRequestEntity requestEntity = new StringRequestEntity(docAsStr, "text/xml", "UTF-8"); post.setRequestEntity(requestEntity); int resp = client.executeMethod(post); trace.info("Updated the server with my goal and received response:" + resp); } catch (ParserConfigurationException e) { trace.error(e); } catch (IOException e) { trace.error(e); } finally { post.releaseConnection(); } }
  • 31. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Exercise 2 : Your own resource • Switch to “workspace_2” • Goals:  Create, register, and develop a new resource  Leverage the ReSTlet API for operating on the resource  Use HTTP status codes • Tasks:  Create a new resource  Register the resource through extension point  Implement required methods  Modify client to access the resource  Add status codes to your resource  Modify client to interpret and handle status codes
  • 32. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Adding a new Resource • Open plugin.xml from gov.nasa.ensemble.restbots.server • Switch to the Extensions tab • Right-click on Extension point and add new Resource • Fill out details • Recommended class name: gov.nasa.jpl.maestro.restbots.server. RestbotPictureResource • Move new extension point to top
  • 33. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris RestbotPictureResource.handleGet() @Override public void handleGet() { String restbotName = getRequestParameter("name"); Restbot restbot = Restbot.getRestbot(restbotName); if (restbot == null) { getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this name exists"); return; } byte[] image = restbot.getImageData(false); if (image == null) { getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "This restbot does not have a picture"); return; } getResponse().setEntity(new ByteArrayRepresentation(image)); }
  • 34. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris RestbotPictureResource.handlePut() @Override public void handlePut() { String restbotName = getRequestParameter("name"); Restbot restbot = Restbot.getRestbot(restbotName); if (restbot == null) { getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this name exists"); return; } try { InputStream stream = getRequest().getEntity().getStream(); ByteArrayOutputStream bout = new ByteArrayOutputStream(stream.available()); byte[] buf = new byte[stream.available()]; int len = 0; while ((len = stream.read(buf))>= 0){ bout.write(buf, 0, len); } restbot.setImageData(bout.toByteArray()); } catch (IOException e) { trace.error(e); getResponse().setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage()); } }
  • 35. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris RestbotPictureResource.handleDelete() @Override public void handleDelete() { String restbotName = getRequestParameter("name"); Restbot restbot = Restbot.getRestbot(restbotName); if (restbot == null) { getResponse().setStatus(Status.CLIENT_ERROR_NOT_FOUND, "No restbot with this name exists"); return; } restbot.setImageData(null); }
  • 36. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Tips, Tricks, and Best Practices
  • 37. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris HTTP Methods • Safe Methods  GET  HEAD • Idempotent methods  GET  HEAD  PUT  DELETE • Unsafe and non-idempotent method:  POST Question: Why is this important? ?
  • 38. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris More on Restlets • Reslet vs. Resource • Representations • Security  Guards  Built in authentication schemes: HTTP BASIC, AWS Authentication, HTTP DIGEST support coming in Restlet 1.1  Extensibility
  • 39. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Securing Your Restlets • Container managed security vs. Restlet Security • Guards • Available authentication schemes • Extending for custom authentication/authorization schemes • Adding security to Ensemble ReST • SSL
  • 40. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris
  • 41. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Accessing a secured Restlet with HttpClient • Authentications scheme supported:  HTTP BASIC  HTTP DIGEST  NTLM • Extensibility  Custom authentication schemes allowed  Implement the AuthScheme interface  Register by invoking AuthPolicy.registerScheme() • For more information:  http://hc.apache.org/httpclient-3.x/authentication.html Alert: Take precautions with custom authentication schemes!!! !
  • 42. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Authentication with HttpClient • Create an AuthScope • Create and set credentials Question: Why is the AuthScope Important? ?
  • 43. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Apache HttpClient Performance • Use only one client for your entire application • Application multithreaded?  Use MultiThreadedHttpConnectionManager • Release a connection after you are done with EACH request; eg: get.releaseConnection() • Request and Response Streaming  InputStreamRequestEntity  getResponseBodyAsStream Question: What if you need numerous simultaneous connections? ?
  • 44. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Recipe for ReSTful Web Applications • Identify Resources that you would like to expose • Address addressability • Decide which operations should be allowed • Develop the resources (make extensive use of the status codes) • Test and Deploy
  • 45. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Conclusion
  • 46. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Ensemble ReST leverages… Eclipse and OSGi • Eclipse  Rapid development with Eclipse (Launch Vehicle)  Eclipse Debugger  Test application from within IDE  Easy export process to production servers • OSGi  Modularity in code  Runtime extensibility  Changes can be limited to specific modules  Rapid deployment of modifications  Minimizes risks when redeploying
  • 47. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Ensemble ReST leverages … HTTP and ReST • HTTP Protocol  Widely supported  Programming Languages  Web Browsers  Resources are completely decoupled  Fast performance, especially for binary transfers  Standardized authentication and encryption schemes • ReST  Uniform interface to do operations on resources  Hierarchical URIs makes writing and consuming sources more intuitive  Addressability  Statelessness is great for performance
  • 48. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris Key Development Considerations • How modular is your code base? (OSGi) • How easy is it to access you application? (ReST) • How hard is it to debug the application (Eclipse) • What impact does adding a resource have on:  Existing clients  Existing applications • How can you test your application?  JUnit  Firefox Poster Plugin • How to secure the application and still make it accessible? (HTTP, SSL)
  • 49. Ensemble ReST | ReSTful OSGi Web Applications Tutorial| © 2008 by Khawaja Shams, Jeff Norris For more information… • ReSTful Web Services in Perl  http://www.onlamp.com/pub/a/onlamp/2008/02/19/developing- restful-web-services-in-perl.html • OSGi on the Server Side  http://dev2dev.bea.com/pub/a/2007/12/osgi-introduction.html • Poster Plugin:  https://addons.mozilla.org/en-US/firefox/addon/2691 • RESTful Web Services