Skip to content

Commit

Permalink
Merge pull request #176 from catenax-ng/feature/cmp-808/comment-backe…
Browse files Browse the repository at this point in the history
…nd-code

Feature/cmp 808/comment backend code
  • Loading branch information
matbmoser authored Oct 10, 2023
2 parents fcaead7 + 6e41d9a commit 50e043b
Show file tree
Hide file tree
Showing 98 changed files with 5,962 additions and 1,771 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,26 @@

package org.eclipse.tractusx.productpass;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.media.Schema;
import io.swagger.v3.oas.models.media.StringSchema;
import jakarta.servlet.http.HttpServletRequest;
import org.eclipse.tractusx.productpass.models.http.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.info.BuildProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import utils.LogUtil;

import java.util.Map;


/**
* This class is the main class of the Application, where the main method is to start it with Spring boot.
**/
@SpringBootApplication(scanBasePackages={
"utils", "org.eclipse.tractusx.productpass"})
@EnableAsync
Expand All @@ -74,6 +67,7 @@ public static void main(String[] args) {
application.run(args);

}

@Bean
public OpenAPI openApiConfig(){
return new OpenAPI().info(getApiInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
* This class consists exclusively to define the attributes and methods needed for the Application configuration.
**/

@SuppressWarnings("Unused")
@Configuration
public class AppConfig {
@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,69 +28,81 @@
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
* This class consists exclusively to define the attributes and methods needed for the Discovery configuration.
**/
@Configuration
@ConfigurationProperties(prefix="configuration.discovery")
public class DiscoveryConfig {

/** ATTRIBUTES **/
String endpoint;
BPNConfig bpn;
EDCConfig edc;

/** GETTERS AND SETTERS **/
public BPNConfig getBpn() {
return bpn;
}

public void setBpn(BPNConfig bpn) {
this.bpn = bpn;
}

public EDCConfig getEdc() {
return edc;
}

public void setEdc(EDCConfig edc) {
this.edc = edc;
}
public String getEndpoint() {
return endpoint;
}
public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}


public static class BPNConfig{
/** INNER CLASSES **/

/**
* This class consists exclusively to define the attributes and methods needed for the BPN configuration.
**/
public static class BPNConfig {

/** ATTRIBUTES **/
String key;
String searchPath;

/** GETTERS AND SETTERS **/
public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}

public String getSearchPath() {
return searchPath;
}

@SuppressWarnings("Unused")
public void setSearchPath(String searchPath) {
this.searchPath = searchPath;
}
}

public static class EDCConfig{
/**
* This class consists exclusively to define the attributes and methods needed for the EDC configuration.
**/
public static class EDCConfig {

/** ATTRIBUTES **/
String key;

/** GETTERS AND SETTERS **/
public String getKey() {
return key;
}

public void setKey(String key) {
this.key = key;
}
}

public String getEndpoint() {
return endpoint;
}

public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,29 @@
import java.sql.Time;
import java.util.Map;

/**
* This class consists exclusively to define the attributes and methods needed for the Digital Twin Registry (DTR) configuration.
**/
@Configuration
@ConfigurationProperties(prefix="configuration.dtr")
public class DtrConfig {

/** ATTRIBUTES **/
Boolean central;
String centralUrl;
String internalDtr;

Timeouts timeouts;

Boolean temporaryStorage;
DecentralApis decentralApis;
String assetId;

String endpointInterface;
String dspEndpointKey;

/** CONSTRUCTOR(S) **/
public DtrConfig() {
}

/** GETTERS AND SETTERS **/
public DecentralApis getDecentralApis() {
return decentralApis;
}
Expand All @@ -55,160 +63,150 @@ public void setDecentralApis(DecentralApis decentralApis) {
public DtrConfig(Boolean central) {
this.central = central;
}

public String getInternalDtr() {
return internalDtr;
}

public void setInternalDtr(String internalDtr) {
this.internalDtr = internalDtr;
}


public Boolean getTemporaryStorage() {
return temporaryStorage;
}

public void setTemporaryStorage(Boolean temporaryStorage) {
this.temporaryStorage = temporaryStorage;
}

public Timeouts getTimeouts() {
return timeouts;
}

public void setTimeouts(Timeouts timeouts) {
this.timeouts = timeouts;
}

public String getEndpointInterface() {
return endpointInterface;
}

public void setEndpointInterface(String endpointInterface) {
this.endpointInterface = endpointInterface;
}

public String getDspEndpointKey() {
return dspEndpointKey;
}

public void setDspEndpointKey(String dspEndpointKey) {
this.dspEndpointKey = dspEndpointKey;
}
public Boolean getCentral() {
return central;
}
public void setCentral(Boolean central) {
this.central = central;
}
public String getCentralUrl() {
return centralUrl;
}
@SuppressWarnings("Unused")
public void setCentralUrl(String centralUrl) {
this.centralUrl = centralUrl;
}
public String getAssetId() {
return assetId;
}
public void setAssetId(String assetId) {
this.assetId = assetId;
}

/** INNER CLASSES **/

/**
* This class consists exclusively to define the attributes and methods needed for the DTR's timeouts configuration.
**/
public static class Timeouts{

/** ATTRIBUTES **/
Integer search;
Integer negotiation;
Integer transfer;
Integer digitalTwin;

/** GETTERS AND SETTERS **/
public Integer getSearch() {
return search;
}

public void setSearch(Integer search) {
this.search = search;
}

public Integer getNegotiation() {
return negotiation;
}

public void setNegotiation(Integer negotiation) {
this.negotiation = negotiation;
}

public Integer getTransfer() {
return transfer;
}

public void setTransfer(Integer transfer) {
this.transfer = transfer;
}

public Integer getDigitalTwin() {
return digitalTwin;
}

@SuppressWarnings("Unused")
public void setDigitalTwin(Integer digitalTwin) {
this.digitalTwin = digitalTwin;
}
}

/**
* This class consists exclusively to define the attributes and methods needed for the decentralize APIs configuration.
**/
public static class DecentralApis{

/** ATTRIBUTES **/
String prefix;
String search;
String digitalTwin;
String subModel;

/** CONSTRUCTOR(S) **/
@SuppressWarnings("Unused")
public DecentralApis(String prefix, String search, String digitalTwin, String subModel) {
this.prefix = prefix;
this.search = search;
this.digitalTwin = digitalTwin;
this.subModel = subModel;
}

@SuppressWarnings("Unused")
public DecentralApis() {
}

/** GETTERS AND SETTERS **/
public String getPrefix() {
return prefix;
}

@SuppressWarnings("Unused")
public void setPrefix(String prefix) {
this.prefix = prefix;
}

public String getSearch() {
return search;
}

public void setSearch(String search) {
this.search = search;
}

@SuppressWarnings("Unused")
public String getDigitalTwin() {
return digitalTwin;
}

@SuppressWarnings("Unused")
public void setDigitalTwin(String digitalTwin) {
this.digitalTwin = digitalTwin;
}

@SuppressWarnings("Unused")
public String getSubModel() {
return subModel;
}

@SuppressWarnings("Unused")
public void setSubModel(String subModel) {
this.subModel = subModel;
}
}
public DtrConfig() {
}


public Boolean getCentral() {
return central;
}

public void setCentral(Boolean central) {
this.central = central;
}

public String getCentralUrl() {
return centralUrl;
}

public void setCentralUrl(String centralUrl) {
this.centralUrl = centralUrl;
}

public String getAssetId() {
return assetId;
}

public void setAssetId(String assetId) {
this.assetId = assetId;
}
}
Loading

0 comments on commit 50e043b

Please sign in to comment.