/** * Parses the provided {@code Opal.ServiceCfgDto} instance and returns a {@code * OpalConfigurationExtension} * * @param serviceDto the {@code Opal.ServiceCfgDto} to parse * @param name the name of the service * @return a {@code OpalConfigurationExtension} */ public void put(Opal.ServiceCfgDto serviceDto, String name) throws RuntimeException { if (serviceDto == null) throw new IllegalArgumentException("serviceDto cannot be null"); for (ServiceConfigurationHandler handler : handlers) { if (handler.canPut(serviceDto)) { handler.put(serviceDto); } } }
/** * Parses the provided {@code OpalConfigurationExtension} instance and returns a {@code * Opal.ServiceCfgDto} * * @param configExtension the {@code OpalConfigurationExtension} to parse * @param name the name of the service * @return a {@code Opal.ServiceCfgdto} * @throws org.obiba.opal.core.runtime.NoSuchServiceConfigurationException when no {@code * OpalConfigurationExtension} is available */ public Opal.ServiceCfgDto get(OpalConfigurationExtension configExtension, String name) throws NoSuchServiceConfigurationException { if (configExtension == null) throw new IllegalArgumentException("configExtension cannot be null"); for (ServiceConfigurationHandler handler : handlers) { if (handler.canGet(configExtension)) { return handler.get(configExtension); } } throw new NoSuchServiceConfigurationException("No configuration for service: " + name); }