Earthgrid REST API Implementation
REST equivalent of Earthgrid SOAP API should be implemented to provide an interface for accessing Metacat data management functions such as read, squery, insert, delete, etc.
#2 Updated by Serhan Serhan almost 11 years ago
1 . MetacatServlet's local functions are moved to a class named "MetacatHandler" which is initialized in the servlet then, appropriate methods are called in the servlet. I did this change to enable accessing those methods from other servlets.
2. I created "edu.ucsb.nceas.metacat.restservice" package and placed a servlet named RestServlet which initializes ResourceHandler class and check paths and url parameters then initialize MetacatHandler and calls appropriate methods from it. I also did necessary definition in web.xml.
3. In src.edu.ucsb.nceas.metacat.client.rest package I created a client REST API which is similar to current Metacat Client API. "MetacatRestClient" class is implementing "MetacatRest" interface which is local equivalence of server side methods. I am using it for unit tests but it may be also used in client applications which are communicating with Metacat server.
4. I created MetacatRestClientTest, a unit test class, in test/edu/ucsb/nceas/metacattest/restservice folder which is testing REST services. It is very similar to MetacatClientTest.