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.

### Field Summary

Fields
`private Boolean` `autoCommit`
`private String` `catalog`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `CATALOG_DESCRIPTOR`
`private boolean` `isDirty`
`private Boolean` `readOnly`
`private String` `schema`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `SCHEMA_DESCRIPTOR`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `TRANSACTION_ISOLATION_DESCRIPTOR`
`private Integer` `transactionIsolation`

### Constructor Summary

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

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`static ConnectionPropertiesImpl` `fromProto(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.
`Common.ConnectionProperties` `toProto()`

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

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

### Field Detail

#### CATALOG_DESCRIPTOR

    private static final com.google.protobuf.Descriptors.FieldDescriptor CATALOG_DESCRIPTOR

#### SCHEMA_DESCRIPTOR

    private static final com.google.protobuf.Descriptors.FieldDescriptor SCHEMA_DESCRIPTOR

#### TRANSACTION_ISOLATION_DESCRIPTOR

    private static final com.google.protobuf.Descriptors.FieldDescriptor TRANSACTION_ISOLATION_DESCRIPTOR

#### isDirty

    private boolean isDirty

#### autoCommit

    private Boolean autoCommit

#### readOnly

    private Boolean readOnly

#### transactionIsolation

    private Integer transactionIsolation

#### catalog

    private String catalog

#### schema

    private String schema

### Constructor Detail

#### 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 Detail

#### 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 Common.ConnectionProperties toProto()

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

#### fromProto

    public static ConnectionPropertiesImpl fromProto(Common.ConnectionProperties proto)