Skip to content

Commit 97aaef0

Browse files
authored
[CYB-139][CYB-151][CYB-164] Transferring the configuration in a zip archive between clusters. New rest api with UI. (#61)
1 parent a57f6a0 commit 97aaef0

File tree

111 files changed

+11446
-5979
lines changed

Some content is hidden

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

111 files changed

+11446
-5979
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.idea/cybersec.iml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/workspace.xml

Lines changed: 0 additions & 53 deletions
This file was deleted.

flink-cyber/.vscode/settings.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>com.cloudera.cyber</groupId>
6+
<artifactId>cyber-services</artifactId>
7+
<version>2.3.1</version>
8+
</parent>
9+
<artifactId>cyber-service-common</artifactId>
10+
<name>Archetype - cyber-service-common</name>
11+
<url>http://maven.apache.org</url>
12+
<properties>
13+
<commons-compress.version>1.24.0</commons-compress.version>
14+
</properties>
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.projectlombok</groupId>
18+
<artifactId>lombok</artifactId>
19+
<optional>true</optional>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.apache.commons</groupId>
23+
<artifactId>commons-lang3</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.apache.commons</groupId>
27+
<artifactId>commons-compress</artifactId>
28+
<version>${commons-compress.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.assertj</groupId>
32+
<artifactId>assertj-core</artifactId>
33+
<scope>test</scope>
34+
<version>${assertj.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>junit</groupId>
38+
<artifactId>junit</artifactId>
39+
<scope>test</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.springframework.boot</groupId>
43+
<artifactId>spring-boot-autoconfigure</artifactId>
44+
</dependency>
45+
</dependencies>
46+
</project>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.cloudera.service.common;
2+
3+
import lombok.experimental.UtilityClass;
4+
import org.apache.commons.lang3.StringUtils;
5+
6+
import java.util.Arrays;
7+
import java.util.function.Function;
8+
9+
@UtilityClass
10+
public class Utils {
11+
12+
/**
13+
* Retrieves an enum constant of the specified enum type based on a case-insensitive search of a string representation,
14+
* using a custom mapping function to extract the string representation from the enum constant.
15+
*
16+
* @param <T> the enum type
17+
* @param name the string representation to search for
18+
* @param enumClass the Class object representing the enum type
19+
* @param nameFunction a function that extracts the string representation from an enum constant
20+
* @return the enum constant matching the provided string representation, or null if not found
21+
* @throws NullPointerException if {@code name}, {@code enumClass}, or {@code nameFunction} is null
22+
*/
23+
public static <T extends Enum<T>> T getEnumFromString(String name, Class<T> enumClass, Function<T, String> nameFunction) {
24+
return Arrays.stream(enumClass.getEnumConstants())
25+
.filter(type -> StringUtils.equalsIgnoreCase(name, nameFunction.apply(type)))
26+
.findFirst()
27+
.orElse(null);
28+
}
29+
30+
public static <T extends Enum<T>> T getEnumFromStringContains(String name, Class<T> enumClass, Function<T, String> nameFunction) {
31+
return Arrays.stream(enumClass.getEnumConstants())
32+
.filter(type -> StringUtils.containsIgnoreCase(name, nameFunction.apply(type)))
33+
.findFirst()
34+
.orElse(null);
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.cloudera.service.common.config.kafka;
2+
3+
import lombok.Getter;
4+
import lombok.Setter;
5+
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
6+
import org.springframework.boot.context.properties.ConfigurationProperties;
7+
import org.springframework.stereotype.Component;
8+
9+
@Getter
10+
@Setter
11+
public class ClouderaKafkaProperties extends KafkaProperties {
12+
private String replyTopic;
13+
private String requestTopic;
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.cloudera.service.common.config.kafka;
2+
3+
public class ClouderaManagementKafkaProperties extends ClouderaKafkaProperties{
4+
}

0 commit comments

Comments
 (0)