java.lang.Object
org.apache.kerby.kerberos.kerb.admin.kadmin.remote.AdminClient

public class AdminClient extends Object
A Admin client API for applications to interact with Admin Server
  • Constructor Details

    • AdminClient

      public AdminClient() throws org.apache.kerby.kerberos.kerb.KrbException
      Default constructor.
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • AdminClient

      public AdminClient(AdminConfig adminConfig)
      Construct with prepared AdminConfig.
      Parameters:
      adminConfig - The krb config
    • AdminClient

      public AdminClient(File confDir) throws org.apache.kerby.kerberos.kerb.KrbException
      Constructor with conf dir
      Parameters:
      confDir - The conf dir
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • AdminClient

      public AdminClient(AdminClient krbClient)
      Constructor with prepared AdminClient.
      Parameters:
      krbClient - The krb client
  • Method Details

    • setAdminRealm

      public void setAdminRealm(String realm)
      Set KDC realm for ticket request
      Parameters:
      realm - The realm
    • setKeyTabFile

      public void setKeyTabFile(File file)
    • setKdcHost

      public void setKdcHost(String kdcHost)
      Set Admin Server host.
      Parameters:
      kdcHost - The kdc host
    • setAdminTcpPort

      public void setAdminTcpPort(int kdcTcpPort)
      Set Admin Server tcp port.
      Parameters:
      kdcTcpPort - The kdc tcp port
    • setAllowUdp

      public void setAllowUdp(boolean allowUdp)
      Set to allow UDP or not.
      Parameters:
      allowUdp - true if allow udp
    • setAllowTcp

      public void setAllowTcp(boolean allowTcp)
      Set to allow TCP or not.
      Parameters:
      allowTcp - true if allow tcp
    • setAdminUdpPort

      public void setAdminUdpPort(int adminUdpPort)
      Set Admin Server udp port. Only makes sense when allowUdp is set.
      Parameters:
      adminUdpPort - The kdc udp port
    • setTimeout

      public void setTimeout(int timeout)
      Set time out for connection
      Parameters:
      timeout - in seconds
    • init

      public void init() throws org.apache.kerby.kerberos.kerb.KrbException
      Init the client.
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException - e
    • getSetting

      public AdminSetting getSetting()
      Get krb client settings from options and configs.
      Returns:
      setting
    • getAdminConfig

      public AdminConfig getAdminConfig()
    • setSubject

      public void setSubject(Subject subject)
    • requestAddPrincipal

      public void requestAddPrincipal(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestAddPrincipal

      public void requestAddPrincipal(String principal, String password) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestDeletePrincipal

      public void requestDeletePrincipal(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestRenamePrincipal

      public void requestRenamePrincipal(String oldPrincipal, String newPrincipal) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestGetprincs

      public List<String> requestGetprincs() throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestGetprincsWithExp

      public List<String> requestGetprincsWithExp(String exp) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestExportKeytab

      public void requestExportKeytab(File keytabFile, String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestExportKeytab

      public void requestExportKeytab(File keytabFile, List<String> principals) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestChangePassword

      public void requestChangePassword(String principal, String newPassword) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException
    • requestGetPrincipal

      public org.apache.kerby.kerberos.kerb.request.KrbIdentity requestGetPrincipal(String principal) throws org.apache.kerby.kerberos.kerb.KrbException
      Throws:
      org.apache.kerby.kerberos.kerb.KrbException