public abstract class MultipartD1Node extends Object implements D1Node
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
protected NodeType |
nodeType |
protected MultipartRestClient |
restClient
the adapter / connector to the RESTful service endpoints
|
protected Session |
session
this represents the session to be used for establishing the SSL connection
|
Constructor and Description |
---|
MultipartD1Node()
Deprecated.
|
MultipartD1Node(MultipartRestClient client,
String nodeBaseServiceUrl)
Constructor to create a new instance.
|
MultipartD1Node(MultipartRestClient client,
String nodeBaseServiceUrl,
Session session)
Constructor to create a new instance.
|
MultipartD1Node(String nodeBaseServiceUrl)
Deprecated.
|
MultipartD1Node(String nodeBaseServiceUrl,
Session session)
Deprecated.
|
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
|
String |
getLatestRequestUrl()
A method to provide information about the latestRequest from the D1Node
|
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.
|
NodeReference |
getNodeId()
Get the NodeId associated with the D1Node
|
NodeType |
getNodeType()
Get the NodeType associated with the D1Node
|
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() |
protected InputStream |
localizeInputStream(InputStream is)
Use this method to consume (presumably) a remote inputstream and effectively
release any connections and system resources.
|
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.
|
void |
setNodeBaseServiceUrl(String nodeBaseServiceUrl)
Set the service URL for this node.
|
void |
setNodeId(NodeReference nodeId)
Set the NodeId associated with the D1Node
|
void |
setNodeType(NodeType nodeType)
Set the Nodetype for the D1Node
|
protected static org.apache.commons.logging.Log log
protected MultipartRestClient restClient
protected Session session
protected NodeType nodeType
public MultipartD1Node(MultipartRestClient client, String nodeBaseServiceUrl, Session session)
public MultipartD1Node(MultipartRestClient client, String nodeBaseServiceUrl)
@Deprecated public MultipartD1Node(String nodeBaseServiceUrl, Session session)
@Deprecated public MultipartD1Node(String nodeBaseServiceUrl)
@Deprecated public MultipartD1Node()
public String getNodeBaseServiceUrl()
getNodeBaseServiceUrl
in interface D1Node
public void setNodeBaseServiceUrl(String nodeBaseServiceUrl)
nodeBaseServiceUrl
- String representing the service URLpublic NodeReference getNodeId()
D1Node
public void setNodeId(NodeReference nodeId)
D1Node
public void setNodeType(NodeType nodeType)
D1Node
setNodeType
in interface D1Node
public NodeType getNodeType()
D1Node
getNodeType
in interface D1Node
public String getLatestRequestUrl()
D1Node
getLatestRequestUrl
in interface D1Node
public 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 <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
protected InputStream localizeInputStream(InputStream is) throws IOException
is
- IOException
Copyright © 2014. All Rights Reserved.