當前位置: 首頁>>代碼示例>>Java>>正文


Java IdentifiedList類代碼示例

本文整理匯總了Java中org.apache.taverna.reference.IdentifiedList的典型用法代碼示例。如果您正苦於以下問題:Java IdentifiedList類的具體用法?Java IdentifiedList怎麽用?Java IdentifiedList使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IdentifiedList類屬於org.apache.taverna.reference包,在下文中一共展示了IdentifiedList類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerEmptyList

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public IdentifiedList<T2Reference> registerEmptyList(int depth,
		ReferenceContext context) throws ListServiceException {
	if (depth < 1)
		throw new ListServiceException(
				"Can't register empty lists of depth " + depth);
	checkDao();
	checkGenerator();
	T2ReferenceImpl newReference = getAsImpl(t2ReferenceGenerator
			.nextListReference(false, depth, context));
	T2ReferenceListImpl newList = new T2ReferenceListImpl();
	newList.setTypedId(newReference);
	try {
		listDao.store(newList);
		return newList;
	} catch (DaoException de) {
		throw new ListServiceException(de);
	}
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:20,代碼來源:ListServiceImpl.java

示例2: referenceFromString

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
/**
 * Parse the reference contained in the string and return a
 * {@link T2Reference} with the correct properties
 */
@Override
public T2Reference referenceFromString(String reference) {
	T2ReferenceImpl newRef = new T2ReferenceImpl();
	Map<String, String> parseRef = parseRef(reference);
	newRef.setNamespacePart(parseRef.get("namespace"));
	newRef.setLocalPart(parseRef.get("localPart"));
	String type = parseRef.get("type");
	if (type.equals("ref")) {
		newRef.setReferenceType(ReferenceSet);
	} else if (type.equals("list")) {
		newRef.setReferenceType(IdentifiedList);
		newRef.setContainsErrors(Boolean.parseBoolean(parseRef.get("error")));
		newRef.setDepth(Integer.parseInt(parseRef.get("depth")));
	} else if (type.equals("error")) {
		newRef.setContainsErrors(true);
		newRef.setReferenceType(ErrorDocument);
		newRef.setDepth(Integer.parseInt(parseRef.get("depth")));
	} else {
		return null;
		// should throw an error
	}

	return newRef;
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:29,代碼來源:ReferenceServiceImpl.java

示例3: saveIntermediate

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
private Path saveIntermediate(T2Reference t2Ref) throws IOException {
    // Avoid double-saving
    Path f = seenReferences.get(t2Ref);
    if (f != null) {
        return f;
    }
    Path file = referencePath(t2Ref);

    if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) {
        IdentifiedList<T2Reference> list = saver.getReferenceService()
                .getListService().getList(t2Ref);
        for (T2Reference ref : list) {
            saveIntermediate(ref);
        }
        seenReference(t2Ref, file);
        return file;
    } else {
        return saveValue(t2Ref, file);
    }

}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:22,代碼來源:W3ProvenanceExport.java

示例4: saveValue

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
private Path saveValue(T2Reference t2Ref, Path file) throws IOException {
    Path parent = file.getParent();

    switch (t2Ref.getReferenceType()) {

    case IdentifiedList:
        DataBundles.createList(file);
        IdentifiedList<T2Reference> list = saver.getReferenceService()
                .getListService().getList(t2Ref);
        long position = 0;
        for (T2Reference ref : list) {
            saveValue(ref, DataBundles.getListItem(file, position++));
        }
        break;
    case ErrorDocument:
        Files.createDirectories(parent);
        file = saveError(t2Ref, file);
        break;
    case ReferenceSet:
        Files.createDirectories(parent);
        file = saver.saveReference(t2Ref, file);
    }
    seenReference(t2Ref, file);
    return file;
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:26,代碼來源:W3ProvenanceExport.java

示例5: considerReference

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
private T2Reference considerReference(T2Reference value,
		List<T2Reference> exceptions) {
	if (!value.containsErrors())
		return value;
	else if (!value.getReferenceType().equals(IdentifiedList))
		return replaceErrors(value, value.getDepth(), exceptions);
	else if (exceptionHandling.failLists())
		return replaceErrors(findFirstFailure(value), value.getDepth(),
				exceptions);

	List<T2Reference> replacementList = new ArrayList<>();
	for (T2Reference subValue : lists.getList(value))
		replacementList.add(considerReference(subValue, exceptions));
	return references.register(replacementList, value.getDepth(), true,
			context);
}
 
開發者ID:apache,項目名稱:incubator-taverna-plugin-component,代碼行數:17,代碼來源:ProxyCallback.java

示例6: getList

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public IdentifiedList<T2Reference> getList(T2Reference id)
		throws ListServiceException {
	checkDao();
	try {
		return listDao.get(id);
	} catch (DaoException de) {
		throw new ListServiceException(de);
	}
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:11,代碼來源:ListServiceImpl.java

示例7: delete

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public boolean delete(T2Reference reference)
		throws ReferenceServiceException {
	checkDao();
	IdentifiedList<T2Reference> list = listDao.get(reference);
	if (list == null)
		return false;
	return listDao.delete(list);
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:10,代碼來源:ListServiceImpl.java

示例8: delete

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public boolean delete(T2Reference reference)
		throws ReferenceServiceException {
	switch (reference.getReferenceType()) {
	case IdentifiedList:
		return listService.delete(reference);
	case ReferenceSet:
		return referenceSetService.delete(reference);
	case ErrorDocument:
		return errorDocumentService.delete(reference);
	default:
		throw new ReferenceServiceException("Unknown reference type!");
	}
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:15,代碼來源:ReferenceServiceImpl.java

示例9: testDelete

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Test
public void testDelete() throws Exception {
	ReferenceContextImpl invocationContext = new ReferenceContextImpl();
	invocationContext.addEntity(new WorkflowRunIdEntity("wfRunListsTest"));
	for (ListServiceImpl service : serviceList){
		IdentifiedList<T2Reference> list =service.registerEmptyList(1, invocationContext);
		assertNotNull(service.getList(list.getId()));
		assertTrue(service.delete(list.getId()));
		assertNull(service.getList(list.getId()));
		assertFalse(service.delete(list.getId()));
	}
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:13,代碼來源:ListServiceTest.java

示例10: testDeleteIdentifiedListsForWFRun

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Test
public void testDeleteIdentifiedListsForWFRun() throws Exception {

	for (ListServiceImpl service : serviceList){
		
		String wfRunId1 = "wfRunListsTest1";
		ReferenceContextImpl invocationContext1 = new ReferenceContextImpl();
		invocationContext1.addEntity(new WorkflowRunIdEntity(wfRunId1));
		
		String wfRunId2 = "wfRunListsTest2";
		ReferenceContextImpl invocationContext2 = new ReferenceContextImpl();
		invocationContext2.addEntity(new WorkflowRunIdEntity(wfRunId2));
		
		IdentifiedList<T2Reference> list1 = service.registerEmptyList(2, invocationContext1);
		IdentifiedList<T2Reference> list2 = service.registerEmptyList(1, invocationContext1);
		IdentifiedList<T2Reference> list3 = service.registerEmptyList(1, invocationContext2);

		assertNotNull(service.getList(list1.getId()));
		assertNotNull(service.getList(list2.getId()));
		assertNotNull(service.getList(list3.getId()));

		service.deleteIdentifiedListsForWorkflowRun(wfRunId1);
		
		assertNull(service.getList(list1.getId()));
		assertNull(service.getList(list2.getId()));
		assertNotNull(service.getList(list3.getId()));

	}
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:30,代碼來源:ListServiceTest.java

示例11: describeEntity

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
protected Individual describeEntity(T2Reference t2Ref) throws IOException {
    URI dataURI = URI.create(uriGenerator.makeT2ReferenceURI(t2Ref.toUri()
            .toASCIIString()));

    Individual artifact = describedEntities.get(dataURI);
    if (artifact != null) {
        return artifact;
    }
    artifact = provModel.createArtifact(dataURI);
    describedEntities.put(dataURI, artifact);

    if (t2Ref.getReferenceType() == T2ReferenceType.ErrorDocument) {
        Individual error = provModel.createError(dataURI);
        ErrorDocument errorDoc = saver.getReferenceService()
                .getErrorDocumentService().getError(t2Ref);
        addMessageIfNonEmpty(error, errorDoc.getMessage());
        // getExceptionMEssage added by addStackTrace
        addStackTrace(error, errorDoc);
    } else if (t2Ref.getReferenceType() == T2ReferenceType.IdentifiedList) {
        IdentifiedList<T2Reference> list = saver.getReferenceService()
                .getListService().getList(t2Ref);
        Individual dictionary = provModel.createDictionary(dataURI);

        int pos = 0;
        for (T2Reference ref : list) {
            URI itemURI = URI.create(uriGenerator.makeT2ReferenceURI(ref
                    .toUri().toASCIIString()));
            Individual listItem = provModel.createArtifact(itemURI);
            provModel.addKeyPair(dictionary, pos++, listItem);
            describeEntity(ref);
        }
        if (list.isEmpty()) {
            artifact.addRDFType(provModel.EmptyCollection);
            artifact.addRDFType(provModel.EmptyDictionary);
        }
    }

    return artifact;
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:40,代碼來源:W3ProvenanceExport.java

示例12: findFirstFailure

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
private T2Reference findFirstFailure(T2Reference value) {
	IdentifiedList<T2Reference> originalList = lists.getList(value);
	for (T2Reference subValue : originalList) {
		if (subValue.getReferenceType().equals(ErrorDocument))
			return subValue;
		if (subValue.getReferenceType().equals(IdentifiedList))
			if (subValue.containsErrors())
				return findFirstFailure(subValue);
		// No need to consider value
	}
	return null;
}
 
開發者ID:apache,項目名稱:incubator-taverna-plugin-component,代碼行數:13,代碼來源:ProxyCallback.java

示例13: getErrors

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
private Set<T2Reference> getErrors(T2Reference ref) {
	Set<T2Reference> result = new HashSet<>();
	if (ref.getReferenceType().equals(ReferenceSet)) {
		// nothing
	} else if (ref.getReferenceType().equals(IdentifiedList)) {
		IdentifiedList<T2Reference> originalList = lists.getList(ref);
		for (T2Reference subValue : originalList)
			if (subValue.containsErrors())
				result.addAll(getErrors(subValue));
	} else
		result.add(ref);
	return result;
}
 
開發者ID:apache,項目名稱:incubator-taverna-plugin-component,代碼行數:14,代碼來源:ProxyCallback.java

示例14: get

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public synchronized IdentifiedList<T2Reference> get(T2Reference reference)
		throws DaoException {
	return store.get(reference);
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:6,代碼來源:InMemoryListDao.java

示例15: store

import org.apache.taverna.reference.IdentifiedList; //導入依賴的package包/類
@Override
public synchronized void store(IdentifiedList<T2Reference> theList)
		throws DaoException {
	store.put(theList.getId(), theList);
}
 
開發者ID:apache,項目名稱:incubator-taverna-engine,代碼行數:6,代碼來源:InMemoryListDao.java


注:本文中的org.apache.taverna.reference.IdentifiedList類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。