Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public Response updateCatalog(

@Override
public Response listCatalogs(RealmContext realmContext, SecurityContext securityContext) {
polarisEventListener.onBeforeListCatalog(new CatalogsServiceEvents.BeforeListCatalogEvent());
polarisEventListener.onBeforeListCatalogs(new CatalogsServiceEvents.BeforeListCatalogsEvent());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I added tests for method compliance I noticed that this event was different from other "list" events because the object type being listed wasn't in the plural.

Response resp = delegate.listCatalogs(realmContext, securityContext);
polarisEventListener.onAfterListCatalog(new CatalogsServiceEvents.AfterListCatalogEvent());
polarisEventListener.onAfterListCatalogs(new CatalogsServiceEvents.AfterListCatalogsEvent());
return resp;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,27 @@

public class CatalogGenericTableServiceEvents {
public record BeforeCreateGenericTableEvent(
String catalogName, String namespace, CreateGenericTableRequest request) {}
String catalogName, String namespace, CreateGenericTableRequest request)
implements PolarisEvent {}

public record AfterCreateGenericTableEvent(
String catalogName, String namespace, GenericTable table) {}
String catalogName, String namespace, GenericTable table) implements PolarisEvent {}

public record BeforeDropGenericTableEvent(
String catalogName, String namespace, String tableName) {}
public record BeforeDropGenericTableEvent(String catalogName, String namespace, String tableName)
implements PolarisEvent {}

public record AfterDropGenericTableEvent(
String catalogName, String namespace, String tableName) {}
public record AfterDropGenericTableEvent(String catalogName, String namespace, String tableName)
implements PolarisEvent {}

public record BeforeListGenericTablesEvent(String catalogName, String namespace) {}
public record BeforeListGenericTablesEvent(String catalogName, String namespace)
implements PolarisEvent {}

public record AfterListGenericTablesEvent(String catalogName, String namespace) {}
public record AfterListGenericTablesEvent(String catalogName, String namespace)
implements PolarisEvent {}

public record BeforeLoadGenericTableEvent(
String catalogName, String namespace, String tableName) {}
public record BeforeLoadGenericTableEvent(String catalogName, String namespace, String tableName)
implements PolarisEvent {}

public record AfterLoadGenericTableEvent(
String catalogName, String namespace, GenericTable table) {}
public record AfterLoadGenericTableEvent(String catalogName, String namespace, GenericTable table)
implements PolarisEvent {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,68 +34,84 @@ public class CatalogPolicyServiceEvents {

// Policy CRUD Events
public record BeforeCreatePolicyEvent(
String catalogName, String namespace, CreatePolicyRequest createPolicyRequest) {}
String catalogName, String namespace, CreatePolicyRequest createPolicyRequest)
implements PolarisEvent {}

public record AfterCreatePolicyEvent(
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse) {}
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse)
implements PolarisEvent {}

public record BeforeListPoliciesEvent(String catalogName, String namespace, String policyType) {}
public record BeforeListPoliciesEvent(String catalogName, String namespace, String policyType)
implements PolarisEvent {}

public record AfterListPoliciesEvent(String catalogName, String namespace, String policyType) {}
public record AfterListPoliciesEvent(String catalogName, String namespace, String policyType)
implements PolarisEvent {}

public record BeforeLoadPolicyEvent(String catalogName, String namespace, String policyName) {}
public record BeforeLoadPolicyEvent(String catalogName, String namespace, String policyName)
implements PolarisEvent {}

public record AfterLoadPolicyEvent(
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse) {}
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse)
implements PolarisEvent {}

public record BeforeUpdatePolicyEvent(
String catalogName,
String namespace,
String policyName,
UpdatePolicyRequest updatePolicyRequest) {}
UpdatePolicyRequest updatePolicyRequest)
implements PolarisEvent {}

public record AfterUpdatePolicyEvent(
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse) {}
String catalogName, String namespace, LoadPolicyResponse loadPolicyResponse)
implements PolarisEvent {}

public record BeforeDropPolicyEvent(
String catalogName, String namespace, String policyName, Boolean detachAll) {}
String catalogName, String namespace, String policyName, Boolean detachAll)
implements PolarisEvent {}

public record AfterDropPolicyEvent(
String catalogName, String namespace, String policyName, Boolean detachAll) {}
String catalogName, String namespace, String policyName, Boolean detachAll)
implements PolarisEvent {}

// Policy Attachment Events
public record BeforeAttachPolicyEvent(
String catalogName,
String namespace,
String policyName,
AttachPolicyRequest attachPolicyRequest) {}
AttachPolicyRequest attachPolicyRequest)
implements PolarisEvent {}

public record AfterAttachPolicyEvent(
String catalogName,
String namespace,
String policyName,
AttachPolicyRequest attachPolicyRequest) {}
AttachPolicyRequest attachPolicyRequest)
implements PolarisEvent {}

public record BeforeDetachPolicyEvent(
String catalogName,
String namespace,
String policyName,
DetachPolicyRequest detachPolicyRequest) {}
DetachPolicyRequest detachPolicyRequest)
implements PolarisEvent {}

public record AfterDetachPolicyEvent(
String catalogName,
String namespace,
String policyName,
DetachPolicyRequest detachPolicyRequest) {}
DetachPolicyRequest detachPolicyRequest)
implements PolarisEvent {}

// Policy Query Events
public record BeforeGetApplicablePoliciesEvent(
String catalogName, String namespace, String targetName, String policyType) {}
String catalogName, String namespace, String targetName, String policyType)
implements PolarisEvent {}

public record AfterGetApplicablePoliciesEvent(
String catalogName,
String namespace,
String targetName,
String policyType,
GetApplicablePoliciesResponse getApplicablePoliciesResponse) {}
GetApplicablePoliciesResponse getApplicablePoliciesResponse)
implements PolarisEvent {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public record BeforeUpdateCatalogEvent(String catalogName, UpdateCatalogRequest

public record AfterUpdateCatalogEvent(Catalog catalog) implements PolarisEvent {}

public record BeforeListCatalogEvent() implements PolarisEvent {}
public record BeforeListCatalogsEvent() implements PolarisEvent {}

public record AfterListCatalogEvent() implements PolarisEvent {}
public record AfterListCatalogsEvent() implements PolarisEvent {}

public record BeforeCreateCatalogRoleEvent(String catalogName, String catalogRoleName)
implements PolarisEvent {}
Expand Down
Loading