public DcsDeliverableUnit getStateDuFromDataFileDcp(Dcp dcp) { for (DcsDeliverableUnit candidate : dcp.getDeliverableUnits()) { if (DataFileProfile.DATAFILE_STATEDU_TYPE.equals(candidate.getType())) { return candidate; } } return null; }
protected DcsDeliverableUnit getRootDu(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(ROOT_DELIVERABLE_UNIT_TYPE)) { return test; } } return null; }
public DcsDeliverableUnit getStateDuFromDataFileDcp(Dcp dcp) { for (DcsDeliverableUnit candidate : dcp.getDeliverableUnits()) { if (DataFileProfile.DATAFILE_STATEDU_TYPE.equals(candidate.getType())) { return candidate; } } return null; }
/** * Returns the registry entry du from the DCP that has a type of {@link #REGISTRY_ENTRY_DU_TYPE}, otherwise null. The DCP * should represent the archive mapping of a {@link RegistryEntry}. * * @param dcp the dcp * @return the DU, or null if not found */ public DcsDeliverableUnit getRegistryEntryDuFromDcp(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(REGISTRY_ENTRY_DU_TYPE)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of {@link #METADATA_FILE_STATE_DU_TYPE}, otherwise null. The DCP * should represent the archival mapping of a DC UI {@link MetadataFile}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromMetadataFileDcp(Dcp dcp, String type) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(type)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of {@link #COLLECTION_ROOT_DU_TYPE}, otherwise null. The DCP should * represent the archival mapping of a DC UI {@link Collection}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getRootDuFromCollectionDcp(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(COLLECTION_ROOT_DU_TYPE)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of {@link #METADATA_FILE_ROOT_DU_TYPE}, otherwise null. The DCP should * represent the archival mapping of a DC UI {@link MetadataFile}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getRootDuFromMetadataFileDcp(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(METADATA_FILE_ROOT_DU_TYPE)) { return test; } } return null; }
@Override public Set<String> discover(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); Set<String> archiveIds = new HashSet<String>(); for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATAFORMAT_REGISTRY_ENTRY_TYPE)) { archiveIds.add(du.getId()); } } return archiveIds; }
@Override public Set<String> discover(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); Set<String> archiveIds = new HashSet<String>(); for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATAFORMAT_REGISTRY_ENTRY_TYPE)) { archiveIds.add(du.getId()); } } return archiveIds; }
/** * Returns the first DU from the DCP that has a type of type, otherwise null. The DCP * should represent the archival mapping of a DC UI object which is specified by {@code type} * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromDcp(Dcp dcp, String type) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(type)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of {@link DataItemProfile#DATASET_TYPE}, otherwise null. The * DCP should represent the archival mapping of a DC UI {@link Collection}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getRootDuFromDataItemDcp(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(DATASET_TYPE)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of {@link #METADATA_FILE_STATE_DU_TYPE}, otherwise null. The DCP * should represent the archival mapping of a DC UI {@link MetadataFile}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromMetadataFileDcp(Dcp dcp, String type) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(type)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of type, otherwise null. The DCP * should represent the archival mapping of a DC UI {@link Collection}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromCollectionDcp(Dcp dcp, String type) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(type)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of type, otherwise null. The DCP * should represent the archival mapping of a DC UI object which is specified by {@code type} * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromDcp(Dcp dcp, String type) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(type)) { return test; } } return null; }
/** * Returns the first DU from the DCP that has a type of type, otherwise null. The DCP * should represent the archival mapping of a DC UI {@link org.dataconservancy.ui.model.RelationshipSet}. * * @param dcp the dcp * @return the DU, or null */ public DcsDeliverableUnit getStateDuFromRelationshipSetDcp(Dcp dcp) { for (DcsDeliverableUnit test : dcp.getDeliverableUnits()) { if (test.getType().equals(RelationshipSetProfile.STATE_DU_TYPE)) { return test; } } return null; }
/** * {@inheritDoc} */ @Override public Set<String> discover(Dcp conformingPackage) { Set<String> ids = new HashSet<String>(); for (DcsDeliverableUnit du : conformingPackage.getDeliverableUnits()) { if (du.getType().equals(REGISTRY_ENTRY_DU_TYPE)) { ids.add(du.getId()); } } return ids; }
public Set<String> discover(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); Set<String> archiveIds = new HashSet<String>(); for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATASCHEME_REGISTRY_ENTRY_TYPE)) { archiveIds.add(du.getId()); } } return archiveIds; }
public Set<String> discover(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); Set<String> archiveIds = new HashSet<String>(); for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATASCHEME_REGISTRY_ENTRY_TYPE)) { archiveIds.add(du.getId()); } } return archiveIds; }
public String findMasterScheme(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); String masterSchemeId = ""; for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATASCHEME_REGISTRY_ENTRY_TYPE) && du.getParents().size() == 1) { masterSchemeId = du.getId(); break; } } return masterSchemeId; } public Dcp to(DcsMetadataScheme scheme, Map<String, Object> context, String masterId, String formatId) {
public String findMasterScheme(Dcp conformingPackage) { Collection<DcsDeliverableUnit> dus = conformingPackage.getDeliverableUnits(); String masterSchemeId = ""; for (DcsDeliverableUnit du : dus) { if (du.getType().equals(METADATASCHEME_REGISTRY_ENTRY_TYPE) && du.getParents().size() == 1) { masterSchemeId = du.getId(); break; } } return masterSchemeId; } public Dcp to(DcsMetadataScheme scheme, Map<String, Object> context, String masterId, String formatId) {