diff --git a/kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Namer.java b/kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Namer.java index 7ba0fc874..8c5afeebf 100644 --- a/kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Namer.java +++ b/kork-moniker/src/main/java/com/netflix/spinnaker/moniker/Namer.java @@ -16,6 +16,8 @@ package com.netflix.spinnaker.moniker; +import com.netflix.spinnaker.orchestration.OperationDescription; + /** * A "Namer" takes some type "T" (e.g. a server group) and allows you to either * @@ -29,5 +31,18 @@ public interface Namer { void applyMoniker(T obj, Moniker moniker); + /** + * Sets a moniker on the given object with additional context provided by the description. This + * default implementation ignores the provided {@code description} and simply delegates to the + * {@link #applyMoniker(Object, Moniker)} method. + * + * @param obj the object to which the moniker will be applied + * @param moniker the moniker to apply + * @param description a description that provides additional context for the operation + */ + default void applyMoniker(T obj, Moniker moniker, OperationDescription description) { + applyMoniker(obj, moniker); + } + Moniker deriveMoniker(T obj); } diff --git a/kork-moniker/src/main/java/com/netflix/spinnaker/orchestration/OperationDescription.java b/kork-moniker/src/main/java/com/netflix/spinnaker/orchestration/OperationDescription.java new file mode 100644 index 000000000..c9cdfcf3d --- /dev/null +++ b/kork-moniker/src/main/java/com/netflix/spinnaker/orchestration/OperationDescription.java @@ -0,0 +1,4 @@ +package com.netflix.spinnaker.orchestration; + +/** Marker interface for inputs to an AtomicOperation. */ +public interface OperationDescription {}