public void run() { try { ErrorDocument e = errorDao.get(id); callback.errorRetrieved(e); } catch (DaoException de) { callback .errorRetrievalFailed(new ErrorDocumentServiceException( de)); } } };
public void run() { try { ReferenceSet rs = referenceSetDao.get(id); callback.referenceSetRetrieved(rs); } catch (DaoException de) { callback .referenceSetRetrievalFailed(new ReferenceSetServiceException( de)); } } };
private FileReference getAsFileReference(ReferenceService referenceService, T2Reference t2Reference) { Identified identified = referenceService.resolveIdentifier(t2Reference, null, null); if (identified instanceof ReferenceSet) { for (ExternalReferenceSPI ref : ((ReferenceSet) identified).getExternalReferences()) { if (ref instanceof FileReference) { return (FileReference) ref; } } } return null; }
private T2Reference findFirstFailure(T2Reference value) { IdentifiedList<T2Reference> originalList = listService.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; }
protected InputStream getAsStream(ReferenceService referenceService, T2Reference t2Reference) { Identified identified = referenceService.resolveIdentifier(t2Reference, null, null); if (identified instanceof ReferenceSet) { ExternalReferenceSPI ref = ((ReferenceSet) identified).getExternalReferences().iterator().next(); return ref.openStream(invocationContext); } return null; }
/** * {@inheritDoc} */ public ReferenceSet getReferenceSet(T2Reference id) throws ReferenceSetServiceException { checkDao(); try { return referenceSetDao.get(id); } catch (DaoException de) { throw new ReferenceSetServiceException(de); } }
public ErrorDocument getError(T2Reference id) throws ErrorDocumentServiceException { checkDao(); try { return errorDao.get(id); } catch (Throwable t) { throw new ErrorDocumentServiceException(t); } }
public int compare(ExternalReferenceSPI o1, ExternalReferenceSPI o2) { return (int) (o1.getResolutionCost() - o2 .getResolutionCost()); } });
public Class<? extends ExternalReferenceSPI> getTargetType() { if (translators.isEmpty() == false) { return translators.get(translators.size() - 1) .getTargetReferenceType(); } else if (this.initialBuilder != null) { return this.initialBuilder.getReferenceType(); } else { return null; } }
/** * Check that the list dao is configured * * @throws ListServiceException * if the dao is still null */ protected final void checkDao() throws ListServiceException { if (listDao == null) { throw new ListServiceException("ListDao not initialized, list " + "service operations are not available"); } }
/** * Check that the t2reference generator is configured * * @throws ReferenceSetServiceException * if the generator is still null */ protected final void checkGenerator() throws ReferenceSetServiceException { if (t2ReferenceGenerator == null) { throw new ReferenceSetServiceException( "T2ReferenceGenerator not initialized, reference " + "set service operations not available"); } }
public void run() { try { ReferenceSet rs = referenceSetDao.get(id); callback.referenceSetRetrieved(rs); } catch (DaoException de) { callback .referenceSetRetrievalFailed(new ReferenceSetServiceException( de)); } } };
private static SshReference getAsSshReference(ReferenceService referenceService, T2Reference t2Reference) { Identified identified = referenceService.resolveIdentifier(t2Reference, null, null); if (identified instanceof ReferenceSet) { for (ExternalReferenceSPI ref : ((ReferenceSet) identified).getExternalReferences()) { if (ref instanceof SshReference) { SshReference sshRef = (SshReference) ref; return sshRef; } } } return null; }
public void run() { try { ErrorDocument e = errorDao.get(id); callback.errorRetrieved(e); } catch (DaoException de) { callback .errorRetrievalFailed(new ErrorDocumentServiceException( de)); } } };
public ErrorDocument getError(T2Reference id) throws ErrorDocumentServiceException { checkDao(); try { return errorDao.get(id); } catch (Throwable t) { throw new ErrorDocumentServiceException(t); } }
public int compare(ExternalReferenceSPI o1, ExternalReferenceSPI o2) { return (int) (o1.getResolutionCost() - o2 .getResolutionCost()); } });
public Class<? extends ExternalReferenceSPI> getTargetType() { if (translators.isEmpty() == false) { return translators.get(translators.size() - 1).getTargetReferenceType(); } else if (this.initialBuilder != null) { return this.initialBuilder.getReferenceType(); } else { return null; } }
public void run() { try { ReferenceSet rs = referenceSetDao.get(id); callback.referenceSetRetrieved(rs); } catch (DaoException de) { callback .referenceSetRetrievalFailed(new ReferenceSetServiceException( de)); } } };
public void run() { try { ErrorDocument e = errorDao.get(id); callback.errorRetrieved(e); } catch (DaoException de) { callback .errorRetrievalFailed(new ErrorDocumentServiceException( de)); } } };
public int compare(ExternalReferenceSPI o1, ExternalReferenceSPI o2) { return (int) (o1.getResolutionCost() - o2 .getResolutionCost()); } });