001/*
002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 *
005 * All rights reserved. This program and the accompanying materials
006 * are made available under the terms of the GNU Lesser General Public License
007 * (LGPL) version 2.1 which accompanies this distribution, and is available at
008 * http://www.gnu.org/licenses/lgpl.html
009 *
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013 * Lesser General Public License for more details.
014 *
015 * Contributors:
016 *     ldoguin
017 */
018package org.nuxeo.ecm.platform.routing.dm.adapter;
019
020import org.nuxeo.ecm.core.api.DocumentModel;
021import org.nuxeo.ecm.core.api.adapter.DocumentAdapterFactory;
022import org.nuxeo.ecm.platform.routing.dm.api.RoutingTaskConstants;
023
024/**
025 * @author ldoguin
026 * @deprecated since 5.9.2 - Use only routes of type 'graph'
027 */
028@Deprecated
029public class TaskStepAdapterFactory implements DocumentAdapterFactory {
030
031    @Override
032    public Object getAdapter(DocumentModel doc, @SuppressWarnings("rawtypes") Class itf) {
033        if (doc.hasFacet(RoutingTaskConstants.TASK_STEP_FACET_NAME)) {
034            return new TaskStepImpl(doc);
035        }
036        return null;
037    }
038
039}