@API.Public @API.ThreadSafe public interface Connection extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this connection and releases any system resources associated
with it.
|
default DocumentStore |
createStore(String storeName)
Creates an OJAI DocumentStore specified by the given name or path and returns a handle.
|
default DocumentStore |
createStore(String storeName,
Document options)
Creates an OJAI DocumentStore specified by the given name or path and returns a handle.
|
default boolean |
deleteStore(String storeName)
Deletes the OJAI DocumentStore specified by the given name or path.
|
Driver |
getDriver()
Returns the OJAI Driver instance associated with this connection.
|
default DocumentStore |
getStore(String storeName)
Returns a handle to an OJAI DocumentStore specified by the given name
or path.
|
default DocumentStore |
getStore(String storeName,
Document options)
Returns a handle to an OJAI DocumentStore specified by the given name
or path.
|
ValueBuilder |
getValueBuilder()
Returns a ValueBuilder object from this Connection.
|
QueryCondition |
newCondition()
Creates and returns a new QueryCondition object.
|
Document |
newDocument()
Creates and returns a new, empty instance of an OJAI Document.
|
Document |
newDocument(Map<String,Object> map)
Returns a new instance of Document constructed from the specified Map.
|
Document |
newDocument(Object bean)
Returns a new instance of Document built from the specified Java bean.
|
Document |
newDocument(String jsonString)
Returns a new instance of OJAI Document parsed from the specified JSON string.
|
DocumentBuilder |
newDocumentBuilder()
Returns a new DocumentBuilder object.
|
DocumentMutation |
newMutation()
Creates and returns a new DocumentMutation object.
|
Query |
newQuery()
Creates and returns a new Query object.
|
Query |
newQuery(String queryJson)
Creates and returns a new Query object decoded from the supplied JSON String.
|
default boolean |
storeExists(String storeName)
Tests if the OJAI DocumentStore specified by the given name or path exists.
|
default DocumentStore createStore(@API.NonNullable String storeName) throws OjaiException
storeName
- name or path of an OJAI data source table/storeDocumentStore
object.OjaiException
default DocumentStore createStore(@API.NonNullable String storeName, @API.NonNullable Document options) throws OjaiException
storeName
- name or path of an OJAI data source table/storeoptions
- an OJAI Document containing implementation specific optionsDocumentStore
object.OjaiException
default boolean deleteStore(@API.NonNullable String storeName) throws OjaiException
storeName
- name or path of an OJAI data source table/storetrue
if the store was deleted, false
otherwiseOjaiException
default boolean storeExists(@API.NonNullable String storeName) throws OjaiException
storeName
- name or path of an OJAI data source table/storetrue
if the store exists, false
otherwiseOjaiException
default DocumentStore getStore(@API.NonNullable String storeName) throws OjaiException
storeName
- name or path of an OJAI data source table/storeDocumentStore
object.OjaiException
default DocumentStore getStore(@API.NonNullable String storeName, @API.NonNullable Document options) throws OjaiException
storeName
- name or path of an OJAI data source table/storeoptions
- an OJAI Document containing implementation specific optionsOjaiException
ValueBuilder getValueBuilder()
Document newDocument()
Creates and returns a new, empty instance of an OJAI Document.
This is an alias to getDriver().newDocument().Document newDocument(@API.NonNullable String jsonString) throws DecodingException
Returns a new instance of OJAI Document parsed from the specified JSON string.
This is an alias to getDriver().newDocument().DecodingException
Document newDocument(@API.NonNullable Map<String,Object> map) throws DecodingException
Returns a new instance of Document constructed from the specified Map.
This is an alias to getDriver().newDocument().DecodingException
Document newDocument(@API.NonNullable Object bean) throws DecodingException
Returns a new instance of Document built from the specified Java bean.
This is an alias to getDriver().newDocument().DecodingException
DocumentBuilder newDocumentBuilder()
Returns a new DocumentBuilder object.
This is an alias to getDriver().newDocumentBuilder().DocumentMutation newMutation()
Creates and returns a new DocumentMutation object.
This is an alias to getDriver().newMutation().
QueryCondition newCondition()
Creates and returns a new QueryCondition object.
This is an alias to getDriver().newCondition().Query newQuery()
Creates and returns a new Query object.
This is an alias to getDriver().newQuery().Query newQuery(@API.NonNullable String queryJson)
Creates and returns a new Query object decoded from the supplied JSON String.
This is an alias to getDriver().newQuery().Driver getDriver()
void close()
Closes this connection and releases any system resources associated with it. If the connection is already closed then invoking this method has no effect.
This method does not throw any exception.
close
in interface AutoCloseable
close
in interface Closeable
Copyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.