xiejun
2024-11-01 80b6cbfc9c861469146318d0b3dd5f8b8b525b8a
Source/BladeX-Tool/blade-starter-redis/src/main/java/org/springblade/core/redis/lock/BladeLockProperties.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
/*
 *      Copyright (c) 2018-2028, DreamLu All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: DreamLu å¢æ˜¥æ¢¦ (596392912@qq.com)
 */
package org.springblade.core.redis.lock;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
 * åˆ†å¸ƒå¼é”é…ç½®
 *
 * @author L.cm
 */
@Getter
@Setter
@ConfigurationProperties(BladeLockProperties.PREFIX)
public class BladeLockProperties {
   public static final String PREFIX = "blade.lock";
   /**
    * æ˜¯å¦å¼€å¯ï¼šé»˜è®¤ä¸ºï¼šfalse,便于生成配置提示。
    */
   private Boolean enabled = Boolean.FALSE;
   /**
    * å•机配置:redis æœåŠ¡åœ°å€
    */
   private String address = "redis://127.0.0.1:6379";
   /**
    * å¯†ç é…ç½®
    */
   private String password;
   /**
    * db
    */
   private Integer database = 0;
   /**
    * è¿žæŽ¥æ± å¤§å°
    */
   private Integer poolSize = 20;
   /**
    * æœ€å°ç©ºé—²è¿žæŽ¥æ•°
    */
   private Integer idleSize = 5;
   /**
    * è¿žæŽ¥ç©ºé—²è¶…时,单位:毫秒
    */
   private Integer idleTimeout = 60000;
   /**
    * è¿žæŽ¥è¶…时,单位:毫秒
    */
   private Integer connectionTimeout = 3000;
   /**
    * å‘½ä»¤ç­‰å¾…超时,单位:毫秒
    */
   private Integer timeout = 10000;
   /**
    * é›†ç¾¤æ¨¡å¼ï¼Œå•机:single,主从:master,哨兵模式:sentinel,集群模式:cluster
    */
   private Mode mode = Mode.single;
   /**
    * ä¸»ä»Žæ¨¡å¼ï¼Œä¸»åœ°å€
    */
   private String masterAddress;
   /**
    * ä¸»ä»Žæ¨¡å¼ï¼Œä»Žåœ°å€
    */
   private String[] slaveAddress;
   /**
    * å“¨å…µæ¨¡å¼ï¼šä¸»åç§°
    */
   private String masterName;
   /**
    * å“¨å…µæ¨¡å¼åœ°å€
    */
   private String[] sentinelAddress;
   /**
    * é›†ç¾¤æ¨¡å¼èŠ‚ç‚¹åœ°å€
    */
   private String[] nodeAddress;
   public enum Mode {
      /**
       * é›†ç¾¤æ¨¡å¼ï¼Œå•机:single,主从:master,哨兵模式:sentinel,集群模式:cluster
       */
      single,
      master,
      sentinel,
      cluster
   }
}