Skip to content

Commit dbacd72

Browse files
authored
Merge pull request #23 from AntChainOpenLabs/dev/v0.2.0-SNAPSHOT
Dev/v0.2.0
2 parents 350e4bc + f22d916 commit dbacd72

205 files changed

Lines changed: 10177 additions & 131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

antchain-bridge-bcdns/.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
target/
2+
!.mvn/wrapper/maven-wrapper.jar
3+
!**/src/main/**/target/
4+
!**/src/test/**/target/
5+
6+
### IntelliJ IDEA ###
7+
.idea/modules.xml
8+
.idea/jarRepositories.xml
9+
.idea/compiler.xml
10+
.idea/libraries/
11+
*.iws
12+
*.iml
13+
*.ipr
14+
15+
### Eclipse ###
16+
.apt_generated
17+
.classpath
18+
.factorypath
19+
.project
20+
.settings
21+
.springBeans
22+
.sts4-cache
23+
24+
### NetBeans ###
25+
/nbproject/private/
26+
/nbbuild/
27+
/dist/
28+
/nbdist/
29+
/.nb-gradle/
30+
build/
31+
!**/src/main/**/build/
32+
!**/src/test/**/build/
33+
34+
### VS Code ###
35+
.vscode/
36+
37+
### Mac OS ###
38+
.DS_Store

antchain-bridge-bcdns/pom.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.alipay.antchain.bridge</groupId>
8+
<artifactId>antchain-bridge-bcdns</artifactId>
9+
<version>0.2.0</version>
10+
11+
<properties>
12+
<maven.compiler.source>8</maven.compiler.source>
13+
<maven.compiler.target>8</maven.compiler.target>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
</properties>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>com.alipay.antchain.bridge</groupId>
20+
<artifactId>antchain-bridge-commons</artifactId>
21+
<version>${project.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.squareup.okhttp3</groupId>
25+
<artifactId>okhttp</artifactId>
26+
<version>4.9.0</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>junit</groupId>
30+
<artifactId>junit</artifactId>
31+
<version>4.13.2</version>
32+
<scope>test</scope>
33+
</dependency>
34+
35+
</dependencies>
36+
</project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2023 Ant Group
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.alipay.antchain.bridge.bcdns.impl;
18+
19+
import com.alipay.antchain.bridge.bcdns.impl.bif.BifBCDNSClient;
20+
import com.alipay.antchain.bridge.bcdns.service.BCDNSTypeEnum;
21+
import com.alipay.antchain.bridge.bcdns.service.IBlockChainDomainNameService;
22+
import com.alipay.antchain.bridge.bcdns.types.exception.AntChainBridgeBCDNSException;
23+
import com.alipay.antchain.bridge.bcdns.types.exception.BCDNSErrorCodeEnum;
24+
25+
public class BlockChainDomainNameServiceFactory {
26+
27+
public static IBlockChainDomainNameService create(BCDNSTypeEnum type, byte[] rawConfig) {
28+
switch (type) {
29+
case BIF:
30+
return BifBCDNSClient.generateFrom(rawConfig);
31+
case EMBEDDED:
32+
// TODO implement this
33+
return null;
34+
default:
35+
throw new AntChainBridgeBCDNSException(
36+
BCDNSErrorCodeEnum.BCDNS_TYPE_UNKNOWN,
37+
"unknown bcdns type : " + type.getCode()
38+
);
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)