protected DataTypeManagerInfo addDTM(DataTypeManagerInfo dtmInfo) throws DuplicateIdException {
		DataTypeManagerInfo existingDTM = openDTMs.get(dtmInfo.dtm.getUniversalID());
		if (existingDTM != null) {
			if (existingDTM.isClosed()) {
				openDTMs.remove(dtmInfo.dtm.getUniversalID());
			}
			else {
				dtmInfo.dtm.close();
				throw new DuplicateIdException(dtmInfo.name(), existingDTM.name());
			}
		}
		openDTMs.put(dtmInfo.dtm.getUniversalID(), dtmInfo);
		afterAddDataTypeManager(dtmInfo);
		return dtmInfo;
	}
Simple, non-ui implementation of the {@link DataTypeArchiveService} interface.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/archive/DefaultDataTypeArchiveService.java