public synchronized Optional<String> addConfiguration(String niceName, String description, Map<String, Object> config) {
		try {
			if (catalog==null) {
				throw new FileNotFoundException();
			}
			return sync(()-> {
				ConfigurationDetails p = new ConfigurationDetails.Builder(inventory.nextIdentifier())
						.niceName(niceName)
						.description(description).build();
				try {
					InventoryEntry ret = InventoryEntry.create(new Configuration(p, new HashMap<>(config)), newConfigurationFile());
					inventory.add(ret);
					return Optional.of(ret.getIdentifier());
				} catch (IOException e) {
					logger.log(Level.WARNING, "Failed to add configuration.", e);
					return Optional.empty();
				}
			});
		} catch (IOException e) {
			logger.log(Level.WARNING, "Could not add configuration", e);
			return Optional.empty();
		}
	}
public synchronized Optional < String > addConfiguration ( String niceName , String description , Map < String , Object > config ) { try { if ( catalog == null ) { throw new FileNotFoundException ( ) ; } return sync ( ( ) -> { ConfigurationDetails p = new ConfigurationDetails . Builder ( inventory . nextIdentifier ( ) ) . niceName ( niceName ) . description ( description ) . build ( ) ; try { InventoryEntry ret = InventoryEntry . create ( new Configuration ( p , new HashMap < > ( config ) ) , newConfigurationFile ( ) ) ; inventory . add ( ret ) ; return Optional . of ( ret . getIdentifier ( ) ) ; } catch ( IOException e ) { logger . log ( Level . WARNING , "Failed to add configuration." , e ) ; return Optional . empty ( ) ; } } ) ; } catch ( IOException e ) { logger . log ( Level . WARNING , "Could not add configuration" , e ) ; return Optional . empty ( ) ; } }
Adds a configuration to this catalog.
@param niceName the display name
@param description the configuration description
@param config the configuration details
@return the identifier for the new configuration, or an empty optional if the configuration could not be added