// MobyResourceRef.java
//
//    martin.senger@gmail.com
//    August 2005
//

package org.biomoby.shared;

import java.net.URL;

/**
 * A container pointing to metadata available from a BioMoby
 * registry. The metadata describe entities that were registered in
 * the registry (such as Service instances, or data types), but they
 * may include additional attributes. This class does not contain
 * resource metadata themselves but a location where they are, and
 * their content type. <p>
 *
 * @author <A HREF="mailto:martin.senger@gmail.com">Martin Senger</A>
 * @version $Id: MobyResourceRef.java,v 1.6 2009/06/09 18:56:55 gordonp Exp $
 */

public class MobyResourceRef implements java.io.Serializable{

    protected String resourceName;
    protected URL location;
    protected String contentType = "application/rdf+xml";

    /**************************************************************************
     * Normal constructor. <p>
     *
     * @param resourceName is an ontology name (must be one of these:
     * {@link Central#SERVICE_TYPES_RESOURCE_NAME}, {@link
     * Central#DATA_TYPES_RESOURCE_NAME}, {@link
     * Central#NAMESPACES_RESOURCE_NAME}, {@link
     * Central#SERVICE_INSTANCES_RESOURCE_NAME}, {@link
     * Central#FULL_RESOURCE_NAME})
     *
     * @param location where this resource can be fetched from
     *
     * @param contentType a MIME type of the resource; we know that
     * the resources are RDF documents - but they made be compressed -
     * that's why we have this type here (default is
     * "application/rdf+xml")
     *************************************************************************/
    public MobyResourceRef (String resourceName, URL location, String contentType) {
	this.resourceName = resourceName;
	this.location = location;
	if (contentType != null)
	    this.contentType = contentType;
    }

    /**
     * Return resource name.
     */
    public String getResourceName() {
	return resourceName;
    }

    /**
     * Return resource location.
     */
    public URL getResourceLocation() {
	return location;
    }

    /**
     * Return resource content type. 
     *
     * @deprecated Biomoby registry never gives the content type
     * back. Therefore, this method does not have anything reasonable
     * to return.
     */
    public String getResourceContentType() {
	return contentType;
    }
}
