good fences make good neighbors 1 middleware for aleph’s rest api rich wenger, e-resource systems...

22
Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall” Collected Poems of Robert Frost. New York, Henry Holt and Co., 1930. 47. Print

Upload: yuliana-orris

Post on 14-Dec-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Good Fences Make Good Neighbors1

Middleware for Aleph’s REST API

Rich Wenger, E-resource Systems Manager

MIT Libraries1. Frost, Robert. “Mending Wall” Collected Poems of Robert Frost. New York, Henry Holt and Co., 1930. 47. Print

Page 2: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Agenda

1. Short review of Aleph XML APIs

2. What is the API adapter?

3. Why did we build it?

4. Design criteria

5. How does it work?

6. Use cases

Aleph IGeLU 2014Page 2

Page 3: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Aleph XML APIs: X-server

1. http://walter.mit.edu/X?op=bor-info&library=mit50&[email protected]

2. http://walter.mit.edu/X?op=bor-by-key&[email protected]

Aleph IGeLU 2014Page 3

Page 4: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Aleph XML APIs: REST*

1. http://walter.mit.edu:1891/rest-dlf/patron/50481/circulationActions/loans

2. http://walter.mit.edu:1891/rest-dlf/patron/164423/circulationActions/cash

* REpresentational State Transfer - rest-web-services

Aleph IGeLU 2014Page 4

Page 5: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Aleph XML APIs

Aleph IGeLU 2014Page 5

AlephREST API External system

Standard access configuration

Page 6: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

What is the API adapter?

1. A thin layer of programming between the Aleph REST API and external systems that use the API.

2. A Perl program that runs from Aleph’s cgi-bin directory.

Aleph IGeLU 2014Page 6

Page 7: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

What is the API adapter?

Aleph IGeLU 2014Page 7

AlephREST API

External system

Adapter

Access configuration with adapter installed

Page 8: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Why did we build it?

To insulate Aleph and the calling system from each other, particularly in the case of a competing vendor. The software reflects the business model.

To provide an avenue for problem circumvention that does not depend on either Aleph or the calling system.

Aleph IGeLU 2014Page 8

Page 9: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Why did we build it?

To minimize the latency of network traffic by bringing multiple calls to the API inboard on the Aleph server instead of extending them across the network.

APIs change over time and between releases.  An intermediate layer can mask such changes unless or until they prove useful.

Aleph IGeLU 2014Page 9

Page 10: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Why did we build it?

Simplifies access control. There is one place to whitelist external servers instead of multiple Aleph configuration files.

Provides the flexibility to augment Aleph data from other local systems if so desired.

Aleph IGeLU 2014Page 10

Page 11: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Design – the adapter should..

Integrate easily into the Aleph server environment.

Have a small footprint and be unobtrusive in its operation.

Return results ~identical to those generated by the Aleph REST API. before and after

Aleph IGeLU 2014Page 11

Page 12: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Design – the adapter should..

Not interfere in any way with the standard use of the Aleph REST API through the Tomcat/JBOSS server and port.

Consume Aleph REST API URL syntax without modification.

Aleph IGeLU 2014Page 12

Page 13: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Design – the adapter should..

Function in a transparent pass-through mode for all REST API services except for those intentionally modified by the host site.

Aleph IGeLU 2014Page 13

Page 14: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

How does it work?

The adapter uses an Apache rewrite rule to direct REST URLs to itself running on port 80.

The external system sends its REST calls to port 80 instead of 1891.

The adapter parses the incoming URL and sends the request to the Aleph REST API via ‘localhost’.

Output from the REST API is passed back to the caller after any desired processing.

Aleph IGeLU 2014Page 14

Page 15: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Use case 1, ID translation

For patron functions, the REST API requires the patron’s Aleph id. Few, if any, authentication systems return an Aleph id as an identifier.

The REST API has no function to convert an alias to the corresponding Aleph id, but the X-server does.

This forces calling systems to use two calls across the network instead of one, and two different API’s.

Aleph IGeLU 2014Page 15

Page 16: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

External System

Aleph server

JBOSS REST APIPort 1891

ApachePorts 80, 443

Calls to Aleph REST API without the adapter installed. Two calls.

X-serverAPI

http://walter.mit.edu/X?op=bor-by-key&[email protected]

50481 http://walter.mit.edu:1891/rest-dlf/patron/XML

Page 17: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

External System

Aleph server

JBOSS REST APIPort 1891

ApachePorts 80, 443

Calls to Aleph REST API with the adapter installed in passive mode. Two calls.

X-serverAPI

http://walter.mit.edu/X?op=bor-by-key&[email protected]

50481 http://walter.mit.edu/rest-dlf/patron/XML

Adapter

Page 18: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

External System

Calls to Aleph REST API with the adapter installed and using the X-server transparently. One call.

http://walter.mit.edu:1891/rest-dlf/patron/[email protected]

XML

Aleph server

ApacheRewrite rule

AdapterJBOSS REST API

Port 1891X-serverAPI

Page 19: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Use case 2, data filtering

When using the adapter with the X-server.

The bor-info method returns historical data, including paid fines.

The adapter can filter paid fines from the response XML.

Aleph IGeLU 2014Page 19

Page 20: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Good Fences Make Good Neighbors

Aleph IGeLU 2014Page 20

AlephREST API

External system

Maintain control of the terrain where systems meet.

Page 21: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Useful Links

REST architecturehttp://www.slideshare.net/cebartling/rest-web-services

Aleph REST APIhttps://developers.exlibrisgroup.com/aleph/apis/Aleph-RESTful-APIs

Aleph X-serverhttps://developers.exlibrisgroup.com/aleph/apis/Aleph-X-Services

Ex Libris Developer Networkhttps://developers.exlibrisgroup.com/

Aleph IGeLU 2014Page 21

Page 22: Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource Systems Manager MIT Libraries 1. Frost, Robert. “Mending Wall”

Finis

Rich Wenger [email protected]

Phone 617-253-0035

Fax 617-253-4462

Aleph IGeLU 2014Page 22