public abstract class D1Node extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
protected Session |
session
this represents the session to be used for establishing the SSL connection
|
Constructor and Description |
---|
D1Node()
Deprecated.
|
D1Node(String nodeBaseServiceUrl)
Constructor to create a new instance.
|
D1Node(String nodeBaseServiceUrl,
Session session)
Constructor to create a new instance.
|
Modifier and Type | Method and Description |
---|---|
Identifier |
archive(Identifier pid) |
Identifier |
archive(Session session,
Identifier pid)
sets the archived flag to true on an MN or CN
|
Identifier |
delete(Identifier pid) |
Identifier |
delete(Session session,
Identifier pid) |
DescribeResponse |
describe(Identifier pid) |
DescribeResponse |
describe(Session session,
Identifier pid) |
protected <T> T |
deserializeServiceType(Class<T> domainClass,
InputStream is)
deserialize an object of type from the inputstream
This is a wrapper method of the standard common Unmarshalling method
that recasts exceptions to ServiceFailure
|
Identifier |
generateIdentifier(Session session,
String scheme,
String fragment) |
Identifier |
generateIdentifier(String scheme,
String fragment) |
InputStream |
get(Identifier pid)
Get the resource with the specified pid.
|
InputStream |
get(Session session,
Identifier pid)
Get the resource with the specified pid.
|
Checksum |
getChecksum(Identifier pid,
String checksumAlgorithm) |
Checksum |
getChecksum(Session session,
Identifier pid,
String checksumAlgorithm)
This method can handle both the MN and CN method, although the CN overriding method
will need to recast the InvalidRequest exception and use 'null' for the checksumAlgorithm param
|
Integer |
getDefaultSoTimeout() |
String |
getLatestRequestUrl()
Useful for debugging to see what the last call was
|
Log |
getLogRecords() |
Log |
getLogRecords(Date fromDate,
Date toDate,
Event event,
String pidFilter,
Integer start,
Integer count) |
Log |
getLogRecords(Session session) |
Log |
getLogRecords(Session session,
Date fromDate,
Date toDate,
Event event,
String pidFilter,
Integer start,
Integer count) |
String |
getNodeBaseServiceUrl()
Retrieve the service URL for this node.
|
String |
getNodeId() |
QueryEngineDescription |
getQueryEngineDescription(String queryEngine) |
SystemMetadata |
getSystemMetadata(Identifier pid)
Get the system metadata from a resource with the specified guid.
|
SystemMetadata |
getSystemMetadata(Identifier pid,
boolean useSystemMetadataCache)
Get the system metadata from a resource with the specified guid, potentially using the local
system metadata cache if specified to do so.
|
SystemMetadata |
getSystemMetadata(Session session,
Identifier pid)
Get the system metadata from a resource with the specified guid.
|
SystemMetadata |
getSystemMetadata(Session session,
Identifier pid,
boolean useSystemMetadataCache)
Get the system metadata from a resource with the specified guid, potentially using the local
system metadata cache if specified to do so.
|
boolean |
isAuthorized(Identifier pid,
Permission action) |
boolean |
isAuthorized(Session session,
Identifier pid,
Permission action) |
ObjectList |
listObjects()
|
ObjectList |
listObjects(Date fromDate,
Date toDate,
ObjectFormatIdentifier formatid,
Boolean replicaStatus,
Integer start,
Integer count) |
ObjectList |
listObjects(Session session) |
ObjectList |
listObjects(Session session,
Date fromDate,
Date toDate,
ObjectFormatIdentifier formatid,
Boolean replicaStatus,
Integer start,
Integer count) |
QueryEngineList |
listQueryEngines() |
Date |
ping() |
InputStream |
query(String queryEngine,
D1Url queryUrlElements)
A convenience method for building the query going to the queryEngine.
|
InputStream |
query(String queryEngine,
String encodedQuery)
As with the sister query() method that takes a D1Url, the contents of
encodedQuery will be joined to the url with as follows:
/{queryEngine}/{encodedQuery}
Note: Users will need to provide the '?' where appropriate to mark
the beginning of the url-query portion.
|
protected static ServiceFailure |
recastClientSideExceptionToServiceFailure(Exception e)
A helper function to preserve the stackTrace when catching one error and throwing a new one.
|
protected static ServiceFailure |
recastDataONEExceptionToServiceFailure(BaseException be)
A helper function for recasting DataONE exceptions to ServiceFailures while
preserving the detail code and TraceDetails.
|
void |
setDefaultSoTimeout(Integer defaultSoTimeout) |
protected void |
setLatestRequestUrl(String url) |
void |
setNodeBaseServiceUrl(String nodeBaseServiceUrl)
Set the service URL for this node.
|
void |
setNodeId(String nodeId) |
protected static org.apache.commons.logging.Log log
protected Session session
public D1Node(String nodeBaseServiceUrl, Session session)
public D1Node(String nodeBaseServiceUrl)
@Deprecated public D1Node()
public String getLatestRequestUrl()
protected void setLatestRequestUrl(String url)
public String getNodeBaseServiceUrl()
public void setNodeBaseServiceUrl(String nodeBaseServiceUrl)
nodeBaseServiceUrl
- String representing the service URLpublic String getNodeId()
public void setNodeId(String nodeId)
nodeId
- the nodeId to setpublic Date ping() throws NotImplemented, ServiceFailure, InsufficientResources
public ObjectList listObjects() throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure
public ObjectList listObjects(Session session) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure
public ObjectList listObjects(Date fromDate, Date toDate, ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start, Integer count) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure
public ObjectList listObjects(Session session, Date fromDate, Date toDate, ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start, Integer count) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure
public Log getLogRecords() throws InvalidToken, InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented, InsufficientResources
public Log getLogRecords(Session session) throws InvalidToken, InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented, InsufficientResources
public Log getLogRecords(Date fromDate, Date toDate, Event event, String pidFilter, Integer start, Integer count) throws InvalidToken, InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented, InsufficientResources
public Log getLogRecords(Session session, Date fromDate, Date toDate, Event event, String pidFilter, Integer start, Integer count) throws InvalidToken, InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented, InsufficientResources
public InputStream get(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InsufficientResources
public InputStream get(Session session, Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InsufficientResources
public SystemMetadata getSystemMetadata(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
DataONE API Reference (MemberNode API)
,
DataONE API Reference (CoordinatingNode API)
public SystemMetadata getSystemMetadata(Identifier pid, boolean useSystemMetadataCache) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
DataONE API Reference (MemberNode API)
,
DataONE API Reference (CoordinatingNode API)
public SystemMetadata getSystemMetadata(Session session, Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
DataONE API Reference (MemberNode API)
,
DataONE API Reference (CoordinatingNode API)
public SystemMetadata getSystemMetadata(Session session, Identifier pid, boolean useSystemMetadataCache) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
DataONE API Reference (MemberNode API)
,
DataONE API Reference (CoordinatingNode API)
public DescribeResponse describe(Identifier pid) throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound
public DescribeResponse describe(Session session, Identifier pid) throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound
public Checksum getChecksum(Identifier pid, String checksumAlgorithm) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound
public Checksum getChecksum(Session session, Identifier pid, String checksumAlgorithm) throws InvalidRequest, InvalidToken, NotAuthorized, NotImplemented, ServiceFailure, NotFound
session
- pid
- checksumAlgorithm
- - for MN implementations onlyInvalidRequest
- - for MN implementations onlyInvalidToken
NotAuthorized
NotImplemented
ServiceFailure
NotFound
public boolean isAuthorized(Identifier pid, Permission action) throws ServiceFailure, InvalidRequest, InvalidToken, NotFound, NotAuthorized, NotImplemented
public boolean isAuthorized(Session session, Identifier pid, Permission action) throws ServiceFailure, InvalidRequest, InvalidToken, NotFound, NotAuthorized, NotImplemented
public Identifier generateIdentifier(String scheme, String fragment) throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, InvalidRequest
public Identifier generateIdentifier(Session session, String scheme, String fragment) throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, InvalidRequest
public Identifier archive(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
public Identifier archive(Session session, Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
session
- pid
- InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
InvalidRequest
public Identifier delete(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
public Identifier delete(Session session, Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
public InputStream query(String queryEngine, D1Url queryUrlElements) throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented, NotFound
queryEngine
- queryUrlElements
- a D1Url object that contains the necessary query bitsInvalidToken
ServiceFailure
NotAuthorized
InvalidRequest
NotImplemented
NotFound
public InputStream query(String queryEngine, String encodedQuery) throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented, NotFound
queryEngine
- encodedQuery
- InvalidToken
ServiceFailure
NotAuthorized
InvalidRequest
NotImplemented
NotFound
public QueryEngineDescription getQueryEngineDescription(String queryEngine) throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, NotFound
public QueryEngineList listQueryEngines() throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented
protected static ServiceFailure recastClientSideExceptionToServiceFailure(Exception e)
e
- protected static ServiceFailure recastDataONEExceptionToServiceFailure(BaseException be)
be
- - BaseException subclass to be recastprotected <T> T deserializeServiceType(Class<T> domainClass, InputStream is) throws ServiceFailure
type
- the class of the object to serialize (i.e.
SystemMetadata.class)is
- the stream to deserialize fromServiceFailure
public Integer getDefaultSoTimeout()
public void setDefaultSoTimeout(Integer defaultSoTimeout)
Copyright © 2014. All Rights Reserved.