/** * Check whether the converter registry has been defined, throw a * ReferenceServiceException if not */ protected final void checkConverterRegistry() throws ReferenceServiceException { if (converterRegistry == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance registry of ValueToReferenceConvertorSPI " + "to enable on the fly mapping of arbitrary objects " + "during compound registration"); } }
/** * Check whether the converter registry has been defined, throw a * ReferenceServiceException if not */ protected final void checkConverterRegistry() throws ReferenceServiceException { if (converterRegistry == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance registry of ValueToReferenceConvertorSPI " + "to enable on the fly mapping of arbitrary objects " + "during compound registration"); } }
/** * Check whether the converter registry has been defined, throw a * ReferenceServiceException if not */ protected final void checkConverterRegistry() throws ReferenceServiceException { if (converters == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance registry of ValueToReferenceConvertorSPI " + "to enable on the fly mapping of arbitrary objects " + "during compound registration"); } }
/** * Throw a ReferenceServiceException if methods in ReferenceService are * called without the necessary sub-services configured. */ protected final void checkServices() throws ReferenceServiceException { if (errorDocumentService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ErrorDocumentService to function"); } if (referenceSetService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ReferenceSetService to function"); } if (listService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ListService to function"); } }
/** * Throw a ReferenceServiceException if methods in ReferenceService are * called without the necessary sub-services configured. */ protected final void checkServices() throws ReferenceServiceException { if (errorDocumentService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ErrorDocumentService to function"); } if (referenceSetService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ReferenceSetService to function"); } if (listService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ListService to function"); } }
/** * Throw a ReferenceServiceException if methods in ReferenceService are * called without the necessary sub-services configured. */ protected final void checkServices() throws ReferenceServiceException { if (errorDocumentService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ErrorDocumentService to function"); } if (referenceSetService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ReferenceSetService to function"); } if (listService == null) { throw new ReferenceServiceException( "Reference service must be configued with an " + "instance of ListService to function"); } }
public void deleteReferencesForWorkflowRun(String workflowRunId) throws ReferenceServiceException { String errorString = ""; try{ listService.deleteIdentifiedListsForWorkflowRun(workflowRunId); } catch(ReferenceServiceException resex){ errorString += "Failed to delete lists for workflow run: " + workflowRunId + "."; } try{ referenceSetService.deleteReferenceSetsForWorkflowRun(workflowRunId); } catch(ReferenceServiceException resex){ errorString += "Failed to delete reference sets for workflow run: " + workflowRunId + "."; } try{ errorDocumentService.deleteErrorDocumentsForWorkflowRun(workflowRunId); } catch(ReferenceServiceException resex){ errorString += "Failed to delete error documents for workflow run: " + workflowRunId +"."; } if (!errorString.equals("")){ throw new ReferenceServiceException(errorString); } }
public Object renderIdentifier(T2Reference id, Class<?> leafClass, ReferenceContext context) throws ReferenceServiceException { // Check we have the services installed checkServices(); // Insert an empty context if context was null context = EmptyReferenceContext.checkContext(context); // Reject if the source reference contains errors if (id.containsErrors()) { throw new ReferenceServiceException( "Can't render an identifier which contains errors to a POJO"); } // Attempt to find an appropriate StreamToValueConverterSPI instance to // build the specified class StreamToValueConverterSPI<?> converter = null; if (valueBuilderRegistry != null) { for (StreamToValueConverterSPI<?> stvc : valueBuilderRegistry) { Class<?> builtClass = stvc.getPojoClass(); if (leafClass.isAssignableFrom(builtClass)) { converter = stvc; break; } } } if (converter == null) { log.warn("No stream->value converters found for type '" + leafClass.getCanonicalName() + "'"); } // Render the identifier return renderIdentifierInner(id, leafClass, context, converter); }
IdentifiedList<T2Reference> idList = listService.getList(id); if (idList == null) { throw new ReferenceServiceException("Could not find IdentifiedList " + id); throw new ReferenceServiceException(lse); ReferenceSet rs = referenceSetService.getReferenceSet(id); if (rs == null) { throw new ReferenceServiceException("Could not find ReferenceSet " + id); throw new ReferenceServiceException( "Can't render an empty reference set to a POJO"); throw new ReferenceServiceException(e); throw new ReferenceServiceException( "No converter found, and reference set didn't contain" + " an appropriate value carrying reference, cannot render to POJO"); throw new ReferenceServiceException("Unsupported ID type : " + id.getReferenceType());
throw new ReferenceServiceException( "Can't render an identifier which contains errors to a POJO");
throw new ReferenceServiceException( "Can't render an identifier which contains errors to a POJO");
throw new ReferenceServiceException(lse); throw new ReferenceServiceException( "Can't render an empty reference set to a POJO"); throw new ReferenceServiceException(e); throw new ReferenceServiceException( "No converter found, and reference set didn't contain" + " an appropriate value carrying reference, cannot render to POJO"); throw new ReferenceServiceException("Unsupported ID type : " + id.getReferenceType());
throw new ReferenceServiceException(lse); throw new ReferenceServiceException( "Can't render an empty reference set to a POJO"); throw new ReferenceServiceException(e); throw new ReferenceServiceException( "No converter found, and reference set didn't contain" + " an appropriate value carrying reference, cannot render to POJO"); throw new ReferenceServiceException("Unsupported ID type : " + id.getReferenceType());
public boolean delete(T2Reference reference) throws ReferenceServiceException { boolean result=false; switch (reference.getReferenceType()) { case IdentifiedList: result=listService.delete(reference); break; case ReferenceSet: result=referenceSetService.delete(reference); break; case ErrorDocument: result=errorDocumentService.delete(reference); break; default: throw new ReferenceServiceException( "Unknown reference type!"); } return result; }
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( "Cannot traverse to a negative depth"); throw new ReferenceServiceException(lse); throw new ReferenceServiceException( "Should never be trying to drill inside a data document identifier"); case ErrorDocument: break; default: throw new ReferenceServiceException( "Fallen off end of case statement, unknown reference type!");
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( "Cannot traverse to a negative depth"); throw new ReferenceServiceException(lse); throw new ReferenceServiceException( "Should never be trying to drill inside a data document identifier"); case ErrorDocument: break; default: throw new ReferenceServiceException( "Fallen off end of case statement, unknown reference type!");
checkServices(); if (desiredDepth < 0) { throw new ReferenceServiceException( "Cannot traverse to a negative depth"); throw new ReferenceServiceException(lse); throw new ReferenceServiceException( "Should never be trying to drill inside a data document identifier"); case ErrorDocument: break; default: throw new ReferenceServiceException( "Fallen off end of case statement, unknown reference type!");
throw new ReferenceServiceException(rsse); return ed; } catch (ErrorDocumentServiceException edse) { throw new ReferenceServiceException(edse); return newList; } catch (ListServiceException lse) { throw new ReferenceServiceException(lse); throw new ReferenceServiceException("Unsupported ID type : " + id.getReferenceType());
throw new ReferenceServiceException("Could not find ReferenceSet " + reference); throw new ReferenceServiceException( "Can't render an empty reference set to a POJO");
throw new ReferenceServiceException("Could not find ReferenceSet " + reference); throw new ReferenceServiceException( "Can't render an empty reference set to a POJO");