Class AdminClient
java.lang.Object
org.apache.kerby.kerberos.kerb.admin.kadmin.remote.AdminClient
A Admin client API for applications to interact with Admin Server
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AdminClient(File confDir) Constructor with conf dirAdminClient(AdminClient krbClient) Constructor with prepared AdminClient.AdminClient(AdminConfig adminConfig) Construct with prepared AdminConfig. -
Method Summary
Modifier and TypeMethodDescriptionGet krb client settings from options and configs.voidinit()Init the client.voidrequestAddPrincipal(String principal) voidrequestAddPrincipal(String principal, String password) voidrequestChangePassword(String principal, String newPassword) voidrequestDeletePrincipal(String principal) voidrequestExportKeytab(File keytabFile, String principal) voidrequestExportKeytab(File keytabFile, List<String> principals) org.apache.kerby.kerberos.kerb.request.KrbIdentityrequestGetPrincipal(String principal) voidrequestRenamePrincipal(String oldPrincipal, String newPrincipal) voidsetAdminRealm(String realm) Set KDC realm for ticket requestvoidsetAdminTcpPort(int kdcTcpPort) Set Admin Server tcp port.voidsetAdminUdpPort(int adminUdpPort) Set Admin Server udp port.voidsetAllowTcp(boolean allowTcp) Set to allow TCP or not.voidsetAllowUdp(boolean allowUdp) Set to allow UDP or not.voidsetKdcHost(String kdcHost) Set Admin Server host.voidsetKeyTabFile(File file) voidsetSubject(Subject subject) voidsetTimeout(int timeout) Set time out for connection
-
Constructor Details
-
AdminClient
public AdminClient() throws org.apache.kerby.kerberos.kerb.KrbExceptionDefault constructor.- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
AdminClient
Construct with prepared AdminConfig.- Parameters:
adminConfig- The krb config
-
AdminClient
Constructor with conf dir- Parameters:
confDir- The conf dir- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
AdminClient
Constructor with prepared AdminClient.- Parameters:
krbClient- The krb client
-
-
Method Details
-
setAdminRealm
Set KDC realm for ticket request- Parameters:
realm- The realm
-
setKeyTabFile
-
setKdcHost
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.KrbExceptionInit the client.- Throws:
org.apache.kerby.kerberos.kerb.KrbException- e
-
getSetting
Get krb client settings from options and configs.- Returns:
- setting
-
getAdminConfig
-
setSubject
-
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
- 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
-