// Path: osgi.enroute.examples.backend.application/src/osgi/enroute/examples/backend/api/Backend.java
// public interface Backend {
// 	String TYPE = "type";
// 
// 	/**
// 	 * Save a blob
// 	 * 
// 	 * @param name
// 	 *            The name of the blob
// 	 * @param data
// 	 *            The actual data
// 	 * @return the meta data describing the details of the store
// 	 */
// 	MetaData save(String name, byte[] data) throws Exception;
// 
// 	/**
// 	 * Read the blob with the given name.
// 	 * 
// 	 * @param name
// 	 *            The name of the resource
// 	 * @return the data
// 	 */
// 	byte[] read(String name) throws Exception;
// 
// 	/**
// 	 * Return a list of the meta data of what the store has.
// 	 * 
// 	 * @return The list
// 	 */
// 	Collection<? extends MetaData> list() throws Exception;
// 
// 	/**
// 	 * Delete a blob
// 	 * 
// 	 * @param name
// 	 *            The name of the blob
// 	 * @return true if deleted, false if could not be deleted (might not exist)
// 	 */
// 	boolean delete(String name) throws Exception;
// }
// 
// Path: osgi.enroute.examples.backend.application/src/osgi/enroute/examples/backend/api/MetaData.java
// public class MetaData extends DTO {
// 	/**
// 	 * The name of the blob
// 	 */
// 	public String name;
// 
// 	/**
// 	 * The size of the blob
// 	 */
// 	public long size;
// 
// 	/**
// 	 * The epoch time when it was last modified.
// 	 */
// 	public long modified;
// }


import java.io.FileNotFoundException;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.osgi.service.component.annotations.Component;
import osgi.enroute.examples.backend.api.Backend;
import osgi.enroute.examples.backend.api.MetaData;
package osgi.enroute.examples.backend.memory.provider;




/**
 * Implementation of the backend API for an in memory store.
 */
@Component(property = Backend.TYPE + "=memory")
public class MemoryBackend implements Backend {
	private final ConcurrentMap<String, MetaDataImpl> memory = new ConcurrentHashMap<>();

	/*
	 * Reuse metadata to also contain the payload. We extend meta data so we can
	 * return them as MetaData objects.
	 */
// Path: osgi.enroute.examples.backend.application/src/osgi/enroute/examples/backend/api/Backend.java
// public interface Backend {
// 	String TYPE = "type";
// 
// 	/**
// 	 * Save a blob
// 	 * 
// 	 * @param name
// 	 *            The name of the blob
// 	 * @param data
// 	 *            The actual data
// 	 * @return the meta data describing the details of the store
// 	 */
// 	MetaData save(String name, byte[] data) throws Exception;
// 
// 	/**
// 	 * Read the blob with the given name.
// 	 * 
// 	 * @param name
// 	 *            The name of the resource
// 	 * @return the data
// 	 */
// 	byte[] read(String name) throws Exception;
// 
// 	/**
// 	 * Return a list of the meta data of what the store has.
// 	 * 
// 	 * @return The list
// 	 */
// 	Collection<? extends MetaData> list() throws Exception;
// 
// 	/**
// 	 * Delete a blob
// 	 * 
// 	 * @param name
// 	 *            The name of the blob
// 	 * @return true if deleted, false if could not be deleted (might not exist)
// 	 */
// 	boolean delete(String name) throws Exception;
// }
// 
// Path: osgi.enroute.examples.backend.application/src/osgi/enroute/examples/backend/api/MetaData.java
// public class MetaData extends DTO {
// 	/**
// 	 * The name of the blob
// 	 */
// 	public String name;
// 
// 	/**
// 	 * The size of the blob
// 	 */
// 	public long size;
// 
// 	/**
// 	 * The epoch time when it was last modified.
// 	 */
// 	public long modified;
// }


// Path: osgi.enroute.examples.backend.application/src/osgi/enroute/examples/backend/memory/provider/MemoryBackend.java
import java.io.FileNotFoundException;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.osgi.service.component.annotations.Component;
import osgi.enroute.examples.backend.api.Backend;
import osgi.enroute.examples.backend.api.MetaData;

package osgi.enroute.examples.backend.memory.provider;




/**
 * Implementation of the backend API for an in memory store.
 */
@Component(property = Backend.TYPE + "=memory")
public class MemoryBackend implements Backend {
	private final ConcurrentMap<String, MetaDataImpl> memory = new ConcurrentHashMap<>();

	/*
	 * Reuse metadata to also contain the payload. We extend meta data so we can
	 * return them as MetaData objects.
	 */
	public static class MetaDataImpl extends MetaData {