/*
 * ************************************************************************
 *
 * ADOBE SYSTEMS INCORPORATED
 * Copyright 2013 Adobe Systems Incorporated
 * All Rights Reserved.
 * NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the 
 * terms of the Adobe license agreement accompanying it.  If you have received this file from a 
 * source other than Adobe, then your use, modification, or distribution of it requires the prior 
 * written permission of Adobe.
 *
 **************************************************************************
 */

package com.adobe.primetime.reference.feeds;

import java.util.List;

import com.adobe.mediacore.metadata.AdSignalingMode;
import com.adobe.mediacore.metadata.AdvertisingMetadata;
import com.adobe.mediacore.metadata.Metadata;
import com.adobe.primetime.reference.feeds.ContentRenditionInfo.ContentType;
import com.adobe.primetime.reference.utils.SerializableNameValuePair;

/**
 * The IFeedItemAdapter is the interface to be implemented for retrieving
 * specific data for a given content item.
 */
public interface IFeedItemAdapter {
	/**
	 * Returns the content identifier from the response. Can map to an item guid
	 * that may be included in the response.
	 * 
	 * @return String - item identifier
	 */
	 String getId();

	/**
	 * Returns the content's title
	 * 
	 * @return String - content title
	 */
	 String getTitle();

	/**
	 * Returns the content type as live or vod.
	 * 
	 * @return ContentType - see ContentType enum definition above.
	 */
	 ContentType getContentType();

	/**
	 * Returns the list of all ContentRenditionInfo objects for the renditions of
	 * this content.
	 * 
	 * @return List<ContentRenditionInfo> - if one or more content renditions
	 *         exist. null - if no content renditions exist.
	 */
	 List<ContentRenditionInfo> getContentRenditions();

    /**
     * Return the list of ContentRenditionInfo objects for the given rendition type.
     * The rendition type must match the name of a valid MediaResource.Type.
     * @param type name of a valid MediaResource.Type
     * @return list of ContentRenditionInfo for the given type
     *  or null if no content renditions exist for the given type.
     */
    List<ContentRenditionInfo> getContentRenditionsByType(String type);


    /**
     * Returns the Metadata that contains key/value pair for use when creating a MediaPlayerResource.
     * Specifically this will contain Metadata used by the application, such as VideoAnalytics metadata
     * and Entitlement metadata. Any advertising specific metadata is found in the AdvertisingMetadata
     * and not in this Metadata.
     *
     * @return com.adobe.mediacore.metadata.Metadata - if the content includes metadata,
     *         null otherwise.
     * @see #getAdvertisingMetadata()
     */
    Metadata getResourceMetadata();

    /**
     * Returns the Metadata that contains the key/value pair pointing to a
     * specific Metadata type like AdvertisingMetadata, direct ad breaks in a
     * JSON metadata string or custom ad markers metadata which are supported by
     * PSDK's corresponding inbuilt AdProvider implementations. The Metadata
     * type can also refer to any custom Metadata subclass with a
     * custom AdProvider implementation that may be defined and registered by
     * the client.
     *
     * Refer to the PSDK for creating
     * com.adobe.mediacore.timeline.advertising.AdvertisingMetadata. The Metadata returned
     * should have a key set to
     * com.adobe.mediacore.metadata.MetadataKeys.AUDITUDE_METADATA_KEY
     * and value set to an instance of AdvertisingMetadata.
     *
     * The JSON Metadata String for direct ad breaks expects data in a certain
     * format, see the Reference JSON structure for the JSON for ad breaks. The
     * Metadata returned should have an entry with key set to
     * com.adobe.mediacore.metadata.MetadataKeys.JSON_METADATA_KEY and
     * value set to the json string representing the ad breaks.
     *
     * Refer to com.adobe.mediacore.utils.TimeRangeCollection for creating
     * custom ad markers metadata. The Metadata returned should have an
     * entry with key set to com.adobe.mediacore.metadata.MetadataKeys.
     * CUSTOM_AD_MARKERS_METADATA_KEY and value set to the object returned by
     * TimeRangeCollection.toMetadata().
     *
     * Refer to the Primetime Reference Implementation for an example on how each
     * of these metadata types as well as a custom Metadata type are created
     * using the reference JSON structure.
     *
     * @return com.adobe.mediacore.metadata.AdvertisingMetadata - if the content
     *         includes metadata. Currently this is limited to ad-related
     *         metadata used by the PSDK for ad serving. null - if the content
     *         response does not include any metadata
     */
    AdvertisingMetadata getAdvertisingMetadata();

    /**
     * Returns the AdSignalingMode configured for this item.
     * @return the AdSignalingMode configured for this item, or AdSignalingMode.DEFAULT if
     *  the AdSignalingMode wasn't explicitly set.
     *
     *  @see com.adobe.mediacore.metadata.AdSignalingMode
     */
    AdSignalingMode getAdSignalingMode();

	/**
	 * Returns a URL to a thumbnail for this item that will be used as the large
	 * thumbnail in the app.
	 * 
	 * @return String - containing the URL if the response contains a URL to a
	 *         thumbnail that can be classified as "large". null - if the
	 *         response does not include the URL to a thumbnail that the client
	 *         would like to display as the large thumbnail
	 */
	 String getStreamThumbnailLarge();

	/**
	 * Returns a URL to a thumbnail for this item that will be used as the small
	 * thumbnail in the app.
	 * 
	 * @return String - containing the URL if the response contains a URL to a
	 *         thumbnail that can be classified as "small". null - if the
	 *         response does not include the URL to a thumbnail that the client
	 *         would like to display as the small thumbnail
	 */
	 String getStreamThumbnailSmall();

	/**
	 * Returns a list of properties as name value pairs such as content
	 * categories, keywords etc that can be used by the app to enhance the
	 * experience.
	 * 
	 * @return List<SerializableNameValuePair> - the list may be empty if no
	 *         properties need to be set.
	 */
	 List<SerializableNameValuePair> getProperties();
     String getDrmType() ;
     String getLicenseServerUrl() ;
}
