public class D1Client extends Object
Modifier and Type | Field and Description |
---|---|
protected static MultipartRestClient |
multipartRestClient |
Constructor and Description |
---|
D1Client() |
Modifier and Type | Method and Description |
---|---|
static Identifier |
archive(Session session,
D1Object d1object)
Perform an archive on an object in DataONE with the given D1Object on the
authoritativeMemberNode contained in its systemMetadata.
|
static Identifier |
create(Session session,
D1Object d1object)
Attempts to create the given D1Object on the originMemberNode contained
in its SystemMetadata.
|
static CNode |
getCN()
Get the cached CNode object for calling Coordinating Node services.
|
static CNode |
getCN(Session session)
Deprecated.
broken functionality, and unused. use getCN() or getCN(baseUrl) instead
|
static CNode |
getCN(String cnBaseUrl)
Returns a Coordinating Node using the base service URL to look up the node
in the existing environment.
|
static MNode |
getMN(NodeReference nodeRef)
Return an MNode using the nodeReference for the member node.
|
static MNode |
getMN(String mnBaseUrl)
Returns a Member Node using the base service URL for the node.
|
protected static MultipartRestClient |
getMultipartRestClient() |
static ObsoletesChain |
listUpdateHistory(Identifier pid)
Return the full ObsoletesChain for the given Identifier.
|
static void |
setCN(String cnUrl)
Use this method to set the environment via the baseUrl to the environment's
Coordinating Node.
|
static void |
setNodeLocator(NodeLocator nodeLocator)
For testing, we can override the nodeLocator
|
static Identifier |
update(Session session,
D1Object d1object)
Perform an update an object in DataONE with the given D1Object on the
originMemberNode contained in its systemMetadata.
|
protected static MultipartRestClient multipartRestClient
protected static MultipartRestClient getMultipartRestClient() throws IOException, ClientSideException
IOException
ClientSideException
public static void setNodeLocator(NodeLocator nodeLocator)
nodeLocator
- public static CNode getCN() throws ServiceFailure, NotImplemented
ServiceFailure
NotImplemented
@Deprecated public static CNode getCN(Session session) throws ServiceFailure, NotImplemented
session
- - the client session to be used in connections, null uses default behavior.ServiceFailure
NotImplemented
public static void setCN(String cnUrl) throws NotImplemented, ServiceFailure
cnUrl
- NotImplemented
ServiceFailure
public static MNode getMN(String mnBaseUrl) throws ServiceFailure
mnBaseUrl
- the service URL for the Member NodeServiceFailure
public static CNode getCN(String cnBaseUrl) throws ServiceFailure
cnBaseUrl
- ServiceFailure
public static MNode getMN(NodeReference nodeRef) throws ServiceFailure
nodeRef
- ServiceFailure
public static Identifier create(Session session, D1Object d1object) throws InvalidToken, ServiceFailure, NotAuthorized, IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata, NotImplemented, InvalidRequest
session
- d1object
- - the d1object representing both the data bytes and systemMetadataInvalidToken
ServiceFailure
NotAuthorized
IdentifierNotUnique
UnsupportedType
InsufficientResources
InvalidSystemMetadata
NotImplemented
InvalidRequest
public static Identifier update(Session session, D1Object d1object) throws InvalidToken, ServiceFailure, NotAuthorized, IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata, NotImplemented, InvalidRequest, NotFound
session
- d1object
- - the d1object representing both the data bytes and systemMetadataInvalidToken
ServiceFailure
NotAuthorized
IdentifierNotUnique
UnsupportedType
InsufficientResources
InvalidSystemMetadata
NotImplemented
InvalidRequest
NotFound
public static Identifier archive(Session session, D1Object d1object) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InvalidRequest
session
- d1object
- - the d1object representing both the data bytes and systemMetadataInvalidToken
ServiceFailure
NotAuthorized
NotImplemented
InvalidRequest
NotFound
ClientSideException
public static ObsoletesChain listUpdateHistory(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented
pid
- InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
ClientSideException
Copyright © 2020. All Rights Reserved.