Class RemoteClusterPermissionGroup

java.lang.Object
org.elasticsearch.xpack.core.security.authz.permission.RemoteClusterPermissionGroup
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class RemoteClusterPermissionGroup extends Object implements NamedWriteable, org.elasticsearch.xcontent.ToXContentObject
Represents a group of permissions for a remote cluster. For example: { "privileges" : ["monitor_enrich"], "clusters" : ["*"] }
  • Field Details

  • Constructor Details

    • RemoteClusterPermissionGroup

      public RemoteClusterPermissionGroup(StreamInput in) throws IOException
      Throws:
      IOException
    • RemoteClusterPermissionGroup

      public RemoteClusterPermissionGroup(Map<String,List<String>> remoteClusterGroup)
    • RemoteClusterPermissionGroup

      public RemoteClusterPermissionGroup(String[] clusterPrivileges, String[] remoteClusterAliases)
      Parameters:
      clusterPrivileges - The list of cluster privileges that are allowed for the remote cluster. must not be null or empty.
      remoteClusterAliases - The list of remote clusters that the privileges apply to. must not be null or empty.
  • Method Details

    • hasPrivileges

      public boolean hasPrivileges(String remoteClusterAlias)
      Parameters:
      remoteClusterAlias - The remote cluster alias to check to see if has privileges defined in this group.
      Returns:
      true if the remote cluster alias has privileges defined in this group, false otherwise.
    • clusterPrivileges

      public String[] clusterPrivileges()
      Returns:
      A copy of the cluster privileges.
    • remoteClusterAliases

      public String[] remoteClusterAliases()
      Returns:
      A copy of the cluster aliases.
    • toMap

      public Map<String,List<String>> toMap()
      Converts the group to a map representation.
      Returns:
      A map representation of the group.
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getWriteableName

      public String getWriteableName()
      Specified by:
      getWriteableName in interface NamedWriteable