diff --git a/server/src/internalClusterTest/java/org/opensearch/accesscontrol/resources/testplugins/TestResourcePlugin.java b/server/src/internalClusterTest/java/org/opensearch/accesscontrol/resources/testplugins/TestResourcePlugin.java index da790bb4ea4e1..7c0214fbcc000 100644 --- a/server/src/internalClusterTest/java/org/opensearch/accesscontrol/resources/testplugins/TestResourcePlugin.java +++ b/server/src/internalClusterTest/java/org/opensearch/accesscontrol/resources/testplugins/TestResourcePlugin.java @@ -101,13 +101,16 @@ public String getWriteableName() { } @Override - public void writeTo(StreamOutput out) throws IOException { - - } + public void writeTo(StreamOutput out) {} @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { return null; } + + @Override + public String getResourceName() { + return name; + } } } diff --git a/server/src/main/java/org/opensearch/accesscontrol/resources/Resource.java b/server/src/main/java/org/opensearch/accesscontrol/resources/Resource.java index 5cc317988958d..97f031515b526 100644 --- a/server/src/main/java/org/opensearch/accesscontrol/resources/Resource.java +++ b/server/src/main/java/org/opensearch/accesscontrol/resources/Resource.java @@ -14,4 +14,12 @@ /** * Marker interface for all resources */ -public interface Resource extends NamedWriteable, ToXContentFragment {} +public interface Resource extends NamedWriteable, ToXContentFragment { + /** + * Get the resource name + * @return resource name + */ + String getResourceName(); + + // TODO: Next iteration, check if getResourceType() should be implemented +}