/**
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 *
 * Copyright (C)
 * <a href="http://www.inab.org">Spanish National Institute of Bioinformatics (INB)</a>
 * <a href="http://www.bsc.es">Barcelona Supercomputing Center (BSC)</a>
 * <a href="http://inb.bsc.es">Computational Node 6</a>
 */

package org.inb.biomoby.shared.message;

import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author Dmitry Repchevsky
 */

@XmlRootElement(name="serviceNotes")
public class ServiceNotes implements Serializable
{
    private String notes;
    
    private MobyExceptions exceptions;
            
    @XmlElement
    public void setNotes(String notes)
    {
        this.notes = notes;
    }
    
    public String getNotes()
    {
        return notes;
    }

    @XmlElementRef
    public MobyExceptions getExceptions()
    {
        if (exceptions == null)
        {
            exceptions = new MobyExceptions();
        }
        
        return exceptions;
    }
    
    public void addException(MobyException exception)
    {
        getExceptions().add(exception);
    }
    
    public boolean hasExceptions()
    {
        return exceptions != null && !exceptions.isEmpty();
    }
}
