001/**
002 * Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com).
003 * <p>
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 * <p>
008 * http://www.apache.org/licenses/LICENSE-2.0
009 * <p>
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 */
016package io.jboot.support.seata;
017
018import io.jboot.app.config.annotation.ConfigModel;
019import io.jboot.utils.StrUtil;
020
021@ConfigModel(prefix = "jboot.seata")
022public class SeataConfig {
023
024    private boolean enable;
025    private String applicationId;
026    private String txServiceGroup;
027    private String failureHandler;
028    private int mode = 1;
029
030    public boolean isEnable() {
031        return enable;
032    }
033
034    public void setEnable(boolean enable) {
035        this.enable = enable;
036    }
037
038    public String getApplicationId() {
039        return applicationId;
040    }
041
042    public void setApplicationId(String applicationId) {
043        this.applicationId = applicationId;
044    }
045
046    public String getTxServiceGroup() {
047        return txServiceGroup;
048    }
049
050    public void setTxServiceGroup(String txServiceGroup) {
051        this.txServiceGroup = txServiceGroup;
052    }
053
054    public String getFailureHandler() {
055        return failureHandler;
056    }
057
058    public void setFailureHandler(String failureHandler) {
059        this.failureHandler = failureHandler;
060    }
061
062    public int getMode() {
063        return mode;
064    }
065
066    public void setMode(int mode) {
067        this.mode = mode;
068    }
069
070    public boolean isConfigOk() {
071        return StrUtil.isNotBlank(applicationId) && StrUtil.isNotBlank(txServiceGroup);
072    }
073}