public class KerberosDescriptor extends AbstractKerberosDescriptorContainer
AbstractKerberosDescriptorContainer)AbstractKerberosDescriptorContainer)
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "KerberosDescriptor",
"description": "Describes a Kerberos descriptor",
"type": "object",
"properties": {
"services": {
"description": "A list of service descriptors",
"type": "array",
"items": {
"title": "KerberosServiceDescriptor"
"type": "KerberosServiceDescriptor"
}
},
"properties": {
"description": "Global properties that can be used in variable replacements",
"type": "object",
"patternProperties": {
"^[\w\.\_]?$": {}"
}
}
"identities": {
"description": "A list of Kerberos identity descriptors",
"type": "array",
"items": {
"title": "KerberosIdentityDescriptor"
"type": "KerberosIdentityDescriptor"
}
},
"configurations": {
"description": "A list of relevant configuration blocks",
"type": "array",
"items": {
"title": "KerberosConfigurationDescriptor"
"type": "KerberosConfigurationDescriptor"
}
}
}
}
In this implementation,
AbstractKerberosDescriptor.name will be nullAbstractKerberosDescriptor.Type| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_PROPERTIES |
static String |
KEY_SERVICES |
AUTH_TO_LOCAL_PROPERTY_SPECIFICATION_PATTERN| Constructor and Description |
|---|
KerberosDescriptor()
Creates an empty KerberosDescriptor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
Set<String> |
getAllAuthToLocalProperties()
Recursively gets the entire set of
auth_to_local property names contain within this
KerberosDescriptor. |
AbstractKerberosDescriptorContainer |
getChildContainer(String name)
Returns a specific named child container
|
Collection<? extends AbstractKerberosDescriptorContainer> |
getChildContainers()
Returns the child containers associated with this container.
|
protected AbstractKerberosDescriptor |
getDescriptor(AbstractKerberosDescriptor.Type type,
String name)
Gets the requested AbstractKerberosDescriptor implementation using a type name and a relevant
descriptor name.
|
Map<String,String> |
getProperties()
Gets the Map of properties for this KerberosDescriptor
|
String |
getProperty(String name)
Gets the value of the property with the specified name
|
KerberosServiceDescriptor |
getService(String name)
Gets the KerberosServiceDescriptor with the specified name
|
Map<String,KerberosServiceDescriptor> |
getServices()
Returns a Map of the KerberosServiceDescriptors in this KerberosDescriptor
|
int |
hashCode() |
Map<String,String> |
principals()
Get a map of principals, where the key is the principal path (SERVICE/COMPONENT/principal_name or SERVICE/principal_name) and the value is the principal.
|
void |
putProperty(String name,
String value)
Adds or updates a property value
If a property exists with the specified name, replaces its value; else adds a new entry.
|
void |
putService(KerberosServiceDescriptor service)
Adds, replaces, or updates a KerberosServiceDescriptor
If a KerberosServiceDescriptor with the same name does not exist in the services Map, a new
entry will be added; else if it one already exists and
overwrite is
true, it will be replaced; else the exsting entry will be updated. |
void |
setParent(AbstractKerberosDescriptor parent)
Sets the parent (or container) of this descriptor
This implementation prevents the parent from being externally set by always throwing an
UnsupportedOperationException.
|
void |
setProperties(Map<String,String> properties)
Set the Map of properties for this KerberosDescriptor
|
void |
setServices(Map<String,KerberosServiceDescriptor> services)
Set the KerberosServiceDescriptors in this KerberosDescriptor
|
Map<String,Object> |
toMap()
Creates a Map of values that can be used to create a copy of this KerberosDescriptor
or generate the JSON structure described in
KerberosDescriptor |
KerberosDescriptor |
update(KerberosDescriptor updates)
Updates this KerberosDescriptor with data from another KerberosDescriptor
Properties will be updated if the relevant updated values are not null.
|
getAuthToLocalProperties, getConfiguration, getConfigurations, getConfigurations, getIdentities, getIdentities, getIdentitiesSkipReferences, getIdentity, getReferencedIdentityDescriptor, isContainer, putAuthToLocalProperty, putConfiguration, putIdentity, removeIdentity, setAuthToLocalProperties, setConfigurations, setIdentities, updategetBooleanValue, getBooleanValue, getName, getParent, getPath, getRoot, getStringValue, getValue, nullToEmpty, nullToEmpty, nullToEmpty, setNamepublic static final String KEY_PROPERTIES
public static final String KEY_SERVICES
public KerberosDescriptor()
public Collection<? extends AbstractKerberosDescriptorContainer> getChildContainers()
AbstractKerberosDescriptorContainergetChildContainers in class AbstractKerberosDescriptorContainerAbstractKerberosDescriptorContainerspublic AbstractKerberosDescriptorContainer getChildContainer(String name)
AbstractKerberosDescriptorContainergetChildContainer in class AbstractKerberosDescriptorContainername - the name of the child container to retrieveAbstractKerberosDescriptorContainerpublic void setServices(Map<String,KerberosServiceDescriptor> services)
services - a Map of String to KerberosServiceDescriptorpublic Map<String,KerberosServiceDescriptor> getServices()
public KerberosServiceDescriptor getService(String name)
name - a String declaring the name of the KerberosServiceDescriptor to retrievepublic void putService(KerberosServiceDescriptor service)
overwrite is
true, it will be replaced; else the exsting entry will be updated.service - the KerberosServiceDescriptor to putpublic void setProperties(Map<String,String> properties)
properties - a Map of String to String valuespublic Map<String,String> getProperties()
public String getProperty(String name)
name - a String declaring the name of the property to retrievepublic void putProperty(String name, String value)
name - a String declaring the name of the property to putvalue - a String containing the value of the property to putpublic KerberosDescriptor update(KerberosDescriptor updates)
updates - the KerberosDescriptor containing the updated valuesKerberosDescriptor for convenienceprotected AbstractKerberosDescriptor getDescriptor(AbstractKerberosDescriptor.Type type, String name)
getDescriptor in class AbstractKerberosDescriptorContainertype - a String indicating the type of the requested descriptorname - a String indicating the name of the requested descriptorpublic Map<String,Object> toMap()
KerberosDescriptortoMap in class AbstractKerberosDescriptorContainerKerberosDescriptorpublic void setParent(AbstractKerberosDescriptor parent)
setParent in class AbstractKerberosDescriptorparent - an AbstractKerberosDescriptor representing the parent (or container) of thispublic int hashCode()
hashCode in class AbstractKerberosDescriptorContainerpublic boolean equals(Object object)
equals in class AbstractKerberosDescriptorContainerpublic Set<String> getAllAuthToLocalProperties()
auth_to_local property names contain within this
KerberosDescriptor.public Map<String,String> principals() throws org.apache.ambari.server.AmbariException
For example if the kerberos principal of the HISTORYSERVER is defined in the kerberos.json: "name": "history_server_jhs", "principal": { "value": "jhs/_HOST@${realm}", "type" : "service", }, Then "jhs/_HOST@EXAMPLE.COM" will be put into the map under the "MAPREDUCE2/HISTORYSERVER/history_server_jhs" key.
org.apache.ambari.server.AmbariExceptionCopyright © 2022 Apache Software Foundation. All rights reserved.