1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shardingsphere.encrypt.rule.changed;
19
20 import org.apache.shardingsphere.encrypt.config.EncryptRuleConfiguration;
21 import org.apache.shardingsphere.encrypt.rule.EncryptRule;
22 import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
23 import org.apache.shardingsphere.infra.algorithm.core.processor.AlgorithmChangedProcessor;
24 import org.apache.shardingsphere.mode.spi.rule.RuleChangedItemType;
25
26 import java.util.LinkedHashMap;
27 import java.util.LinkedList;
28 import java.util.Map;
29
30
31
32
33 public final class EncryptorChangedProcessor extends AlgorithmChangedProcessor<EncryptRuleConfiguration> {
34
35 public EncryptorChangedProcessor() {
36 super(EncryptRule.class);
37 }
38
39 @Override
40 protected EncryptRuleConfiguration createEmptyRuleConfiguration() {
41 return new EncryptRuleConfiguration(new LinkedList<>(), new LinkedHashMap<>());
42 }
43
44 @Override
45 protected Map<String, AlgorithmConfiguration> getAlgorithmConfigurations(final EncryptRuleConfiguration currentRuleConfig) {
46 return currentRuleConfig.getEncryptors();
47 }
48
49 @Override
50 public RuleChangedItemType getType() {
51 return new RuleChangedItemType("encrypt", "encryptors");
52 }
53 }