public class FedoraClient extends Object
Constructor and Description |
---|
FedoraClient(FedoraCredentials fc)
Constructor for FedoraClient.
|
Modifier and Type | Method and Description |
---|---|
static AddDatastream |
addDatastream(String pid,
String dsId)
Static convenience method for the AddDatastream request.
|
static AddRelationship |
addRelationship(String subject)
Static convenience method for the AddRelationship request.
|
void |
debug(boolean debug)
If enabled, adds a logging filter to all requests that outputs to
System.out.
|
static DescribeRepository |
describeRepository()
Static convenience method for the DescribeRepository request.
|
FedoraResponse |
execute(FedoraRequest<?> method)
Convenience method for executing FedoraRequests.
|
static Export |
export(String pid) |
static FindObjects |
findObjects() |
static GetDatastream |
getDatastream(String pid,
String dsId) |
static GetDatastreamDissemination |
getDatastreamDissemination(String pid,
String dsId) |
static GetDatastreamHistory |
getDatastreamHistory(String pid,
String dsId) |
static GetDatastreams |
getDatastreams(String pid) |
static GetDissemination |
getDissemination(String pid,
String sdefPid,
String method) |
Date |
getLastModifiedDate(String pid)
Convenience method for returning the lastModifiedDate of an object.
|
Date |
getLastModifiedDate(String pid,
String dsId)
Convenience method for returning the lastModifiedDate of a datastream.
|
String |
getMimeType(File file) |
static GetNextPID |
getNextPID() |
static GetObjectHistory |
getObjectHistory(String pid) |
static GetObjectProfile |
getObjectProfile(String pid) |
static GetObjectXML |
getObjectXML(String pid) |
static GetRelationships |
getRelationships(String subject) |
String |
getServerVersion()
Get the version of the Fedora Repository this client is associated with
as reported by DescribeRepository
|
static Ingest |
ingest()
Ingest request that uses a server-assigned pid
|
static Ingest |
ingest(String pid) |
static ListDatastreams |
listDatastreams(String pid) |
static ListMethods |
listMethods(String pid) |
static ListMethods |
listMethods(String pid,
String sdefPid) |
static ModifyDatastream |
modifyDatastream(String pid,
String dsId) |
static ModifyObject |
modifyObject(String pid) |
static PurgeDatastream |
purgeDatastream(String pid,
String dsId) |
static PurgeObject |
purgeObject(String pid) |
static PurgeRelationship |
purgeRelationship(String subject) |
com.sun.jersey.api.client.WebResource |
resource() |
com.sun.jersey.api.client.WebResource |
resource(String uri) |
static RiSearch |
riSearch(String query) |
static Upload |
upload(File file) |
static Validate |
validate(String pid) |
public FedoraClient(FedoraCredentials fc)
fc
- credentials for a Fedora repositorypublic FedoraResponse execute(FedoraRequest<?> method) throws FedoraClientException
The preferred usage is actually the reverse: pass an instance of FedoraClient to the FedoraRequest, e.g.
IngestResponse r = new Ingest("my:pid").execute(client);
As a further shorthand, if the default instance of FedoraClient that
FedoraRequests should use is set (FedoraRequest.setDefaultClient(FedoraClient)
),
then you can use the following:
IngestResponse r = new Ingest("my:pid").execute();
Finally, FedoraClient provides a number of static convenience methods for FedoraRequests. Therefore, with a static import, the following, abbreviated syntax can be used:
import static com.yourmediashelf.fedora.client.FedoraClient.*; ... IngestResponse r = ingest("my:pid").execute();
method
- a FedoraRequestFedoraClientException
public com.sun.jersey.api.client.WebResource resource()
public com.sun.jersey.api.client.WebResource resource(String uri)
public Date getLastModifiedDate(String pid) throws FedoraClientException
Convenience method for returning the lastModifiedDate of an object.
Equivalent to getObjectProfile(pid).execute().getLastModifiedDate()
.
pid
- the pid of the objectFedoraClientException
public Date getLastModifiedDate(String pid, String dsId) throws FedoraClientException
Convenience method for returning the lastModifiedDate of a datastream.
Equivalent to getDatastream(pid, dsId).execute().getLastModifiedDate()
.
pid
- the pid of the objectdsId
- the datastream IDFedoraClientException
public void debug(boolean debug)
debug
- true to enable debuggingpublic String getServerVersion() throws FedoraClientException
FedoraClientException
public static AddDatastream addDatastream(String pid, String dsId)
Static convenience method for the AddDatastream request.
Equivalent to invoking: new AddDatastream(pid, dsId)
.
pid
- the pid of the object to add the datastream to.dsId
- the identifier of the datastream to be added.AddDatastream
public static AddRelationship addRelationship(String subject)
Static convenience method for the AddRelationship request.
Equivalent to invoking: new AddRelationship(subject)
.
subject
- the subject of the object (e.g. demo:123
or
info:fedora/demo:123/DC
)AddRelationship
public static DescribeRepository describeRepository()
Static convenience method for the DescribeRepository request.
Equivalent to invoking: new DescribeRepository()
.
DescribeRepository
public static FindObjects findObjects()
public static GetDatastream getDatastream(String pid, String dsId)
public static GetDatastreams getDatastreams(String pid)
public static GetDatastreamDissemination getDatastreamDissemination(String pid, String dsId)
public static GetDatastreamHistory getDatastreamHistory(String pid, String dsId)
public static GetDissemination getDissemination(String pid, String sdefPid, String method)
public static GetNextPID getNextPID()
public static GetObjectHistory getObjectHistory(String pid)
public static GetObjectProfile getObjectProfile(String pid)
public static GetObjectXML getObjectXML(String pid)
public static GetRelationships getRelationships(String subject)
public static Ingest ingest()
public static Ingest ingest(String pid)
pid
- persistent identifier of the object to be createdIngest
public static ListDatastreams listDatastreams(String pid)
public static ListMethods listMethods(String pid)
public static ListMethods listMethods(String pid, String sdefPid)
public static ModifyDatastream modifyDatastream(String pid, String dsId)
public static ModifyObject modifyObject(String pid)
public static PurgeDatastream purgeDatastream(String pid, String dsId)
public static PurgeObject purgeObject(String pid)
public static PurgeRelationship purgeRelationship(String subject)
Copyright © 2010-2013 MediaShelf. All Rights Reserved.