-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #116: Develop OS Command Extension
* Implemented a new class `SudoInformation` to wrap information such as whether to use sudo, the sudo commands that require sudo and the sudo command key. * Prepare OsCommandHelper to be defined in the engine to define a set of utilities that are required in various extensions.
- Loading branch information
Showing
4 changed files
with
113 additions
and
53 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
42 changes: 42 additions & 0 deletions
42
...ne/src/main/java/org/sentrysoftware/metricshub/engine/strategy/utils/SudoInformation.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,42 @@ | ||
package org.sentrysoftware.metricshub.engine.strategy.utils; | ||
|
||
/*- | ||
* ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲ | ||
* MetricsHub Engine | ||
* ჻჻჻჻჻჻ | ||
* Copyright 2023 - 2024 Sentry Software | ||
* ჻჻჻჻჻჻ | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱ | ||
*/ | ||
|
||
import java.util.Set; | ||
import lombok.Builder; | ||
|
||
/** | ||
* Represents the necessary information to manage the sudo commands. | ||
* This record contains settings that determine whether sudo is used, which commands require sudo, | ||
* and the specific sudo command to be used. | ||
* | ||
* @param isUseSudo Indicates if sudo is to be used. | ||
* @param useSudoCommands A set of commands that specifically require sudo. | ||
* @param sudoCommand The actual sudo command string to be used. | ||
*/ | ||
@Builder | ||
public record SudoInformation(boolean isUseSudo, Set<String> useSudoCommands, String sudoCommand) { | ||
/** | ||
* Default SUDO command | ||
*/ | ||
public static final String SUDO = "sudo"; | ||
} |
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