|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.fcrepo.soapclient.FedoraAccessSoapServlet
public class FedoraAccessSoapServlet
An example of a web-based client that provides a front end to the Fedora Access SOAP service. This servlet is designed to provide a "browser centric" view of the Fedora Access interface. Return types from the Fedora Access SOAP service are translated into a form suitable for viewing with a web browser; in other words MIME-typed streams. Applications that can readily handle SOAP requests and responses would most likely communicate directly with the Fedora Access SOAP service rather than use a java servlet as an intermediary. This servlet serves as an example of how to construct a client that uses the Fedora Access API via SOAP.
Input parameters for the servlet include:
Note that all servlet parameter names that are implementation specific end with the underscore character ("_"). This is done to avoid possible name clashes with user-supplied method parameter names. As a general rule, user-supplied parameters should never contain names that end with the underscore character to prevent possible name conflicts.
Example URLs
protocol://hostname:port/soapclient/apia?action_=GetDissemination&PID_=pid& sDefPID_=sdefpid&methodName_=methodname[&asOfDateTime_=dateTime][?parmArray]
This syntax requests a dissemination of the specified object using the specified method of the associated service definition object. The result is returned as a MIME-typed stream.
protocol://hostname:port/soapclient/apia?action=GetDatastreamDissemination& PID_=pid&dsID_=dsid[&asOfDateTime_=dateTime]
This syntax requests a datastream dissemination for the specified digital object. It is used to return the contents of a datastream.
protocol://hostname:port/soapclient/apia?action_=GetObjectProfile&PID_=pid[& asOfDateTime_=dateTime][&xml=boolean]
This syntax requests an object profile for the specified digital object.
protocol://hostname:port/soapclient/apia?action_=GetObjectHistory&PID_=pid[& xml_=boolean]
This syntax requests an object history for the specified digital object.
protocol://hostname:port/soapclient/apia?action_=DescribeRepository[&xml_= boolean]
This syntax requests an object profile for the specified digital object.
protocol://hostname:port/soapclient/apia?action_=ListDatastreams&PID_=pid[& asOfDateTime_=dateTime][&xml_=boolean]
This syntax requests a list of datastreams for the specified digital object.
protocol://hostname:port/soapclient/apia?action_=ListMethods&PID_=pid[& asOfDateTime_=ateTime][xml_=boolean]
This syntax requests a list of methods for the specified digital object.
| Nested Class Summary | |
|---|---|
class |
FedoraAccessSoapServlet.DatastreamDefSerializerThread
A Thread to serialize a DatastreamDef object into XML. |
class |
FedoraAccessSoapServlet.ObjectHistorySerializerThread
A Thread to serialize an ObjectHistory object into XML. |
class |
FedoraAccessSoapServlet.ObjectMethodDefSerializerThread
A Thread to serialize an ObjectMethodDef object into XML. |
class |
FedoraAccessSoapServlet.ProfileSerializerThread
A Thread to serialize an ObjectProfile object into XML. |
class |
FedoraAccessSoapServlet.ReposInfoSerializerThread
A Thread to serialize a RepositoryInfo object into XML. |
| Nested classes/interfaces inherited from interface org.fcrepo.common.Constants |
|---|
Constants.FedoraHome |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
FedoraAccessSoapServlet()
|
|
| Method Summary | |
|---|---|
RepositoryInfo |
describeRepository()
Gets repository information for the server by invoking the appropriate Fedora Access SOAP service. |
void |
destroy()
Cleans up servlet resources. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process Fedora Access Request. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
For now, treat a HTTP POST request just like a GET request. |
FieldSearchResult |
findObjects(String[] resultFields,
int maxResults,
FieldSearchQuery query)
Lists the specified fields of each object matching the given criteria. |
MIMETypedStream |
getDatastreamDissemination(String PID,
String dsID,
String asOfDateTime)
|
MIMETypedStream |
getDissemination(String PID,
String sDefPID,
String methodName,
Property[] userParms,
String asOfDateTime)
Gets a MIME-typed bytestream containing the result of a dissemination by invoking the appropriate Fedora Access SOAP service. |
String[] |
getObjectHistory(String PID)
Gets a list of Service Definition object PIDs for the specified digital object by invoking the appropriate Fedora Access SOAP service. |
ObjectProfile |
getObjectProfile(String PID,
String asOfDateTime)
Gets a object profile for the specified object by invoking the appropriate Fedora Access SOAP service. |
void |
init()
Initialize servlet. |
DatastreamDef[] |
listDatastreams(String PID,
String asOfDateTime)
Gets a list of all datastream for the specified object by invoking the appropriate Fedora Access SOAP service. |
ObjectMethodsDef[] |
listMethods(String PID,
String asOfDateTime)
Gets a list of all method definitions for the specified object by invoking the appropriate Fedora Access SOAP service. |
FieldSearchResult |
resumeFindObjects(String sessionToken)
Resumes an in-progress listing of object fields. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FedoraAccessSoapServlet()
| Method Detail |
|---|
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
Process Fedora Access Request. Parse and validate the servlet input parameters and then execute the specified request by calling the appropriate Fedora Access SOAP service.
doGet in class javax.servlet.http.HttpServletrequest - The servlet request.response - servlet The servlet response.
javax.servlet.ServletException - If an error occurs that effects the servlet's basic operation.
IOException - If an error occurs with an input or output operation.
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
For now, treat a HTTP POST request just like a GET request.
doPost in class javax.servlet.http.HttpServletrequest - The servet request.response - The servlet response.
javax.servlet.ServletException - If thrown by doGet.
IOException - If thrown by doGet.
javax.servlet.ServletException - If an error occurs that effects the servlet's basic operation.
public String[] getObjectHistory(String PID)
throws Exception
Gets a list of Service Definition object PIDs for the specified digital object by invoking the appropriate Fedora Access SOAP service.
PID - The persistent identifier of the digital object.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public MIMETypedStream getDissemination(String PID,
String sDefPID,
String methodName,
Property[] userParms,
String asOfDateTime)
throws Exception
Gets a MIME-typed bytestream containing the result of a dissemination by invoking the appropriate Fedora Access SOAP service.
PID - The persistent identifier of the digital object.sDefPID - The persistent identifier of the Service Definition object.methodName - The name of the method.asOfDateTime - The version datetime stamp of the digital object.userParms - An array of user-supplied method parameters and values.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public MIMETypedStream getDatastreamDissemination(String PID,
String dsID,
String asOfDateTime)
throws Exception
Exception
public ObjectMethodsDef[] listMethods(String PID,
String asOfDateTime)
throws Exception
Gets a list of all method definitions for the specified object by invoking the appropriate Fedora Access SOAP service.
PID - The persistent identifier for the digital object.asOfDateTime - The versioning datetime stamp.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public DatastreamDef[] listDatastreams(String PID,
String asOfDateTime)
throws Exception
Gets a list of all datastream for the specified object by invoking the appropriate Fedora Access SOAP service.
PID - The persistent identifier of the digital object.asOfDateTime - The versioning datetime stamp.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public ObjectProfile getObjectProfile(String PID,
String asOfDateTime)
throws Exception
Gets a object profile for the specified object by invoking the appropriate Fedora Access SOAP service.
PID - The persistent identifier for the digital object.asOfDateTime - The versioning datetime stamp.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public RepositoryInfo describeRepository()
throws Exception
Gets repository information for the server by invoking the appropriate Fedora Access SOAP service.
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public FieldSearchResult findObjects(String[] resultFields,
int maxResults,
FieldSearchQuery query)
throws Exception
Lists the specified fields of each object matching the given criteria.
resultFields - the names of the fields to returnmaxResults - the maximum number of results to return at a timequery - the query
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public FieldSearchResult resumeFindObjects(String sessionToken)
throws Exception
Resumes an in-progress listing of object fields.
sessionToken - the token of the session in which the remaining results can be
obtained
Exception - If an error occurs in communicating with the Fedora Access SOAP
service.
public void init()
throws javax.servlet.ServletException
Initialize servlet.
init in class javax.servlet.GenericServletjavax.servlet.ServletException - If the servet cannot be initialized.public void destroy()
Cleans up servlet resources.
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServlet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||