/* ======================================================================
   Parts Copyright 2006 University of Leeds, Oxford University, University of the Highlands and Islands.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

====================================================================== */

package org.bodington.server.resources;

import java.io.*;

import org.bodington.database.PrimaryKey;

/**
 * Class that encapsulates the summary of a resource.
 * @see Resource
 * @author Jon Maber
 * @author Antony Corfield
 */
public class ResourceSummary implements java.io.Serializable
{
    private PrimaryKey resource_id;

    private int http_facility_no;
    private String name;
	private String title;
	private String introduction;
	private String description;
    
    /**
     * Instance variable for an open date.
     */
    private java.util.Date openDate;
    
    /**
     * Instance variable for an close date.
     */
    private java.util.Date closeDate;

    public String toString()
    	{
        // This method is derived from class java.lang.Object
        // to do: code goes here
        if ( title==null )
        	return "No title.";
        return title;
    	}

	public PrimaryKey getResourceId()
		{
		return resource_id;
		}
	public void setResourceId( PrimaryKey k )
		{
		resource_id= k;
		}

	public int getHttpFacilityNo()
		{
		return http_facility_no;
		}
	public void setHttpFacilityNo( int f )
		{
		http_facility_no=f;
		}

	public String getName()
		{
		return name;
		}
	public void setName( String x )
		{
		name=x;
		}

	public String getTitle()
		{
		return title;
		}
	public void setTitle( String x )
		{
		title=x;
		}

	public String getDescription()
		{
		return description;
		}
	public void setDescription( String x )
		{
		description=x;
		}

	public String getIntroduction()
		{
		return introduction;
		}
	public void setIntroduction( String x )
		{
		introduction=x;
		}
    
    /**
     * Get the date for when this resource will be available.
     * @return the date for when this resource will be available.
     */
    public java.util.Date getOpenDate()
        {
        return openDate;
        }

    /**
     * Set the date for when this resource will be available.
     * @param d the date for when this resource will be available.
     */
    public void setOpenDate( java.util.Date d )
        {
        openDate = d;
        }

    /**
     * Get the date for when this resource will no longer be available.
     * @return the date for when this resource will no longer be available.
     */
    public java.util.Date getCloseDate()
        {
        return closeDate;
        }

    /**
     * Set the date for when this resource will no longer be available.
     * @param d the date for when this resource will no longer be available.
     */
    public void setCloseDate( java.util.Date d )
        {
        closeDate = d;
        }
    }
