@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.
|
Driver |
getDriver()
Returns the OJAI Driver instance associated with this connection.
|
DocumentStore |
getStore(String storeName)
Returns a handle to an OJAI DocumentStore specified by the given name
or path.
|
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.
|
DocumentStore getStore(@API.NonNullable String storeName) throws OjaiException
storeName
- name or path of an OJAI data source table/storeOjaiException
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 arbitrary, implementation specific settingsOjaiException
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–2018 MapR Technologies, Inc.. All rights reserved.