public class KerberosServiceDescriptorFactory extends Object
Constructor and Description |
---|
KerberosServiceDescriptorFactory() |
Modifier and Type | Method and Description |
---|---|
KerberosServiceDescriptor |
createInstance(File file,
String name)
Creates the requested KerberosServiceDescriptor parsed from a JSON-formatted file.
|
KerberosServiceDescriptor |
createInstance(Map<String,Object> map,
String name)
Creates the requested KerberosServiceDescriptor parsed from a Map of data.
|
KerberosServiceDescriptor |
createInstance(String name,
Map<?,?> map)
Creates a new KerberosServiceDescriptor
|
KerberosServiceDescriptor |
createInstance(String name,
String json)
Creates a new KerberosServiceDescriptor
|
KerberosServiceDescriptor[] |
createInstances(File file)
Creates a Collection of KerberosServiceDescriptors parsed from a JSON-formatted file.
|
KerberosServiceDescriptor[] |
createInstances(Map<String,Object> map)
Creates a Collection of KerberosServiceDescriptors parsed from a Map of data.
|
KerberosServiceDescriptor[] |
createInstances(String json)
Creates a Collection of KerberosServiceDescriptors parsed from a JSON-formatted String.
|
protected Map<String,Object> |
parseFile(File file)
Parses a file containing JSON-formatted text into a (generic) Map.
|
protected Map<String,Object> |
parseJSON(String json)
Parses a JSON-formatted String into a (generic) Map.
|
public KerberosServiceDescriptor[] createInstances(File file) throws IOException
{ "services" : [ ... (zero or more service descriptor blocks) ... ] }
file
- a JSON-formatted file containing this service-level descriptor dataFileNotFoundException
- if the specified File does not point to a valid fileIOException
- if the specified File is not a readable fileorg.apache.ambari.server.AmbariException
- if the specified File does not contain valid JSON dataKerberosServiceDescriptor
public KerberosServiceDescriptor[] createInstances(String json) throws org.apache.ambari.server.AmbariException
{ "services" : [ ... (zero or more service descriptor blocks) ... ] }
json
- a JSON-formatted String containing this service-level descriptor dataorg.apache.ambari.server.AmbariException
- if an error occurs while processing the JSON-formatted StringKerberosServiceDescriptor
public KerberosServiceDescriptor[] createInstances(Map<String,Object> map) throws org.apache.ambari.server.AmbariException
"services" => [ ... (zero or more Maps containing service descriptor data) ... ]
map
- a Map containing this service-level descriptor dataorg.apache.ambari.server.AmbariException
- if an error occurs while processing the MapKerberosServiceDescriptor
public KerberosServiceDescriptor createInstance(File file, String name) throws IOException
{ "services" : [ ... (zero or more service descriptor blocks) ... ] }Because of this one or more services may exist. This method parses through the definitions to return the a KerberosServiceDescriptor for the requested service
file
- a JSON-formatted file containing this service-level descriptor dataname
- a String containing the nae of the desired serviceFileNotFoundException
- if the specified File does not point to a valid fileIOException
- if the specified File is not a readable fileorg.apache.ambari.server.AmbariException
- if the specified File does not contain valid JSON dataKerberosServiceDescriptor
public KerberosServiceDescriptor createInstance(Map<String,Object> map, String name) throws org.apache.ambari.server.AmbariException
"services" => [ ... (zero or more Maps containing service descriptor data) ... ]Because of this one or more services may exist. This method parses through the definitions to return the a KerberosServiceDescriptor for the requested service
map
- a Map containing this service-level descriptor dataname
- a String containing the nae of the desired serviceorg.apache.ambari.server.AmbariException
- if an error occurs while processing the MapKerberosServiceDescriptor
public KerberosServiceDescriptor createInstance(String name, String json) throws org.apache.ambari.server.AmbariException
name
- a String declaring this service's namejson
- a JSON-formatted String containing this service's descriptor dataorg.apache.ambari.server.AmbariException
- if an error occurs while parsing the JSON-formatted StringKerberosServiceDescriptor
public KerberosServiceDescriptor createInstance(String name, Map<?,?> map) throws org.apache.ambari.server.AmbariException
name
- a String declaring this service's namemap
- a Map of values use to populate the data for the new instanceorg.apache.ambari.server.AmbariException
- if an error occurs while parsing the JSON-formatted StringKerberosServiceDescriptor
protected Map<String,Object> parseFile(File file) throws IOException
file
- a File containing the JSON-formatted text to parseFileNotFoundException
- if the specified File does not point to a valid fileIOException
- if the specified File is not a readable fileorg.apache.ambari.server.AmbariException
- if the specified File does not contain valid JSON dataprotected Map<String,Object> parseJSON(String json) throws org.apache.ambari.server.AmbariException
json
- a String containing the JSON-formatted text to parseorg.apache.ambari.server.AmbariException
- if an error occurs while parsing the JSON-formatted StringCopyright © 2022 Apache Software Foundation. All rights reserved.