KerberosName (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.server.auth

## Class KerberosName

- java.lang.Object
- - org.apache.zookeeper.server.auth.KerberosName

-     public class KerberosName
      extends Object

  This class implements parsing and handling of Kerberos principal names. In particular, it splits them apart and translates them down into local operating system names.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `KerberosName.BadFormatString`
    `static class` | `KerberosName.NoMatchingRule`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `KerberosName(String name)` Create a name from the full Kerberos principal name.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDefaultRealm()` Get the configured default realm.
    `String` | `getHostName()` Get the second component of the name.
    `String` | `getRealm()` Get the realm of the name.
    `String` | `getServiceName()` Get the first component of the name.
    `String` | `getShortName()` Get the translation of the principal name into an operating system user name.
    `static void` | `main(String[] args)`
    `static void` | `setConfiguration()` Set the static configuration to get the rules.
    `String` | `toString()` Put the name back together from the parts.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### KerberosName

          public KerberosName(String name)

      Create a name from the full Kerberos principal name.
      Parameters:
        `name` -

  - ### Method Detail

    - #### getDefaultRealm

          public String getDefaultRealm()

      Get the configured default realm.
      Returns:
        the default realm from the krb5.conf

    - #### toString

          public String toString()

      Put the name back together from the parts.
      Overrides:
        `toString` in class `Object`

    - #### getServiceName

          public String getServiceName()

      Get the first component of the name.
      Returns:
        the first section of the Kerberos principal name

    - #### getHostName

          public String getHostName()

      Get the second component of the name.
      Returns:
        the second section of the Kerberos principal name, and may be null

    - #### getRealm

          public String getRealm()

      Get the realm of the name.
      Returns:
        the realm of the name, may be null

    - #### setConfiguration

          public static void setConfiguration()
                                       throws IOException

      Set the static configuration to get the rules.
      Throws:
        `IOException`

    - #### getShortName

          public String getShortName()
                              throws IOException

      Get the translation of the principal name into an operating system user name.
      Returns:
        the short name
      Throws:
        `IOException`

    - #### main

          public static void main(String[] args)
                           throws Exception

      Throws:
        `Exception`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.