package org.lp20.aikuma.storage;

import java.util.List;
import java.util.Map;

public interface Index {

	/**
	 * Downloads metadata for the item.
	 * 
	 * @param identifier
	 * @return The metadata for the item as a key-value pairs. Null if item is
	 *   not found in the index.
	 */
	public abstract Map<String, String> get_item_metadata(String identifier);

	/**
	 * Search the index according to the specified constraints.
	 * TODO: Specify the structure of the constraints param.
	 * @param constraints
	 * @return A list of item ids.
	 */
	public abstract List<String> search(Map<String,String> constraints);

	/**
	 * Index an item. If item already exists, it gets updated.
	 * For metadata, the following keys are required:
	 * 
	 *   - data_store_uri
	 *   - item_id
	 *   - file_type
	 *   - language
	 *   - speakers (comma-separated list)
	 * 
	 * @param identifier
	 * @param metadata
	 */
	public abstract void index(String identifier, Map<String,String> metadata);

}
@@ -757,46 +757,171 @@
 _uri
-%0A%09 *   - item_id%0A%09 *   - file_type%0A%09 *
+ - the Google Drive URI%0A%09 *   - item_id        - A way of grouping multiple items under a single identifier%0A%09 *   - file_type      - Mime type%0A%09 *   - language    
    -
@@ -969,16 +969,27 @@
 ed list)
+ - speakers
 %0A%09 * %0A%09 

add documentation to index method parameters