Files and Libraries

The following files and libraries are available:

Java Client Library

Created Aug 28, 2015 8:01:44 PM

Introduction

The Java client-side library is used to access the Web service API for this application.

The JAX-WS client-side library is used to provide the set of Java objects that can be serialized to/from XML using JAXB. This is useful for accessing the REST endpoints that are published by this application.

REST Example (Raw JAXB)

java.net.URL url = new java.net.URL(baseURL + "/metastore/databases"); JAXBContext context = JAXBContext.newInstance( StringList.class ); java.net.URLConnection connection = url.openConnection(); connection.connect(); Unmarshaller unmarshaller = context.createUnmarshaller(); StringList result = (StringList) unmarshaller.unmarshal( connection.getInputStream() ); //handle the result as needed...

REST Example (Jersey client)

com.sun.jersey.api.client.Client client = com.sun.jersey.api.client.Client.create(); StringList result = client.resource(baseUrl + "/metastore/databases") .get(StringList.class); //handle the result as needed...

Files

name size description
lens-client.jar 32.05K The binaries for the Java client library.
lens-client-sources.jar 17.06K The sources for the Java client library.

Java JSON Client Library

Created Aug 28, 2015 8:01:44 PM

Introduction

The Java client-side library is used to provide the set of Java objects that can be serialized to/from JSON using Jackson. This is useful for accessing the JSON REST endpoints that are published by this application.

REST Example (Raw Jackson)

java.net.URL url = new java.net.URL(baseURL + "/metastore/databases"); ObjectMapper mapper = new ObjectMapper(); java.net.URLConnection connection = url.openConnection(); connection.connect(); StringList result = (StringList) mapper.readValue( connection.getInputStream(), StringList.class ); //handle the result as needed...

Files

name size description
lens-json-client.jar 22.71K The binaries for the Java JSON client library.
lens-json-client-sources.jar 15.57K The sources for the Java JSON client library.

PHP Client Library

Created Aug 28, 2015 8:01:39 PM

Introduction

The PHP client-side library defines the PHP classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library requires the json_encode function which was included in PHP versions 5.2.0+.

Files

name size
lens.php 64.86K

Ruby Client Library

Created Aug 28, 2015 8:01:40 PM

Introduction

The Ruby client-side library defines the Ruby classes that can be (de)serialized to/from JSON. This is useful for accessing the REST endpoints that are published by this application, but only those that produce a JSON representation of their resources (content type "application/json").

This library leverages the Ruby JSON Implementation, which is required in order to use this library.

JSON REST Example

require 'net/https' require 'uri' //... //read a resource from a REST url url = URI.parse("...") request = Net::HTTP::Get.new(url.request_uri) http = Net::HTTP.new(url.host, url.port) //set up additional http stuff... res = http.start do |ht| ht.request(request) end result = StringList.from_json(JSON.parse(res.body)) //handle the result as needed...

Files

name size
lens.rb 36.56K