Class DataDictionaryDao
java.lang.Object
gov.nasa.pds.registry.common.es.dao.dd.DataDictionaryDao
Data dictionary DAO (Data Access Object). This class provides methods to read and update data
dictionary.
- Author:
- karpenko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDataTypes(Collection<String> ids) Query Elasticsearch data dictionary to get data types for a list of field ids.getFieldNamesByEsType(String esType) Get field names by Elasticsearch type, such as "boolean" or "date".getLddInfo(String namespace) Get LDD date from data dictionary index in Elasticsearch.List registered LDDs
-
Constructor Details
-
DataDictionaryDao
Constructor- Parameters:
client- Elasticsearch clientindexName- Elasticsearch index name
-
-
Method Details
-
getLddInfo
Get LDD date from data dictionary index in Elasticsearch.- Parameters:
namespace- LDD namespace, e.g., "pds", "geom", etc.- Returns:
- ISO instant class representing LDD date.
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
listLdds
List registered LDDs- Parameters:
namespace- if this parameter is null list all LDDs- Returns:
- a list of LDDs
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
getFieldNamesByEsType
public Set<String> getFieldNamesByEsType(String esType) throws UnsupportedOperationException, IOException Get field names by Elasticsearch type, such as "boolean" or "date".- Returns:
- a set of field names
- Throws:
IOExceptionResponseExceptionUnsupportedOperationExceptionException- an exception
-
getDataTypes
public List<Tuple> getDataTypes(Collection<String> ids) throws IOException, DataTypeNotFoundException Query Elasticsearch data dictionary to get data types for a list of field ids.- Parameters:
ids- A list of field IDs, e.g., "pds:Array_3D/pds:axes".stringForMissing- If true, throw DataTypeNotFoundException on first field missing from Elasticsearch data dictionary. If false, process all missing fields in a batch to create a list of missing namespaces. Don't throw DataTypeNotFoundException.- Returns:
- Data types information object
- Throws:
DataTypeNotFoundExceptionIOExceptionResponseExceptionException- DataTypeNotFoundException, IOException, etc.
-