public class DataPackage extends Object
Constructor and Description |
---|
DataPackage()
Default constructor without identifier.
|
DataPackage(Identifier id)
Construct a DataPackage using the given identifier to identify this package.
|
Modifier and Type | Method and Description |
---|---|
void |
addAndDownloadData(Identifier id)
Puts an object with the given Identifier to the package's local, temporary
data store.
|
void |
addData(D1Object obj)
Puts a D1Object directly to the package's local, temporary data store without
downloading it from a node.
|
boolean |
contains(Identifier id)
Determine if an object with the given Identifier is already present in
the local data store.
|
static DataPackage |
deserializePackage(String resourceMap)
Deserialize an ORE resourceMap by parsing it, extracting the associated package identifier,
and the list of metadata and data objects aggregated in the ORE Map.
|
static DataPackage |
download(Identifier pid)
Download the resource map
|
D1Object |
get(Identifier id)
Get the D1Object associated with a given Identifier from the local data store.
|
Identifier |
getDocumentedBy(Identifier dataObject)
Convenience function for working with the metadata map.
|
org.dspace.foresite.ResourceMap |
getMap()
Build and return a fresh ORE ResourceMap from the metadata map.
|
Map<Identifier,List<Identifier>> |
getMetadataMap() |
Identifier |
getPackageId() |
SystemMetadata |
getSystemMetadata()
Get the SystemMetadata object associated with the data package.
|
Set<Identifier> |
getUncharacterizedMembers()
Returns a list of package members that are not in the relationship map
(implying that these are not true members, as they will
not be included in the serialized ResourceMap).
|
Set<Identifier> |
getUnresolvableMembers()
Returns the Identifiers in the relationship map that cannot
be found in the object map or resolved by the CN.
|
Set<Identifier> |
identifiers()
Return the set of Identifiers that are part of this package.
|
void |
insertRelationship(Identifier metadataID,
List<Identifier> dataIDList)
Declare which data objects are documented by a metadata object, using their
identifiers.
|
void |
remove(Identifier id)
Deprecated.
renaming to removeData(Identifier id) for naming consistency
with addData, addAndDownloadData
|
void |
removeData(Identifier id)
Removes a D1Object from the local data store based on its Identifier.
|
String |
serializePackage()
Return an ORE ResourceMap describing this package, serialized as an RDF graph.
|
void |
setMetadataMap(Map<Identifier,List<Identifier>> metadataMap) |
void |
setPackageId(Identifier packageId) |
void |
setSystemMetadata(SystemMetadata systemMetadata)
Set the SystemMetadata object to this data package.
|
int |
size()
Used to introspect on the local temporary data store, NOT the number of
DataPackage members.
|
public DataPackage()
public DataPackage(Identifier id)
id
- the Identifier of the packagepublic void addAndDownloadData(Identifier id) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InsufficientResources, InvalidRequest
id
- the identifier of the object to be addedInvalidRequest
InsufficientResources
NotImplemented
NotFound
NotAuthorized
ServiceFailure
InvalidToken
public void addData(D1Object obj)
obj
- the D1Object to be added to the object mappublic void insertRelationship(Identifier metadataID, List<Identifier> dataIDList)
metadataID
- dataIDList
- public int size()
public boolean contains(Identifier id)
id
- the Identifier to be checkedpublic D1Object get(Identifier id)
id
- the identifier of the object to be retrievedpublic void remove(Identifier id)
id
- public void removeData(Identifier id)
id
- the Identifier of the object to be removed.public Set<Identifier> identifiers()
public Identifier getPackageId()
public void setPackageId(Identifier packageId)
packageId
- the packageId to setpublic org.dspace.foresite.ResourceMap getMap() throws org.dspace.foresite.OREException, URISyntaxException
URISyntaxException
org.dspace.foresite.OREException
public String serializePackage() throws org.dspace.foresite.OREException, URISyntaxException, org.dspace.foresite.ORESerialiserException
URISyntaxException
org.dspace.foresite.OREException
org.dspace.foresite.ORESerialiserException
public static DataPackage download(Identifier pid) throws InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InsufficientResources, InvalidRequest, org.dspace.foresite.OREException, URISyntaxException, org.dspace.foresite.OREParserException, IOException
pid
- InvalidToken
ServiceFailure
NotAuthorized
NotFound
NotImplemented
InsufficientResources
InvalidRequest
org.dspace.foresite.OREException
URISyntaxException
org.dspace.foresite.OREParserException
IOException
public static DataPackage deserializePackage(String resourceMap) throws UnsupportedEncodingException, org.dspace.foresite.OREException, URISyntaxException, org.dspace.foresite.OREParserException, InvalidToken, ServiceFailure, NotAuthorized, NotFound, NotImplemented, InsufficientResources, InvalidRequest
resourceMap
- the string representation of an ORE map in XML formatorg.dspace.foresite.OREParserException
URISyntaxException
org.dspace.foresite.OREException
UnsupportedEncodingException
InvalidRequest
InsufficientResources
NotImplemented
NotFound
NotAuthorized
ServiceFailure
InvalidToken
public Map<Identifier,List<Identifier>> getMetadataMap()
public Identifier getDocumentedBy(Identifier dataObject)
dataObject
- public void setMetadataMap(Map<Identifier,List<Identifier>> metadataMap)
metadataMap
- the metadataMap to setpublic void setSystemMetadata(SystemMetadata systemMetadata)
systemMetadata
- - the SystemMetadata object will be set.public SystemMetadata getSystemMetadata()
public Set<Identifier> getUncharacterizedMembers()
public Set<Identifier> getUnresolvableMembers() throws InvalidToken, ServiceFailure, NotImplemented
InvalidToken
ServiceFailure
NotImplemented
Copyright © 2014. All Rights Reserved.