Package org.apache.calcite.avatica

# Class ConnectionPropertiesImpl

java.lang.Object
org.apache.calcite.avatica.ConnectionPropertiesImpl

All Implemented Interfaces:
  `Meta.ConnectionProperties`

public class ConnectionPropertiesImpl extends Object implements Meta.ConnectionProperties
Concrete implementation of `Meta.ConnectionProperties`. Provides additional state tracking to enable `RemoteMeta` to lazily push changes up to a query server.

`Meta` instances should probably hold authority on the `isDirty` flag because `AvaticaConnection` instances have no way of knowing if they're local or remote.

## Constructor Summary

Constructors
Constructor
Description
`ConnectionPropertiesImpl()`
`ConnectionPropertiesImpl(Boolean autoCommit, Boolean readOnly, Integer transactionIsolation, String catalog, String schema)`
`ConnectionPropertiesImpl(Connection conn)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`static ConnectionPropertiesImpl`
`fromProto(org.apache.calcite.avatica.proto.Common.ConnectionProperties proto)`
`String`
`getCatalog()`
`String`
`getSchema()`
`Integer`
`getTransactionIsolation()`
`int`
`hashCode()`
`Boolean`
`isAutoCommit()`
`boolean`
`isDirty()`
`boolean`
`isEmpty()`
`Boolean`
`isReadOnly()`
`ConnectionPropertiesImpl`
`merge(Meta.ConnectionProperties that)`
Overwrites fields in `this` with any non-null fields in `that`.
`Meta.ConnectionProperties`
`setAutoCommit(boolean val)`
Sets `autoCommit` status and flag as dirty.
`Meta.ConnectionProperties`
`setCatalog(String val)`
Sets `catalog` and flag as dirty.
`ConnectionPropertiesImpl`
`setDirty(boolean val)`
`Meta.ConnectionProperties`
`setReadOnly(boolean val)`
Sets `readOnly` status and flag as dirty.
`Meta.ConnectionProperties`
`setSchema(String val)`
Sets `schema` and flag as dirty.
`Meta.ConnectionProperties`
`setTransactionIsolation(int val)`
Sets `transactionIsolation` status and flag as dirty.
`org.apache.calcite.avatica.proto.Common.ConnectionProperties`
`toProto()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ConnectionPropertiesImpl

public ConnectionPropertiesImpl()

### ConnectionPropertiesImpl

public ConnectionPropertiesImpl(Connection conn) throws SQLException

Throws:
  `SQLException`

### ConnectionPropertiesImpl

public ConnectionPropertiesImpl(Boolean autoCommit, Boolean readOnly, Integer transactionIsolation, String catalog, String schema)

## Method Details

### setDirty

public ConnectionPropertiesImpl setDirty(boolean val)

### isDirty

public boolean isDirty()

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Meta.ConnectionProperties`
Returns:
  `true` when no properties have been set, `false` otherwise.

### merge

public ConnectionPropertiesImpl merge(Meta.ConnectionProperties that)
Overwrites fields in `this` with any non-null fields in `that`. Sets `isDirty` if any fields are changed.

Specified by:
  `merge` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### setAutoCommit

public Meta.ConnectionProperties setAutoCommit(boolean val)
Sets `autoCommit` status and flag as dirty.

Specified by:
  `setAutoCommit` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### isAutoCommit

public Boolean isAutoCommit()

Specified by:
  `isAutoCommit` in interface `Meta.ConnectionProperties`

### setReadOnly

public Meta.ConnectionProperties setReadOnly(boolean val)
Sets `readOnly` status and flag as dirty.

Specified by:
  `setReadOnly` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### isReadOnly

public Boolean isReadOnly()

Specified by:
  `isReadOnly` in interface `Meta.ConnectionProperties`

### setTransactionIsolation

public Meta.ConnectionProperties setTransactionIsolation(int val)
Sets `transactionIsolation` status and flag as dirty.

Specified by:
  `setTransactionIsolation` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### getTransactionIsolation

public Integer getTransactionIsolation()

Specified by:
  `getTransactionIsolation` in interface `Meta.ConnectionProperties`

### setCatalog

public Meta.ConnectionProperties setCatalog(String val)
Sets `catalog` and flag as dirty.

Specified by:
  `setCatalog` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### getCatalog

public String getCatalog()

Specified by:
  `getCatalog` in interface `Meta.ConnectionProperties`

### setSchema

public Meta.ConnectionProperties setSchema(String val)
Sets `schema` and flag as dirty.

Specified by:
  `setSchema` in interface `Meta.ConnectionProperties`
Returns:
  `this`

### getSchema

public String getSchema()

Specified by:
  `getSchema` in interface `Meta.ConnectionProperties`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### toProto

public org.apache.calcite.avatica.proto.Common.ConnectionProperties toProto()

Specified by:
  `toProto` in interface `Meta.ConnectionProperties`

### fromProto

public static ConnectionPropertiesImpl fromProto(org.apache.calcite.avatica.proto.Common.ConnectionProperties proto)