Class ApplicationPrivilegeDescriptor

java.lang.Object
org.elasticsearch.xpack.core.security.authz.privilege.ApplicationPrivilegeDescriptor
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentObject

public class ApplicationPrivilegeDescriptor extends Object implements org.elasticsearch.xcontent.ToXContentObject, Writeable
An ApplicationPrivilegeDescriptor is a representation of a stored ApplicationPrivilege. A user (via a role) can be granted an application privilege by name (e.g. ("myapp", "read"). In general, this privilege name will correspond to a pre-defined ApplicationPrivilegeDescriptor, which then is used to determine the set of actions granted by the privilege.
  • Field Details

  • Constructor Details

  • Method Details

    • writeTo

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

      public String getApplication()
    • getName

      public String getName()
    • getActions

      public Set<String> getActions()
    • getMetadata

      public Map<String,Object> getMetadata()
    • 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
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, boolean includeTypeField) throws IOException
      Throws:
      IOException
    • toString

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

      public static ApplicationPrivilegeDescriptor parse(org.elasticsearch.xcontent.XContentParser parser, String defaultApplication, String defaultName, boolean allowType) throws IOException
      Construct a new ApplicationPrivilegeDescriptor from XContent.
      Parameters:
      defaultApplication - The application name to use if none is specified in the XContent body
      defaultName - The privilege name to use if none is specified in the XContent body
      allowType - If true, accept a "type" field (for which the value must match DOC_TYPE_VALUE);
      Throws:
      IOException
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object