Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: first draft of Infrastructure API and related models #407

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
de27e9d
resolved cyclic JPMS issues, compilation works now
deepak-swirlds Oct 12, 2023
1d12ff6
implementing changes suggested by Nathan, saving progress
deepak-swirlds Oct 19, 2023
83550d0
Removing model classes from fullstack-models
deepak-swirlds Oct 19, 2023
054bc1b
added Labeled, added exec() method
deepak-swirlds Oct 20, 2023
778fecd
spotless apply
deepak-swirlds Oct 23, 2023
f8ff9b5
saving progress
deepak-swirlds Nov 2, 2023
0365b0f
spotless apply
deepak-swirlds Nov 2, 2023
e989515
some code cleanup and documentation
deepak-swirlds Nov 2, 2023
f9cb990
merged ! after a frustrating session
deepak-swirlds Nov 3, 2023
c105624
fixed build erorr
deepak-swirlds Nov 3, 2023
554616e
removed fullstack-models, moved the packages into fullstack-configura…
deepak-swirlds Nov 3, 2023
49ab8a0
removed accidentally checked-in files and fixed test configuration
deepak-swirlds Nov 3, 2023
733db73
moving examples inside a named java package
deepak-swirlds Nov 3, 2023
000a32d
address review comments
deepak-swirlds Nov 3, 2023
6d24925
Merge branch 'main' into 301-infra-api-first-draft
deepak-swirlds Nov 6, 2023
81a6f18
Merge branch 'main' into 301-infra-api-first-draft
nathanklick Nov 7, 2023
ec41dd1
moving concrete classes from api -> core
deepak-swirlds Nov 7, 2023
8793437
java docs on exception classes
deepak-swirlds Nov 7, 2023
5c84a7b
minor code changes to address review comments
deepak-swirlds Nov 8, 2023
d90c3bb
Merge remote-tracking branch 'origin/main' into 301-infra-api-first-d…
deepak-swirlds Nov 8, 2023
3c72b56
added javadocs as per review comments
deepak-swirlds Nov 8, 2023
3f5677a
fix compilation errors in examples
deepak-swirlds Nov 9, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ plugins {
javaModuleDependencies {
moduleNameToGA.put("com.hedera.fullstack.junit.support", "com.hedera.fullstack:fullstack-junit-support")
moduleNameToGA.put("com.hedera.fullstack.test.toolkit", "com.hedera.fullstack:fullstack-test-toolkit")
moduleNameToGA.put("com.hedera.fullstack.base.api", "com.hedera.fullstack:fullstack-base-api")
moduleNameToGA.put("com.hedera.fullstack.readiness.api", "com.hedera.fullstack:fullstack-readiness-api")
moduleNameToGA.put("com.hedera.fullstack.monitoring.api", "com.hedera.fullstack:fullstack-monitoring-api")
moduleNameToGA.put("com.hedera.fullstack.validator.api", "com.hedera.fullstack:fullstack-validator-api")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.configuration.infrastructure;

/**
* Defines the type of installation of a node
*/
public enum InstallType {
/**
* The node is installed using Node Management Tool (NMT) and uses a released artifact
*/
NMT,
/**
* The node is installed by directly copying the build artifact to the node without the use of NMT.
* Though the build artifact can be a both a released artifact or a built locally on a development machine,
* this is typically used by developers for adhoc build testing.
*/
DIRECT_INSTALL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.configuration.infrastructure;

import java.util.List;

/**
* A container class to hold all configuration needed to hold the NetworkDeployment
*/
public class NetworkDeploymentConfiguration {

// FUTURE: This class needs to closely reflect what will be passed in values.yaml

InstallType installType;
List<Node> nodes;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.configuration.infrastructure;

/**
* Describes configuration of a Node component inside the NetworkNode Workload
* @param ram - The amount of ram in GB needed for the node
* @param cpu - The amount of cpu in cores needed for the node
* @param nodeID - The nodeID of the node
* @param nodeAccountID - The nodeAccountID of the node
*/
public record Node(int ram, int cpu, int nodeID, int nodeAccountID) {}
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module com.hedera.fullstack.configuration.api {}
module com.hedera.fullstack.configuration.api {
exports com.hedera.fullstack.configuration.infrastructure;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ plugins {

dependencies {
api(platform(project(":fullstack-bom")))
implementation(project(mapOf("path" to ":fullstack-helm-client")))
implementation(project(":fullstack-helm-client"))
implementation(project(":fullstack-configuration-api"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.exceptions;

/**
*
* <p>Thrown when an infrastructure-related exception occurs at the lower level of the implementation.</p>
* <p>A nested exception (cause) should be provided to capture the root cause of the exception.</p>

Check notice on line 22 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/exceptions/InfrastructureException.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/exceptions/InfrastructureException.java#L22

Line is longer than 80 characters (found 99).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 99).

The code provided includes a comment line that exceeds the 80 character limit per line, which is a common code style guideline to ensure readability and maintainability of code. Long lines can be difficult to read, especially on smaller screens or when viewing multiple files side by side.

To fix this issue, you can break the long comment line into two or more shorter lines, ensuring that each line does not exceed 80 characters. Here's how you can modify the comment:

Suggested change
* <p>A nested exception (cause) should be provided to capture the root cause of the exception.</p>
* <p>A nested exception (cause) should be provided to capture the root
* cause of the exception.</p>

By splitting the comment into two lines, each line is now within the 80-character limit, adhering to the Checkstyle rule for line length.


This comment was generated by an experimental AI tool.

* <p>This is not necessarily a fatal exception and the network deployment may be able to recover from it depending on the cause.</p>
*
*/
public class InfrastructureException extends Exception {
InfrastructureException(String message) {
super(message);
}

InfrastructureException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.exceptions;

/**
* <p>Thrown if an exceptions happens during fullstack "cluster setup".
* The "cluster setup" installs prerequisites on a cluster before a {@link com.hedera.fullstack.infrastructure.api.model.NetworkDeployment} can be deployed.
* </p>
*
* <p>A nested exception is provided to give more details about the cause of the exception.</p>
*/
public class InstallationException extends Exception {
public InstallationException(String message) {
super(message);
}

public InstallationException(String message, Throwable cause) {
super(message, cause);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.exceptions;

/**
* Thrown when there are not enough resources on the cluster to deploy a new node.
* This can be remedied by adding more resources to the cluster or deleting existing deployments on the cluster
*/
public class InsufficientClusterResourcesException extends Exception {
public InsufficientClusterResourcesException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.exceptions;

/**
* <p>Thrown when the {@link com.hedera.fullstack.configuration.infrastructure.NetworkDeploymentConfiguration} is invalid.</p>
* <p>This can happen if the network deployment configuration has failed validation even before the deployment has started.</p>

Check notice on line 21 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/exceptions/InvalidConfigurationException.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/exceptions/InvalidConfigurationException.java#L21

Line is longer than 80 characters (found 127).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 127).

The code provided includes a comment line that exceeds the maximum line length of 80 characters as per the coding standards enforced by the Checkstyle linter. Long lines can be harder to read, especially in environments with limited screen space, and can lead to horizontal scrolling, which is generally discouraged in code style guidelines.

To fix this issue, you can break the long comment line into multiple lines, ensuring that each line does not exceed 80 characters. This will improve readability and comply with the Checkstyle rule for maximum line length.

Here's how you can refactor the comment to meet the Checkstyle requirements:

Suggested change
* <p>This can happen if the network deployment configuration has failed validation even before the deployment has started.</p>
/**
* <p>Thrown when the {@link com.hedera.fullstack.configuration.infrastructure.NetworkDeploymentConfiguration} is invalid.</p>
* <p>This can happen if the network deployment configuration has failed
* validation even before the deployment has started.</p>
*/

By splitting the long comment into two lines, each line is now within the 80-character limit, and the issue should be resolved.


This comment was generated by an experimental AI tool.

*/
public class InvalidConfigurationException extends Exception {
public InvalidConfigurationException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.exceptions;

/**
* Thrown if a {@link com.hedera.fullstack.infrastructure.api.model.NetworkDeployment} with cannot be found
*/
public class NetworkDeploymentNotFoundException extends Exception {
NetworkDeploymentNotFoundException(String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.hedera.fullstack.infrastructure.api.manager;

import com.hedera.fullstack.configuration.infrastructure.NetworkDeploymentConfiguration;
import com.hedera.fullstack.infrastructure.api.exceptions.InsufficientClusterResourcesException;
import com.hedera.fullstack.infrastructure.api.exceptions.InfrastructureException;
import com.hedera.fullstack.infrastructure.api.exceptions.InvalidConfigurationException;
import com.hedera.fullstack.infrastructure.api.exceptions.NetworkDeploymentNotFoundException;
import com.hedera.fullstack.infrastructure.api.model.NetworkDeployment;
import java.util.List;
import java.util.concurrent.Future;

/**
* <p>InfrastructureManager is the main entry point into infrastructure management for FST </p>
*
* Responsibilities:
* <ol>
* <li> Manages the lifecycle of a {@link NetworkDeployment}</li>
* <li> Acts as a registry for all {@link NetworkDeployment}s created by it</li></li>
* </ol>
*
* <hr/>
* <strong> About NetworkDeployments </strong>
* <p>
* A {@link NetworkDeployment} represents all the workloads and their components needed for a Hedera ecosystem. <br/>
* Upon instantiation, the {@link NetworkDeployment} object can interact with its workloads and components directly

Check notice on line 41 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L41

Line is longer than 80 characters (found 115).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 115).

The issue identified by Checkstyle is that the line of code exceeds the maximum preferred line length of 80 characters, which is a common code style guideline to improve readability. Long lines of code can be difficult to read, especially in environments with limited screen space or when viewing multiple files side by side.

To fix this issue, you can break the long comment line into two or more lines, ensuring that each line does not exceed 80 characters. Here's how you can modify the comment:

Suggested change
* Upon instantiation, the {@link NetworkDeployment} object can interact with its workloads and components directly
* Upon instantiation, the {@link NetworkDeployment} object can interact with
* its workloads and components directly and does not need {@link InfrastructureManager}.

By splitting the comment into two lines, each line now adheres to the 80-character limit, which should resolve the Checkstyle warning for line length.


This comment was generated by an experimental AI tool.

* and does not need {@link InfrastructureManager}.
* </p>
*/
public interface InfrastructureManager {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to most likely be a singleton and therefore may be better served as a concrete final class which uses a ServiceLocator implementation to load the provider.

Another option would be to use the enum singleton pattern recommended by Joshua Bloch in his book Effective Java.


/**
* This is a synchronous version of {@link #createNetworkDeploymentAsync(NetworkDeploymentConfiguration)}
* @throws InvalidConfigurationException if the {@link NetworkDeploymentConfiguration} is invalid

Check notice on line 49 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L49

Line is longer than 80 characters (found 101).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 101).

The code provided includes a comment line that exceeds the 80-character limit preferred by the Checkstyle linter for Java code. This is a common code style guideline to ensure readability and maintainability. Lines that are too long can be hard to read, especially in environments with limited screen space or when viewing diffs in version control systems.

To fix this issue, you can break the comment line into two or more lines, ensuring that each line does not exceed the 80-character limit. Here's how you could reformat the problematic comment line:

Suggested change
* @throws InvalidConfigurationException if the {@link NetworkDeploymentConfiguration} is invalid
* @throws InvalidConfigurationException if the
* {@link NetworkDeploymentConfiguration} is invalid

This comment was generated by an experimental AI tool.

* @throws InsufficientClusterResourcesException if there are not enough resources in the cluster to create the {@link NetworkDeployment}
* @throws InfrastructureException if there is an infrastructure related exception during creation of the {@link NetworkDeployment}.
* The underlying cause will be captured in the nested exception.
* If a deployment has already started, it may leave behind partially created resources.
* These partial resources can be cleaned by {@link NetworkDeployment#delete()

Check notice on line 54 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L54

Line is longer than 80 characters (found 82).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 82).

The code provided includes a comment line that exceeds the maximum line length of 80 characters as per the code style enforced by Checkstyle. To adhere to this rule, the comment should be wrapped to ensure that no line goes beyond 80 characters.

To fix this, you can break the long comment line into two lines. Here's how you can modify the comment:

Suggested change
* These partial resources can be cleaned by {@link NetworkDeployment#delete()
* These partial resources can be cleaned by {@link NetworkDeployment#delete()}

The fixed comment block would look like this:

/**
 * This is a synchronous version of {@link #createNetworkDeploymentAsync(NetworkDeploymentConfiguration)}
 * @throws InvalidConfigurationException if the {@link NetworkDeploymentConfiguration} is invalid
 * @throws InsufficientClusterResourcesException if there are not enough resources in the cluster to create the {@link NetworkDeployment}
 * @throws InfrastructureException if there is an infrastructure related exception during creation of the {@link NetworkDeployment}.
 * The underlying cause will be captured in the nested exception.
 * If a deployment has already started, it may leave behind partially created resources.
 * These partial resources can be cleaned by {@link NetworkDeployment#delete()}
 */

By breaking the comment into two lines, each line stays within the 80-character limit, which complies with the Checkstyle code style rules.


This comment was generated by an experimental AI tool.

*/
default NetworkDeployment createNetworkDeployment(NetworkDeploymentConfiguration hederaNetwork)
deepak-swirlds marked this conversation as resolved.
Show resolved Hide resolved
throws InvalidConfigurationException, InsufficientClusterResourcesException, InfrastructureException {
return null;
}

/**
* <p>Creates the {@link NetworkDeployment} based on the {@link NetworkDeploymentConfiguration} provided.
* This is a long-running process.</p>
* <p>Note: the {@link NetworkDeployment} can be spread across multiple clusters and cloud providers.</p>
* <p>Since this method returns a {@code Future} any exceptions thrown during the asynchronous execution
* will be wrapped in a {@link java.util.concurrent.ExecutionException}
* </p>
* @param hederaNetwork {@link NetworkDeploymentConfiguration} object containing all the configuration needed

Check notice on line 68 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L68

Line is longer than 80 characters (found 113).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 113).

The code provided contains a Javadoc comment with a line exceeding the 80-character limit, which is a common code style guideline to ensure readability and maintainability of the code. Long lines can be difficult to read, especially in environments with limited screen space or when viewing diffs in version control systems.

To fix the issue, you can break the long line into multiple lines, ensuring that each line does not exceed the 80-character limit. Here's an updated version of the Javadoc comment with the line in question wrapped to meet the 80-character limit:

Suggested change
* @param hederaNetwork {@link NetworkDeploymentConfiguration} object containing all the configuration needed
/**
* <p>Creates the {@link NetworkDeployment} based on the
* {@link NetworkDeploymentConfiguration} provided. This is a long-running
* process.</p>
* <p>Note: the {@link NetworkDeployment} can be spread across multiple
* clusters and cloud providers.</p>
* <p>Since this method returns a {@code Future} any exceptions thrown
* during the asynchronous execution will be wrapped in a
* {@link java.util.concurrent.ExecutionException}</p>
* @param hederaNetwork {@link NetworkDeploymentConfiguration} object
* containing all the configuration needed to create
* the {@link NetworkDeployment}
* @return a {@link NetworkDeployment} object representing the
* {@link NetworkDeployment} created
* @throws InvalidConfigurationException if the
* {@link NetworkDeploymentConfiguration} is invalid
* @throws InsufficientClusterResourcesException if there are not enough
* resources in the cluster to create the {@link NetworkDeployment}
* @throws InfrastructureException if there is an infrastructure related
* exception, the underlying cause will be captured in the nested
* exception.
* @throws NullPointerException if the {@code hederaNetwork} configuration
* is {@code null}.
*/
Future<NetworkDeployment> createNetworkDeploymentAsync(
NetworkDeploymentConfiguration hederaNetwork)
throws InvalidConfigurationException, InsufficientClusterResourcesException,
InfrastructureException;

This suggestion wraps the long lines and aligns the wrapped lines appropriately, making the comment more readable while adhering to the 80-character limit.


This comment was generated by an experimental AI tool.

* to create the {@link NetworkDeployment}
* @return a {@link NetworkDeployment} object representing the {@link NetworkDeployment} created
* @throws InvalidConfigurationException if the {@link NetworkDeploymentConfiguration} is invalid
* @throws InsufficientClusterResourcesException if there are not enough resources in the cluster to create the {@link NetworkDeployment}
* @throws InfrastructureException if there is an infrastructure related exception, the underlying cause
* will be captured in the nested exception.
* @throws NullPointerException if the {@code hederaNetwork} configuration is {@code null}.
*/
Future<NetworkDeployment> createNetworkDeploymentAsync(NetworkDeploymentConfiguration hederaNetwork)
throws InvalidConfigurationException, InsufficientClusterResourcesException, InfrastructureException;

/**
* List all the {@link NetworkDeployment} instances created by this JVM process.

Check notice on line 81 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L81

Line is longer than 80 characters (found 84).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Codacy found a minor Code Style issue: Line is longer than 80 characters (found 84).

The code provided contains JavaDoc comments that are not adhering to the line length limit enforced by Checkstyle. The line length limit is often set to improve readability and maintainability of the code. In this case, the line exceeds the 80 characters limit by 4 characters.

To fix this issue, you can reformat the JavaDoc comment to ensure that no line exceeds 80 characters. You can do this by breaking the sentence into multiple lines. Below is the problematic line reformatted to comply with the 80-character limit:

Suggested change
* List all the {@link NetworkDeployment} instances created by this JVM process.
* List all the {@link NetworkDeployment} instances created by this JVM
* process.

By breaking the sentence into two lines, each line now adheres to the 80-character limit, and the JavaDoc comment remains clear and understandable.


This comment was generated by an experimental AI tool.

* @return a list of all {@link NetworkDeployment}s instances provisioned by this JVM process.
*/
List<NetworkDeployment> listNetworkDeployments();

/**
* Locates an existing {@link NetworkDeployment} using the provided identifier.
* The identifier must be from a {@link NetworkDeployment} created by this Java process.
* @param id Unique identifier of the {@link NetworkDeployment}, the implementation
* will usually be a combination of namespace, job name and job id etc.

Check notice on line 90 in fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

fullstack-core/fullstack-infrastructure-api/src/main/java/com/hedera/fullstack/infrastructure/api/manager/InfrastructureManager.java#L90

Line is longer than 80 characters (found 85).
* @return the {@link NetworkDeployment} associated with the provided identifier.
* @throws NetworkDeploymentNotFoundException if the {@link NetworkDeployment} with the given identifier is not found
* @throws IllegalArgumentException if the provided id is null or empty.
*/
NetworkDeployment networkDeploymentById(String id) throws NetworkDeploymentNotFoundException, IllegalArgumentException;

}
Loading
Loading