/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.elasticmapreduce.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Attributes for Kerberos configuration when Kerberos authentication is enabled using a security configuration. For * more information see Use Kerberos * Authentication in the Amazon EMR Management Guide. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class KerberosAttributes implements Serializable, Cloneable, StructuredPojo { /** *
* The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL
.
*
* The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. *
*/ private String kdcAdminPassword; /** ** Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal * password, which must be identical across realms. *
*/ private String crossRealmTrustPrincipalPassword; /** ** Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient * privileges to join resources to the domain. *
*/ private String aDDomainJoinUser; /** *
* The Active Directory password for ADDomainJoinUser
.
*
* The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL
.
*
EC2.INTERNAL
.
*/
public void setRealm(String realm) {
this.realm = realm;
}
/**
*
* The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL
.
*
EC2.INTERNAL
.
*/
public String getRealm() {
return this.realm;
}
/**
*
* The name of the Kerberos realm to which all nodes in a cluster belong. For example, EC2.INTERNAL
.
*
EC2.INTERNAL
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public KerberosAttributes withRealm(String realm) {
setRealm(realm);
return this;
}
/**
* * The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. *
* * @param kdcAdminPassword * The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. */ public void setKdcAdminPassword(String kdcAdminPassword) { this.kdcAdminPassword = kdcAdminPassword; } /** ** The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. *
* * @return The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. */ public String getKdcAdminPassword() { return this.kdcAdminPassword; } /** ** The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. *
* * @param kdcAdminPassword * The password used within the cluster for the kadmin service on the cluster-dedicated KDC, which maintains * Kerberos principals, password policies, and keytabs for the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ public KerberosAttributes withKdcAdminPassword(String kdcAdminPassword) { setKdcAdminPassword(kdcAdminPassword); return this; } /** ** Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal * password, which must be identical across realms. *
* * @param crossRealmTrustPrincipalPassword * Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm * principal password, which must be identical across realms. */ public void setCrossRealmTrustPrincipalPassword(String crossRealmTrustPrincipalPassword) { this.crossRealmTrustPrincipalPassword = crossRealmTrustPrincipalPassword; } /** ** Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal * password, which must be identical across realms. *
* * @return Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm * principal password, which must be identical across realms. */ public String getCrossRealmTrustPrincipalPassword() { return this.crossRealmTrustPrincipalPassword; } /** ** Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm principal * password, which must be identical across realms. *
* * @param crossRealmTrustPrincipalPassword * Required only when establishing a cross-realm trust with a KDC in a different realm. The cross-realm * principal password, which must be identical across realms. * @return Returns a reference to this object so that method calls can be chained together. */ public KerberosAttributes withCrossRealmTrustPrincipalPassword(String crossRealmTrustPrincipalPassword) { setCrossRealmTrustPrincipalPassword(crossRealmTrustPrincipalPassword); return this; } /** ** Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient * privileges to join resources to the domain. *
* * @param aDDomainJoinUser * Required only when establishing a cross-realm trust with an Active Directory domain. A user with * sufficient privileges to join resources to the domain. */ public void setADDomainJoinUser(String aDDomainJoinUser) { this.aDDomainJoinUser = aDDomainJoinUser; } /** ** Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient * privileges to join resources to the domain. *
* * @return Required only when establishing a cross-realm trust with an Active Directory domain. A user with * sufficient privileges to join resources to the domain. */ public String getADDomainJoinUser() { return this.aDDomainJoinUser; } /** ** Required only when establishing a cross-realm trust with an Active Directory domain. A user with sufficient * privileges to join resources to the domain. *
* * @param aDDomainJoinUser * Required only when establishing a cross-realm trust with an Active Directory domain. A user with * sufficient privileges to join resources to the domain. * @return Returns a reference to this object so that method calls can be chained together. */ public KerberosAttributes withADDomainJoinUser(String aDDomainJoinUser) { setADDomainJoinUser(aDDomainJoinUser); return this; } /** *
* The Active Directory password for ADDomainJoinUser
.
*
ADDomainJoinUser
.
*/
public void setADDomainJoinPassword(String aDDomainJoinPassword) {
this.aDDomainJoinPassword = aDDomainJoinPassword;
}
/**
*
* The Active Directory password for ADDomainJoinUser
.
*
ADDomainJoinUser
.
*/
public String getADDomainJoinPassword() {
return this.aDDomainJoinPassword;
}
/**
*
* The Active Directory password for ADDomainJoinUser
.
*
ADDomainJoinUser
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public KerberosAttributes withADDomainJoinPassword(String aDDomainJoinPassword) {
setADDomainJoinPassword(aDDomainJoinPassword);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRealm() != null)
sb.append("Realm: ").append(getRealm()).append(",");
if (getKdcAdminPassword() != null)
sb.append("KdcAdminPassword: ").append(getKdcAdminPassword()).append(",");
if (getCrossRealmTrustPrincipalPassword() != null)
sb.append("CrossRealmTrustPrincipalPassword: ").append(getCrossRealmTrustPrincipalPassword()).append(",");
if (getADDomainJoinUser() != null)
sb.append("ADDomainJoinUser: ").append(getADDomainJoinUser()).append(",");
if (getADDomainJoinPassword() != null)
sb.append("ADDomainJoinPassword: ").append(getADDomainJoinPassword());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof KerberosAttributes == false)
return false;
KerberosAttributes other = (KerberosAttributes) obj;
if (other.getRealm() == null ^ this.getRealm() == null)
return false;
if (other.getRealm() != null && other.getRealm().equals(this.getRealm()) == false)
return false;
if (other.getKdcAdminPassword() == null ^ this.getKdcAdminPassword() == null)
return false;
if (other.getKdcAdminPassword() != null && other.getKdcAdminPassword().equals(this.getKdcAdminPassword()) == false)
return false;
if (other.getCrossRealmTrustPrincipalPassword() == null ^ this.getCrossRealmTrustPrincipalPassword() == null)
return false;
if (other.getCrossRealmTrustPrincipalPassword() != null
&& other.getCrossRealmTrustPrincipalPassword().equals(this.getCrossRealmTrustPrincipalPassword()) == false)
return false;
if (other.getADDomainJoinUser() == null ^ this.getADDomainJoinUser() == null)
return false;
if (other.getADDomainJoinUser() != null && other.getADDomainJoinUser().equals(this.getADDomainJoinUser()) == false)
return false;
if (other.getADDomainJoinPassword() == null ^ this.getADDomainJoinPassword() == null)
return false;
if (other.getADDomainJoinPassword() != null && other.getADDomainJoinPassword().equals(this.getADDomainJoinPassword()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getRealm() == null) ? 0 : getRealm().hashCode());
hashCode = prime * hashCode + ((getKdcAdminPassword() == null) ? 0 : getKdcAdminPassword().hashCode());
hashCode = prime * hashCode + ((getCrossRealmTrustPrincipalPassword() == null) ? 0 : getCrossRealmTrustPrincipalPassword().hashCode());
hashCode = prime * hashCode + ((getADDomainJoinUser() == null) ? 0 : getADDomainJoinUser().hashCode());
hashCode = prime * hashCode + ((getADDomainJoinPassword() == null) ? 0 : getADDomainJoinPassword().hashCode());
return hashCode;
}
@Override
public KerberosAttributes clone() {
try {
return (KerberosAttributes) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.elasticmapreduce.model.transform.KerberosAttributesMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}