001/*
002 * (C) Copyright 2013 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     vpasquier <vpasquier@nuxeo.com>
016 */
017package org.nuxeo.ecm.automation.core;
018
019import java.util.ArrayList;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XNodeList;
023import org.nuxeo.common.xmap.annotation.XObject;
024
025/**
026 * @since 5.7.3 The exception chain declaration for Automation exceptions.
027 */
028@XObject("catchChain")
029public class ChainExceptionDescriptor {
030
031    @XNode("@id")
032    protected String id;
033
034    @XNode("@onChainId")
035    protected String onChainId;
036
037    @XNodeList(value = "run", type = ArrayList.class, componentType = ChainExceptionRun.class)
038    protected ArrayList<ChainExceptionRun> chainExceptionRuns;
039
040    public String getOnChainId() {
041        return onChainId;
042    }
043
044    public ArrayList<ChainExceptionRun> getChainExceptionsRun() {
045        return chainExceptionRuns;
046    }
047
048    public String getId() {
049        return id;
050    }
051
052    @XObject("run")
053    public static class ChainExceptionRun {
054
055        @XNode("@chainId")
056        protected String chainId;
057
058        @XNode("@priority")
059        protected Integer priority = 0;
060
061        @XNode("@rollBack")
062        protected Boolean rollBack = true;
063
064        @XNode("@filterId")
065        protected String filterId = "";
066
067        public String getChainId() {
068            return chainId;
069        }
070
071        public Integer getPriority() {
072            return priority;
073        }
074
075        public Boolean getRollBack() {
076            return rollBack;
077        }
078
079        public String getFilterId() {
080            return filterId;
081        }
082    }
083}