Skip to content

Commit 4cccd3f

Browse files
kunalsharma05Kunal Sharma
and
Kunal Sharma
authored
feat(moniker): Move OperationDescription from clouddriver to kork and add an overloaded applyMoniker method with the description parameter (#1199)
Added a new overloaded applyMoniker method to the Namer interface with an OperationDescription parameter. The new method defaults to calling the existing applyMoniker method without the description. Moved the OperationDescription from clouddriver's com.netflix.spinnaker.clouddriver.orchestration to kork-moniker's com.netflix.spinnaker.orchestration. Co-authored-by: Kunal Sharma <kunal.sharma@salesforce.com>
1 parent cade67f commit 4cccd3f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Namer.java

+15
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.netflix.spinnaker.moniker;
1818

19+
import com.netflix.spinnaker.orchestration.OperationDescription;
20+
1921
/**
2022
* A "Namer" takes some type "T" (e.g. a server group) and allows you to either
2123
*
@@ -29,5 +31,18 @@
2931
public interface Namer<T> {
3032
void applyMoniker(T obj, Moniker moniker);
3133

34+
/**
35+
* Sets a moniker on the given object with additional context provided by the description. This
36+
* default implementation ignores the provided {@code description} and simply delegates to the
37+
* {@link #applyMoniker(Object, Moniker)} method.
38+
*
39+
* @param obj the object to which the moniker will be applied
40+
* @param moniker the moniker to apply
41+
* @param description a description that provides additional context for the operation
42+
*/
43+
default void applyMoniker(T obj, Moniker moniker, OperationDescription description) {
44+
applyMoniker(obj, moniker);
45+
}
46+
3247
Moniker deriveMoniker(T obj);
3348
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package com.netflix.spinnaker.orchestration;
2+
3+
/** Marker interface for inputs to an AtomicOperation. */
4+
public interface OperationDescription {}

0 commit comments

Comments
 (0)