Skip to content

Commit

Permalink
Merge branch 'v1.1.x' into v1.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
davydotcom committed Dec 20, 2024
2 parents ea368b8 + 7b29979 commit 917a22a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.morpheusdata.response.ServiceResponse;
import com.morpheusdata.views.HTMLResponse;

import java.security.Provider;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -126,6 +126,19 @@ public interface EventSubscriberFacet<E extends Event> {
*/
List<EventType> getSupportedEventTypes();


/**
* Gets the list of scopes to limit the events received by the subscriber. This is useful for filtering events based on the associations of the event subject.
* For example, an integration may only want to receive events when the subject has an association to a cloud. When combined with event types, a provider could
* subscribe to only create network on a cloud events.
* @return list of event scopes
*/
default List<EventScope> getEventScopes() {
List<EventScope> scopes = new ArrayList<>();
scopes.add(EventScope.ALL);
return scopes;
};

/**
* Method triggered when an event that was subscribed to is triggered. This is useful for capturing hooks like
* perhaps, an action needs to be performed after a network is created or destroyed.
Expand All @@ -135,5 +148,11 @@ public interface EventSubscriberFacet<E extends Event> {
* @see NetworkEvent
*/
void onEvent(E event, AccountIntegration integration);

enum EventScope {
ALL,
CLOUD,
CLUSTER
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ public void setSource(String source) {
}

public enum Status {
QUEUED,
START_REQUESTED,
INITIALIZING,
IN_PROGRESS,
Expand Down

0 comments on commit 917a22a

Please sign in to comment.