@Override public String createModule(String providerURN, String parameters) { try { ModuleURN urn = mManager.createModuleJMX( new ModuleURN(providerURN), parameters); return urn.getValue(); } catch (ModuleException e) { throw transformFailure(e); } }
@Override public void deleteModule(String inModuleURN){ try { mManager.deleteModule(toModuleURN(inModuleURN)); } catch (I18NException e) { throw transformFailure(e); } }
@Override public DataFlowID createDataFlow(String inRequests, boolean inAppendSink) { try { return mManager.createDataFlow(parseDataRequests(inRequests), inAppendSink); } catch (ModuleException e) { throw transformFailure(e); } }
@Override public List<String> getModuleInstances(String providerURN){ try { return toString(mManager.getModuleInstances( toModuleURN(providerURN))); } catch (I18NException e) { throw transformFailure(e); } }
@Override public void start(String inModuleURN) { try { mManager.start(toModuleURN(inModuleURN)); } catch (I18NException e) { throw transformFailure(e); } }
@Override public ModuleInfo getModuleInfo(String inModuleURN) { try { return mManager.getModuleInfo(toModuleURN(inModuleURN)); } catch (I18NException e) { throw transformFailure(e); } }
/** * Fails if invoked from within * {@link DataEmitter#requestData(DataRequest, DataEmitterSupport)} or * {@link DataEmitter#cancel(DataFlowID, RequestID)}. * * @throws ModuleException if its an incorrect nested flow request. */ private static void verifyIncorrectInvocation() throws ModuleException { if(AbstractDataCoupler.isNestedFlowCall()) { throw new ModuleException(Messages.INCORRECT_NESTED_FLOW_REQUEST); } } private final Module mRequester;
/** * Returns statistics on various types of data received by * the sink module. * The map has the data type name as the key and a counter of number * of instances that have been received by the sink module as the value * * @return map containing statistics on the different types of data * received by the module */ @DisplayName("Statistics based on data types") Map<String, Integer> getTypeStats();
@Override public void stop(String inModuleURN) { try { mManager.stop(toModuleURN(inModuleURN)); } catch (I18NException e) { throw transformFailure(e); } }
@Override public List<String> getProviders() { return toString(mManager.getProviders()); }
@Override public DataFlowInfo getDataFlowInfo(String inFlowID) { try { return mManager.getDataFlowInfo(toFlowID(inFlowID)); } catch (DataFlowNotFoundException e) { throw transformFailure(e); } }
@Override public ProviderInfo getProviderInfo(String providerURN){ try { return mManager.getProviderInfo(toModuleURN(providerURN)); } catch (I18NException e) { throw transformFailure(e); } }
@Override public void cancel(String inFlowID) { try { mManager.cancel(toFlowID(inFlowID)); } catch (I18NException e) { throw transformFailure(e); } }
@Override public void refresh() { try { mManager.refresh(); } catch (I18NException e) { throw transformFailure(e); } }
@Override public void cancel(DataFlowID inFlowID) throws ModuleException { verifyIncorrectInvocation(); mManager.cancel(inFlowID, mRequester); }
@Override public DataFlowID createDataFlow(DataRequest[] inRequests, boolean inAppendSink) throws ModuleException { verifyIncorrectInvocation(); return mManager.createDataFlow(inRequests, inAppendSink, mRequester); }
@Override public String toString() { return toStringRequest().getData(); } /**
/** * The receiver module's URN. * * @return receiver module's URN. */ final ModuleURN getReceiverURN() { return mReceiver.getURN(); }
/** * The string that should be prefixed to any orderIDs generated by * the client based on IDs issued by the server. * * @return the orderID prefix. */ @DisplayName("The order ID prefix") String getIDPrefix();
@Override public DataFlowID createDataFlow(String inRequests) { try { return mManager.createDataFlow(parseDataRequests(inRequests)); } catch (ModuleException e) { throw transformFailure(e); } }