package de.ddb.pdc.metadata;

import org.springframework.web.client.RestClientException;

/**
 * Interface for retrieving metadata about items in the DDB database.
 */
public interface MetaFetcher {

  /**
   * Searches the DDB for items whose metadata contains the passed substring.
   *
   * @param query                substring to search for
   * @param maxCount             maximum number of items to return
   * @return                     matching items
   * @throws RestClientException if communication with the DDB API fails
   */
  public DDBItem[] searchForItems(String query, int maxCount)
      throws RestClientException;

  /**
   * Fills the passed {@link DDBItem} with all metadata available in the
   * DDB database.
   *
   * @param itemId               ID of item to fill
   * @return                     the item
   * @throws RestClientException if communication with the DDB API fails
   */
  public DDBItem fetchMetadata(String itemId) throws RestClientException;
}

@@ -585,23 +585,51 @@
 ry, int 
-maxCoun
+startItem, int maxCount, String sor
 t)%0A     

improve Interface with startItem and sort order