¶Ô±ÈÐÂÎļþ |
| | |
| | | /* |
| | | * 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 |
| | | } |
| | | } |