Class KerberosName


  • public class KerberosName
    extends java.lang.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.
    • Constructor Summary

      Constructors 
      Constructor Description
      KerberosName​(java.lang.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 Description
      java.lang.String getDefaultRealm()
      Get the configured default realm.
      java.lang.String getHostName()
      Get the second component of the name.
      java.lang.String getRealm()
      Get the realm of the name.
      java.lang.String getServiceName()
      Get the first component of the name.
      java.lang.String getShortName()
      Get the translation of the principal name into an operating system user name.
      static void main​(java.lang.String[] args)  
      static void setConfiguration()
      Set the static configuration to get the rules.
      java.lang.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​(java.lang.String name)
        Create a name from the full Kerberos principal name.
        Parameters:
        name -
    • Method Detail

      • getDefaultRealm

        public java.lang.String getDefaultRealm()
        Get the configured default realm.
        Returns:
        the default realm from the krb5.conf
      • toString

        public java.lang.String toString()
        Put the name back together from the parts.
        Overrides:
        toString in class java.lang.Object
      • getServiceName

        public java.lang.String getServiceName()
        Get the first component of the name.
        Returns:
        the first section of the Kerberos principal name
      • getHostName

        public java.lang.String getHostName()
        Get the second component of the name.
        Returns:
        the second section of the Kerberos principal name, and may be null
      • getRealm

        public java.lang.String getRealm()
        Get the realm of the name.
        Returns:
        the realm of the name, may be null
      • setConfiguration

        public static void setConfiguration()
                                     throws java.io.IOException
        Set the static configuration to get the rules.
        Throws:
        java.io.IOException
      • getShortName

        public java.lang.String getShortName()
                                      throws java.io.IOException
        Get the translation of the principal name into an operating system user name.
        Returns:
        the short name
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception