forked from Apicurio/apicurio-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: artifact branches import/export
- Loading branch information
Showing
18 changed files
with
228 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...java/io/apicurio/registry/storage/impl/sql/mappers/ArtifactVersionBranchEntityMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.apicurio.registry.storage.impl.sql.mappers; | ||
|
||
import io.apicurio.registry.storage.impl.sql.SqlUtil; | ||
import io.apicurio.registry.storage.impl.sql.jdb.RowMapper; | ||
import io.apicurio.registry.utils.impexp.ArtifactVersionBranchEntity; | ||
|
||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
|
||
public class ArtifactVersionBranchEntityMapper implements RowMapper<ArtifactVersionBranchEntity> { | ||
|
||
public static final ArtifactVersionBranchEntityMapper instance = new ArtifactVersionBranchEntityMapper(); | ||
|
||
|
||
private ArtifactVersionBranchEntityMapper() { | ||
} | ||
|
||
|
||
@Override | ||
public ArtifactVersionBranchEntity map(ResultSet rs) throws SQLException { | ||
return ArtifactVersionBranchEntity.builder() | ||
.groupId(SqlUtil.denormalizeGroupId(rs.getString("groupId"))) | ||
.artifactId(rs.getString("artifactId")) | ||
.branch(rs.getString("branch")) | ||
.branchOrder(rs.getInt("branchOrder")) | ||
.version(rs.getString("version")) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...rtexport/src/main/java/io/apicurio/registry/utils/impexp/ArtifactVersionBranchEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.apicurio.registry.utils.impexp; | ||
|
||
import io.apicurio.registry.model.BranchId; | ||
import io.apicurio.registry.model.GAV; | ||
import io.quarkus.runtime.annotations.RegisterForReflection; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
import static lombok.AccessLevel.PRIVATE; | ||
|
||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor(access = PRIVATE) | ||
@ToString | ||
@RegisterForReflection | ||
public class ArtifactVersionBranchEntity extends Entity { | ||
|
||
public String groupId; | ||
public String artifactId; | ||
public String version; | ||
public String branch; | ||
public int branchOrder; | ||
|
||
|
||
public GAV toGAV() { | ||
return new GAV(groupId, artifactId, version); | ||
} | ||
|
||
|
||
public BranchId toBranchId() { | ||
return new BranchId(branch); | ||
} | ||
|
||
|
||
@Override | ||
public EntityType getEntityType() { | ||
return EntityType.ArtifactVersionBranch; | ||
} | ||
} |
Oops, something went wrong.