Good Fences Make Good Neighbors 1 Middleware for

  • Slides: 22
Download presentation
Good Fences Make Good Neighbors 1 Middleware for Aleph’s REST API Rich Wenger, E-resource

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

Agenda 1. Short review of Aleph XML APIs 2. What is the API adapter?

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 IGe. LU 2014 Page 2

Aleph XML APIs: X-server 1. http: //walter. mit. edu/X? op=bor-info&library=mit 50&bor_id=rwenger@mit. edu 2. http:

Aleph XML APIs: X-server 1. http: //walter. mit. edu/X? op=bor-info&library=mit 50&[email protected] edu 2. http: //walter. mit. edu/X? op=bor-by-key&[email protected] edu Aleph IGe. LU 2014 Page 3

Aleph XML APIs: REST* 1. http: //walter. mit. edu: 1891/rest-dlf/patron/50481/circulation. Actions/loans 2. http: //walter.

Aleph XML APIs: REST* 1. http: //walter. mit. edu: 1891/rest-dlf/patron/50481/circulation. Actions/loans 2. http: //walter. mit. edu: 1891/rest-dlf/patron/164423/circulation. Actions/cash * REpresentational State Transfer - rest-web-services Aleph IGe. LU 2014 Page 4

Aleph XML APIs Standard access configuration Aleph REST API External system Aleph IGe. LU

Aleph XML APIs Standard access configuration Aleph REST API External system Aleph IGe. LU 2014 Page 5

What is the API adapter? 1. A thin layer of programming between the Aleph

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 IGe. LU 2014 Page 6

What is the API adapter? Access configuration with adapter installed Aleph REST API External

What is the API adapter? Access configuration with adapter installed Aleph REST API External system Adapter Aleph IGe. LU 2014 Page 7

Why did we build it? § To insulate Aleph and the calling system from

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 IGe. LU 2014 Page 8

Why did we build it? § To minimize the latency of network traffic by

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 IGe. LU 2014 Page 9

Why did we build it? § Simplifies access control. There is one place to

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 IGe. LU 2014 Page 10

Design – the adapter should. . § Integrate easily into the Aleph server environment.

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 IGe. LU 2014 Page 11

Design – the adapter should. . § Not interfere in any way with the

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 IGe. LU 2014 Page 12

Design – the adapter should. . § Function in a transparent pass-through mode for

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 IGe. LU 2014 Page 13

How does it work? § The adapter uses an Apache rewrite rule to direct

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 IGe. LU 2014 Page 14

Use case 1, ID translation § For patron functions, the REST API requires the

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 IGe. LU 2014 Page 15

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

Calls to Aleph REST API without the adapter installed. Two calls. Aleph server X-server API Apache Ports 80, 443 JBOSS REST API Port 1891 http: //walter. mit. edu/X? op=bor-by-key&[email protected] edu 50481 http: //walter. mit. edu: 1891/rest-dlf/patron/ External System XML

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

Calls to Aleph REST API with the adapter installed in passive mode. Two calls. Aleph server X-server API Apache Ports 80, 443 Adapter JBOSS REST API Port 1891 http: //walter. mit. edu/X? op=bor-by-key&[email protected] edu 50481 XML http: //walter. mit. edu/rest-dlf/patron/ External System

Calls to Aleph REST API with the adapter installed and using the Xserver transparently.

Calls to Aleph REST API with the adapter installed and using the Xserver transparently. One call. Aleph server X-server API Apache Rewrite rule Adapter JBOSS REST API Port 1891 XML http: //walter. mit. edu: 1891/rest-dlf/patron/[email protected] edu External System

Use case 2, data filtering § When using the adapter with the X-server. §

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 IGe. LU 2014 Page 19

Good Fences Make Good Neighbors Maintain control of the terrain where systems meet. Aleph

Good Fences Make Good Neighbors Maintain control of the terrain where systems meet. Aleph REST API External system Aleph IGe. LU 2014 Page 20

Useful Links § REST architecture http: //www. slideshare. net/cebartling/rest-web-services § Aleph REST API https:

Useful Links § REST architecture http: //www. slideshare. net/cebartling/rest-web-services § Aleph REST API https: //developers. exlibrisgroup. com/aleph/apis/Aleph-RESTful-APIs § Aleph X-server https: //developers. exlibrisgroup. com/aleph/apis/Aleph-X-Services § Ex Libris Developer Network https: //developers. exlibrisgroup. com/ Aleph IGe. LU 2014 Page 21

Finis Rich Wenger rwenger@mit. edu Phone 617 -253 -0035 Fax 617 -253 -4462 Aleph

Finis Rich Wenger [email protected] edu Phone 617 -253 -0035 Fax 617 -253 -4462 Aleph IGe. LU 2014 Page 22