/********************************************************************
* API for Servlets and SignatureGenerators in RAP
*  enabling extensible behaviors for RAP Digital Objects
* RAP - Repository Access Protocol
********************************************************************/
package ServletAPI;

/**
 * The attachment specification of a RAP Servlet describes the relationship
 * between the Servlet and DataStreams for a StandardDisseminator in a RAP
 * Digital Object.  The Servlet's attachment specification is comprised
 * of a (possibly empty) array of AttachmentRoleSpecs,
 * indicating what kinds of DataStreams the Servlet needs to operate.   
 * Each AttachmentRoleSpec defines a "role name" used to tag one
 * or more DataStreams as playing a particular role from the Servlet's 
 * perspective (e.g. the role of "TableOfContents" for a book Servlet).
 *
 * @author Christophe Blanchi
 * @author Sandy Payette
 * @author Naomi Dushay
 **/
public class AttachmentRoleSpec
{
    /**
     * a name indicating the "role" the Servlet requires of DataStream(s)
     **/
    public String roleName;

    /**
     * true if attaching DataStream(s) to this "role" is required
     **/
    public boolean requiredIndicator;

    /**
     * number of DataStreams to be attached to this "role"
     **/
    public ServletAPI.Ordinality ordinality;

    /**
     * acceptable MIMEtypes for the DataStream(s) attached to this "role"
     **/
    public String[] MIMETypes;
    
    public AttachmentRoleSpec(
            String roleName, 
            boolean requiredIndicator,
            ServletAPI.Ordinality ordinality,
            String[] MIMETypes)
    {
        this.roleName = roleName;
        this.requiredIndicator = requiredIndicator;
        this.ordinality = ordinality;
        this.MIMETypes = MIMETypes;
    }
}