.. @startuml images/morpho-class-diagram.png package DataONE { class D1Object { - DataSource dataSource - SystemMetadata systemMetadata + D1Object() + SystemMetadata getSystemMetadata() + void setSystemMetadata(SystemMetadata systemMetadata) + DataSource getDataSource() + void setDataSource(DataSource dataSource) + byte[] getData() (deprecated) + void setData(byte[] data) (deprecated) } class DataPackage { - SystemMetadata systemMetadata + void add(D1Object obj) + boolean contains(Identifier id) + D1Object get(Identifier id) + ResourceMap getMap() + Map> getMetadataMap() + Set identifiers() + void insertRelationship(Identifier metadataId, ListdataIDList) + void remove(Identifier id) + OutputStream serialize() } } package Morpho { class Entity { - Node entRoot - boolean isDirty = false + boolean isDirty() + void setIsDirty(boolean isDirty) } class EML2Beta6DataPackage { } class EML200DataPackage { } class MetadataObject { - Document doc } abstract AbstractDataPackage { - boolean isDirty = false + abstract OutputStream serialize() throws Exception + boolean isDirty() + void setIsDirty(boolean isDirty) } class MorphoDataPackage { + AbstractDataPackage getAbstractDataPackage() } class FileSystemDataStore { - HashMap fileIDMap - String directory + {static} FileSystemDataStore getInstance(String directory) + File get(Identifier id) throws Exception + void set(Identifier id, InputStream data) throws Exception + String getDirectory() + void setDirectory(String dir) + List getIdentifiers() } interface DataStoreServiceInterface { + MorphoDataPackage read(Identifier pid) throws Exception + String save(MorphoDataPackage mdp) throws Exception + void delete(MorphoDataPackage mdp) throws Exception + String generateIdentifier() throws Exception + boolean exists(String identifier) throws Exception } abstract DataStoreService { CONSIDER REMOVING - String dataDir - String cacheDir - String incompleteDir } class LocalDataStoreService { - String dotMorphoDir } class MetacatDataStoreService { - String metacatURL } class DataONEDataStoreService { - MNode activeMNode; + MNode getActiveMNode() + void setActiveMNode(MNode activeMNode) } class DataStoreServiceController { - Map dataStoreServices + {static} String LOCAL + {static} String METACAT + {static} String DATAONE + {static} String ALL + DataStoreServiceController getInstance() + MorphoDataPackage read(String identifier, String location) + String save(MorphoDataPackage mdp, String location) + void delete(MorphoDataPackage mdp, String location) + String generateIdentifier(String location) + boolean exists(String identifier, String location) } class RevisionManager { - Map obsoletes - Map obsoletedBy + List getAllRevisions(String identifer) + String getObsoletes(String identifer) + String getObsoletedBy(String identifer) + void setObsoletes(String new, String old) + void setObsoletedBy(String old, String new) } } D1Object <|-- Entity D1Object <|-- MetadataObject MetadataObject <|-- AbstractDataPackage AbstractDataPackage <|-- EML2Beta6DataPackage AbstractDataPackage <|-- EML200DataPackage DataPackage <|-- MorphoDataPackage Entity "*" --o AbstractDataPackage D1Object "*" --o DataPackage 'When we want to include the D1 object model in Morpho we can add this relationship 'DataStore <|-- FileSystemDataStore DataStoreServiceInterface <|-- DataStoreService DataStoreService <|-- LocalDataStoreService DataStoreService <|-- MetacatDataStoreService DataStoreService <|-- DataONEDataStoreService FileSystemDataStore "*" --o DataStoreService RevisionManager "1" --o DataStoreService DataStoreServiceController o-- "*" DataStoreServiceInterface @enduml .. image:: images/morpho-class-diagram.png