Package org.apache.calcite.avatica

## Class ConnectionPropertiesImpl

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

All Implemented Interfaces:
  `Meta.ConnectionProperties`

    public class ConnectionPropertiesImpl
    extends java.lang.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 java.lang.Boolean` `autoCommit`
`private java.lang.String` `catalog`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `CATALOG_DESCRIPTOR`
`private boolean` `isDirty`
`private java.lang.Boolean` `readOnly`
`private java.lang.String` `schema`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `SCHEMA_DESCRIPTOR`
`private static com.google.protobuf.Descriptors.FieldDescriptor` `TRANSACTION_ISOLATION_DESCRIPTOR`
`private java.lang.Integer` `transactionIsolation`

### Constructor Summary

Constructors
`ConnectionPropertiesImpl()`
`ConnectionPropertiesImpl​(java.lang.Boolean autoCommit, java.lang.Boolean readOnly, java.lang.Integer transactionIsolation, java.lang.String catalog, java.lang.String schema)`
`ConnectionPropertiesImpl​(java.sql.Connection conn)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `equals​(java.lang.Object o)`
`static ConnectionPropertiesImpl` `fromProto​(Common.ConnectionProperties proto)`
`java.lang.String` `getCatalog()`
`java.lang.String` `getSchema()`
`java.lang.Integer` `getTransactionIsolation()`
`int` `hashCode()`
`java.lang.Boolean` `isAutoCommit()`
`boolean` `isDirty()`
`boolean` `isEmpty()`
`java.lang.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​(java.lang.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​(java.lang.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 java.lang.Boolean autoCommit

#### readOnly

    private java.lang.Boolean readOnly

#### transactionIsolation

    private java.lang.Integer transactionIsolation

#### catalog

    private java.lang.String catalog

#### schema

    private java.lang.String schema

### Constructor Detail

#### ConnectionPropertiesImpl

    public ConnectionPropertiesImpl()

#### ConnectionPropertiesImpl

    public ConnectionPropertiesImpl​(java.sql.Connection conn)
                             throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### ConnectionPropertiesImpl

    public ConnectionPropertiesImpl​(java.lang.Boolean autoCommit,
                                    java.lang.Boolean readOnly,
                                    java.lang.Integer transactionIsolation,
                                    java.lang.String catalog,
                                    java.lang.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 java.lang.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 java.lang.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 java.lang.Integer getTransactionIsolation()

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

#### setCatalog

    public Meta.ConnectionProperties setCatalog​(java.lang.String val)

Sets `catalog` and flag as dirty.

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

#### getCatalog

    public java.lang.String getCatalog()

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

#### setSchema

    public Meta.ConnectionProperties setSchema​(java.lang.String val)

Sets `schema` and flag as dirty.

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

#### getSchema

    public java.lang.String getSchema()

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

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### equals

    public boolean equals​(java.lang.Object o)

Overrides:
  `equals` in class `java.lang.Object`

#### toProto

    public Common.ConnectionProperties toProto()

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

#### fromProto

    public static ConnectionPropertiesImpl fromProto​(Common.ConnectionProperties proto)