Skip to content

Commit

Permalink
Merge pull request #29 from yersan/add-defaults
Browse files Browse the repository at this point in the history
Add default methods and fix deprecated annotations
  • Loading branch information
yersan authored Dec 5, 2024
2 parents 696244e + f37173f commit d3cb217
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
@Deprecated
@Deprecated(forRemoval = true)
String generateApplyUpdateCommand(Path scriptHome, Path candidatePath) throws OperationNotAvailableException;

/**
Expand All @@ -149,7 +149,7 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
@Deprecated
@Deprecated(forRemoval = true)
String generateApplyRevertCommand(Path scriptHome, Path candidatePath) throws OperationNotAvailableException;

/**
Expand All @@ -162,7 +162,7 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
@Deprecated
@Deprecated(forRemoval = true)
String generateApplyUpdateCommand(Path scriptHome, Path candidatePath, OsShell shell) throws OperationNotAvailableException;

/**
Expand All @@ -175,7 +175,7 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
@Deprecated
@Deprecated(forRemoval = true)
String generateApplyRevertCommand(Path scriptHome, Path candidatePath, OsShell shell) throws OperationNotAvailableException;

/**
Expand All @@ -189,7 +189,9 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
String generateApplyUpdateCommand(Path scriptHome, Path candidatePath, OsShell shell, boolean noConflictsOnly) throws OperationNotAvailableException;
default String generateApplyUpdateCommand(Path scriptHome, Path candidatePath, OsShell shell, boolean noConflictsOnly) throws OperationNotAvailableException{
throw new UnsupportedOperationException("Method using noConflictsOnly argument is not implemented");
}

/**
* Generate an apply rollback CLI command.
Expand All @@ -202,7 +204,9 @@ public interface InstallationManager {
* @return a CLI command.
* @throws OperationNotAvailableException - if the installation manager CLI support is not installed
*/
String generateApplyRevertCommand(Path scriptHome, Path candidatePath, OsShell shell, boolean noConflictsOnly) throws OperationNotAvailableException;
default String generateApplyRevertCommand(Path scriptHome, Path candidatePath, OsShell shell, boolean noConflictsOnly) throws OperationNotAvailableException {
throw new UnsupportedOperationException("Method using noConflictsOnly argument is not implemented");
}

/**
* Reports latest versions of manifests used in latest update/install operation for each registered channels.
Expand All @@ -219,5 +223,7 @@ public interface InstallationManager {
* @return collection of the {@code FileConflicts} or an empty collection if no conflicts were found.
* @throws Exception - if there was an exception accessing the server information or if the candidate is invalid
*/
Collection<FileConflict> verifyCandidate(Path candidatePath, CandidateType candidateType) throws Exception;
default Collection<FileConflict> verifyCandidate(Path candidatePath, CandidateType candidateType) throws Exception {
throw new UnsupportedOperationException("Method verifyCandidate is not implemented");
}
}

0 comments on commit d3cb217

Please sign in to comment.