|
| 1 | +package com.erdaoya.springcloud.boot.starter.redisson.config; |
| 2 | + |
| 3 | +import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
| 4 | +import org.springframework.boot.context.properties.ConfigurationProperties; |
| 5 | + |
| 6 | +import java.util.List; |
| 7 | + |
| 8 | + |
| 9 | +@ConfigurationProperties( |
| 10 | + prefix = "spring.redisson" |
| 11 | +) |
| 12 | +public class RedissonProperties { |
| 13 | + private int database = 0; |
| 14 | + private String url; |
| 15 | + private String host = "localhost"; |
| 16 | + private String password; |
| 17 | + private int port = 6379; |
| 18 | + private boolean ssl; |
| 19 | + private int timeout; |
| 20 | + private RedisProperties.Pool pool; |
| 21 | + private RedisProperties.Sentinel sentinel; |
| 22 | + private RedisProperties.Cluster cluster; |
| 23 | + public RedissonProperties() { |
| 24 | + } |
| 25 | + |
| 26 | + public int getDatabase() { |
| 27 | + return this.database; |
| 28 | + } |
| 29 | + |
| 30 | + public void setDatabase(int database) { |
| 31 | + this.database = database; |
| 32 | + } |
| 33 | + |
| 34 | + public String getUrl() { |
| 35 | + return this.url; |
| 36 | + } |
| 37 | + |
| 38 | + public void setUrl(String url) { |
| 39 | + this.url = url; |
| 40 | + } |
| 41 | + |
| 42 | + public String getHost() { |
| 43 | + return this.host; |
| 44 | + } |
| 45 | + |
| 46 | + public void setHost(String host) { |
| 47 | + this.host = host; |
| 48 | + } |
| 49 | + |
| 50 | + public String getPassword() { |
| 51 | + return this.password; |
| 52 | + } |
| 53 | + |
| 54 | + public void setPassword(String password) { |
| 55 | + this.password = password; |
| 56 | + } |
| 57 | + |
| 58 | + public int getPort() { |
| 59 | + return this.port; |
| 60 | + } |
| 61 | + |
| 62 | + public void setPort(int port) { |
| 63 | + this.port = port; |
| 64 | + } |
| 65 | + |
| 66 | + public boolean isSsl() { |
| 67 | + return this.ssl; |
| 68 | + } |
| 69 | + |
| 70 | + public void setSsl(boolean ssl) { |
| 71 | + this.ssl = ssl; |
| 72 | + } |
| 73 | + |
| 74 | + public void setTimeout(int timeout) { |
| 75 | + this.timeout = timeout; |
| 76 | + } |
| 77 | + |
| 78 | + public int getTimeout() { |
| 79 | + return this.timeout; |
| 80 | + } |
| 81 | + |
| 82 | + public RedisProperties.Sentinel getSentinel() { |
| 83 | + return this.sentinel; |
| 84 | + } |
| 85 | + |
| 86 | + public void setSentinel(RedisProperties.Sentinel sentinel) { |
| 87 | + this.sentinel = sentinel; |
| 88 | + } |
| 89 | + |
| 90 | + public RedisProperties.Pool getPool() { |
| 91 | + return this.pool; |
| 92 | + } |
| 93 | + |
| 94 | + public void setPool(RedisProperties.Pool pool) { |
| 95 | + this.pool = pool; |
| 96 | + } |
| 97 | + |
| 98 | + public RedisProperties.Cluster getCluster() { |
| 99 | + return this.cluster; |
| 100 | + } |
| 101 | + |
| 102 | + public void setCluster(RedisProperties.Cluster cluster) { |
| 103 | + this.cluster = cluster; |
| 104 | + } |
| 105 | + |
| 106 | + public static class Sentinel { |
| 107 | + private String master; |
| 108 | + private String nodes; |
| 109 | + |
| 110 | + public Sentinel() { |
| 111 | + } |
| 112 | + |
| 113 | + public String getMaster() { |
| 114 | + return this.master; |
| 115 | + } |
| 116 | + |
| 117 | + public void setMaster(String master) { |
| 118 | + this.master = master; |
| 119 | + } |
| 120 | + |
| 121 | + public String getNodes() { |
| 122 | + return this.nodes; |
| 123 | + } |
| 124 | + |
| 125 | + public void setNodes(String nodes) { |
| 126 | + this.nodes = nodes; |
| 127 | + } |
| 128 | + } |
| 129 | + |
| 130 | + public static class Cluster { |
| 131 | + private List<String> nodes; |
| 132 | + private Integer maxRedirects; |
| 133 | + |
| 134 | + public Cluster() { |
| 135 | + } |
| 136 | + |
| 137 | + public List<String> getNodes() { |
| 138 | + return this.nodes; |
| 139 | + } |
| 140 | + |
| 141 | + public void setNodes(List<String> nodes) { |
| 142 | + this.nodes = nodes; |
| 143 | + } |
| 144 | + |
| 145 | + public Integer getMaxRedirects() { |
| 146 | + return this.maxRedirects; |
| 147 | + } |
| 148 | + |
| 149 | + public void setMaxRedirects(Integer maxRedirects) { |
| 150 | + this.maxRedirects = maxRedirects; |
| 151 | + } |
| 152 | + } |
| 153 | + |
| 154 | + public static class Pool { |
| 155 | + private int maxIdle = 8; |
| 156 | + private int minIdle = 0; |
| 157 | + private int maxActive = 8; |
| 158 | + private int maxWait = -1; |
| 159 | + |
| 160 | + public Pool() { |
| 161 | + } |
| 162 | + |
| 163 | + public int getMaxIdle() { |
| 164 | + return this.maxIdle; |
| 165 | + } |
| 166 | + |
| 167 | + public void setMaxIdle(int maxIdle) { |
| 168 | + this.maxIdle = maxIdle; |
| 169 | + } |
| 170 | + |
| 171 | + public int getMinIdle() { |
| 172 | + return this.minIdle; |
| 173 | + } |
| 174 | + |
| 175 | + public void setMinIdle(int minIdle) { |
| 176 | + this.minIdle = minIdle; |
| 177 | + } |
| 178 | + |
| 179 | + public int getMaxActive() { |
| 180 | + return this.maxActive; |
| 181 | + } |
| 182 | + |
| 183 | + public void setMaxActive(int maxActive) { |
| 184 | + this.maxActive = maxActive; |
| 185 | + } |
| 186 | + |
| 187 | + public int getMaxWait() { |
| 188 | + return this.maxWait; |
| 189 | + } |
| 190 | + |
| 191 | + public void setMaxWait(int maxWait) { |
| 192 | + this.maxWait = maxWait; |
| 193 | + } |
| 194 | + } |
| 195 | +} |
0 commit comments