001/*
002 * (C) Copyright 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 *
019 * $Id$
020 */
021
022package org.nuxeo.ecm.core.convert.api;
023
024import java.io.Serializable;
025import java.util.List;
026
027/**
028 * Result object for an availability check on a Converter.
029 * <p>
030 * Contains an availability flag + error and installation message is needed.
031 *
032 * @author tiry
033 */
034public class ConverterCheckResult implements Serializable {
035
036    private static final long serialVersionUID = 1L;
037
038    protected boolean available;
039
040    protected String installationMessage;
041
042    protected String errorMessage;
043
044    protected List<String> supportedInputMimeTypes;
045
046    public ConverterCheckResult() {
047        available = true;
048    }
049
050    public ConverterCheckResult(String installationMessage, String errorMessage) {
051        available = false;
052        this.installationMessage = installationMessage;
053        this.errorMessage = errorMessage;
054    }
055
056    public boolean isAvailable() {
057        return available;
058    }
059
060    // Never used. Remove?
061    public void setAvailable(boolean available) {
062        this.available = available;
063    }
064
065    public String getInstallationMessage() {
066        return installationMessage;
067    }
068
069    public String getErrorMessage() {
070        return errorMessage;
071    }
072
073    public List<String> getSupportedInputMimeTypes() {
074        return supportedInputMimeTypes;
075    }
076
077    public void setSupportedInputMimeTypes(List<String> supportedInputMimeTypes) {
078        this.supportedInputMimeTypes = supportedInputMimeTypes;
079    }
080
081}