public class KerberosDescriptorFactory extends Object
| Constructor and Description |
|---|
KerberosDescriptorFactory() |
| Modifier and Type | Method and Description |
|---|---|
KerberosDescriptor |
createInstance(File file)
Given a file containing JSON-formatted text, attempts to create a KerberosDescriptor
|
KerberosDescriptor |
createInstance(Map<?,?> map)
Creates a new KerberosDescriptor
See
KerberosDescriptor for the JSON
Schema that may be used to generate this map. |
KerberosDescriptor |
createInstance(String json)
Given a String containing JSON-formatted text, attempts to create a KerberosDescriptor
|
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 KerberosDescriptor createInstance(File file) throws IOException
file - a File pointing to the file containing JSON-formatted textFileNotFoundException - 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 datapublic KerberosDescriptor createInstance(String json) throws org.apache.ambari.server.AmbariException
json - a File pointing to the file containing JSON-formatted textorg.apache.ambari.server.AmbariException - if an error occurs while processing the JSON-formatted Stringpublic KerberosDescriptor createInstance(Map<?,?> map)
KerberosDescriptor for the JSON
Schema that may be used to generate this map.map - a Map of values use to populate the data for the new instanceKerberosDescriptorprotected 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.