Skip to content

Commit 5cb5ec8

Browse files
Packages restructured
1 parent 4aba4af commit 5cb5ec8

File tree

97 files changed

+369
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+369
-371
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ db.queryRows("select unnest('{ hello, world }'::text[] as message)")
4545

4646
### Creating a Db
4747

48-
Db is a connection pool that is created with [`com.github.pgasync.ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
48+
Db is a connection pool that is created with [`ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
4949

5050
```java
5151
Db db = new ConnectionPoolBuilder()
@@ -87,7 +87,7 @@ db.begin()
8787

8888
### Custom data types
8989

90-
Support for additional data types requires registering converters to [`com.github.pgasync.ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
90+
Support for additional data types requires registering converters to [`ConnectionPoolBuilder`](https://github.com/alaisi/postgres-async-driver/blob/master/src/main/java/com/github/pgasync/ConnectionPoolBuilder.java)
9191

9292
```java
9393
class JsonConverter implements Converter<example.Json> {

src/main/java/com/github/pgasync/impl/Oid.java renamed to src/main/java/com/github/pgasync/Oid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

1717
/**
1818
* Object identifiers, copied from org.postgresql.core.Oid.

src/main/java/com/github/pgasync/impl/PgColumn.java renamed to src/main/java/com/github/pgasync/PgColumn.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

1717
/**
1818
* Column index/type pair.

src/main/java/com/github/pgasync/impl/PgConnection.java renamed to src/main/java/com/github/pgasync/PgConnection.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

17-
import static com.github.pgasync.impl.message.backend.RowDescription.ColumnDescription;
17+
import static com.github.pgasync.message.backend.RowDescription.ColumnDescription;
1818

1919
import java.nio.charset.Charset;
2020
import java.util.ArrayList;
@@ -30,24 +30,24 @@
3030
import java.util.logging.Level;
3131
import java.util.logging.Logger;
3232

33-
import com.github.pgasync.Connection;
34-
import com.github.pgasync.Listening;
35-
import com.github.pgasync.PreparedStatement;
36-
import com.github.pgasync.ResultSet;
37-
import com.github.pgasync.Row;
38-
import com.github.pgasync.Transaction;
39-
import com.github.pgasync.impl.conversion.DataConverter;
40-
import com.github.pgasync.impl.message.backend.Authentication;
41-
import com.github.pgasync.impl.message.backend.RowDescription;
42-
import com.github.pgasync.impl.message.frontend.Bind;
43-
import com.github.pgasync.impl.message.frontend.Close;
44-
import com.github.pgasync.impl.message.frontend.Describe;
45-
import com.github.pgasync.impl.message.frontend.Execute;
46-
import com.github.pgasync.impl.message.Message;
47-
import com.github.pgasync.impl.message.frontend.Parse;
48-
import com.github.pgasync.impl.message.frontend.PasswordMessage;
49-
import com.github.pgasync.impl.message.frontend.Query;
50-
import com.github.pgasync.impl.message.frontend.StartupMessage;
33+
import com.pgasync.Connection;
34+
import com.pgasync.Listening;
35+
import com.pgasync.PreparedStatement;
36+
import com.pgasync.ResultSet;
37+
import com.pgasync.Row;
38+
import com.pgasync.Transaction;
39+
import com.github.pgasync.conversion.DataConverter;
40+
import com.github.pgasync.message.backend.Authentication;
41+
import com.github.pgasync.message.backend.RowDescription;
42+
import com.github.pgasync.message.frontend.Bind;
43+
import com.github.pgasync.message.frontend.Close;
44+
import com.github.pgasync.message.frontend.Describe;
45+
import com.github.pgasync.message.frontend.Execute;
46+
import com.github.pgasync.message.Message;
47+
import com.github.pgasync.message.frontend.Parse;
48+
import com.github.pgasync.message.frontend.PasswordMessage;
49+
import com.github.pgasync.message.frontend.Query;
50+
import com.github.pgasync.message.frontend.StartupMessage;
5151

5252
/**
5353
* A connection to Postgres backend. The postmaster forks a backend process for

src/main/java/com/github/pgasync/impl/PgConnectionPool.java renamed to src/main/java/com/github/pgasync/PgConnectionPool.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
16-
17-
import com.github.pgasync.*;
18-
import com.github.pgasync.ConnectionPoolBuilder.PoolProperties;
19-
import com.github.pgasync.impl.conversion.DataConverter;
15+
package com.github.pgasync;
16+
17+
import com.github.pgasync.conversion.DataConverter;
18+
import com.pgasync.Connection;
19+
import com.pgasync.Listening;
20+
import com.pgasync.PreparedStatement;
21+
import com.pgasync.Row;
22+
import com.pgasync.SqlException;
23+
import com.pgasync.ConnectionPool;
24+
import com.pgasync.ConnectionPoolBuilder;
25+
import com.pgasync.ResultSet;
26+
import com.pgasync.Transaction;
2027

2128
import javax.annotation.concurrent.GuardedBy;
2229
import java.net.InetSocketAddress;
@@ -201,8 +208,9 @@ public CompletableFuture<Integer> fetch(BiConsumer<Map<String, PgColumn>, PgColu
201208
private final int maxConnections;
202209
private final int maxStatements;
203210
private final String validationQuery;
204-
protected final Charset encoding;
205211
private final ReentrantLock lock = new ReentrantLock();
212+
protected final Charset encoding;
213+
206214
@GuardedBy("lock")
207215
private int size;
208216
@GuardedBy("lock")
@@ -220,7 +228,7 @@ public CompletableFuture<Integer> fetch(BiConsumer<Map<String, PgColumn>, PgColu
220228

221229
protected final Executor futuresExecutor;
222230

223-
public PgConnectionPool(PoolProperties properties, Executor futuresExecutor) {
231+
public PgConnectionPool(ConnectionPoolBuilder.PoolProperties properties, Executor futuresExecutor) {
224232
this.address = InetSocketAddress.createUnresolved(properties.getHostname(), properties.getPort());
225233
this.username = properties.getUsername();
226234
this.password = properties.getPassword();

src/main/java/com/github/pgasync/impl/PgProtocolStream.java renamed to src/main/java/com/github/pgasync/PgProtocolStream.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
16-
17-
import com.github.pgasync.impl.message.Message;
18-
import com.github.pgasync.impl.message.backend.CommandComplete;
19-
import com.github.pgasync.impl.message.backend.DataRow;
20-
import com.github.pgasync.impl.message.backend.RowDescription;
21-
import com.github.pgasync.impl.message.frontend.Execute;
22-
import com.github.pgasync.impl.message.frontend.Parse;
23-
import com.github.pgasync.impl.message.frontend.PasswordMessage;
24-
import com.github.pgasync.impl.message.frontend.Query;
25-
import com.github.pgasync.impl.message.frontend.StartupMessage;
15+
package com.github.pgasync;
16+
17+
import com.github.pgasync.message.Message;
18+
import com.github.pgasync.message.backend.CommandComplete;
19+
import com.github.pgasync.message.backend.DataRow;
20+
import com.github.pgasync.message.backend.RowDescription;
21+
import com.github.pgasync.message.frontend.Execute;
22+
import com.github.pgasync.message.frontend.PasswordMessage;
23+
import com.github.pgasync.message.frontend.Query;
24+
import com.github.pgasync.message.frontend.StartupMessage;
2625

2726
import java.util.concurrent.CompletableFuture;
2827
import java.util.function.Consumer;

src/main/java/com/github/pgasync/impl/PgResultSet.java renamed to src/main/java/com/github/pgasync/PgResultSet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

17-
import com.github.pgasync.ResultSet;
18-
import com.github.pgasync.Row;
17+
import com.pgasync.ResultSet;
18+
import com.pgasync.Row;
1919

2020
import java.util.*;
2121

src/main/java/com/github/pgasync/impl/PgRow.java renamed to src/main/java/com/github/pgasync/PgRow.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl;
15+
package com.github.pgasync;
1616

17-
import com.github.pgasync.Row;
18-
import com.github.pgasync.SqlException;
19-
import com.github.pgasync.impl.conversion.DataConverter;
20-
import com.github.pgasync.impl.message.backend.DataRow;
17+
import com.pgasync.Row;
18+
import com.pgasync.SqlException;
19+
import com.github.pgasync.conversion.DataConverter;
20+
import com.github.pgasync.message.backend.DataRow;
2121

2222
import java.math.BigDecimal;
2323
import java.math.BigInteger;

src/main/java/com/github/pgasync/impl/conversion/ArrayConversions.java renamed to src/main/java/com/github/pgasync/conversion/ArrayConversions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.impl.Oid;
3+
import com.github.pgasync.Oid;
44

55
import java.lang.reflect.Array;
66
import java.util.ArrayList;

src/main/java/com/github/pgasync/impl/conversion/BlobConversions.java renamed to src/main/java/com/github/pgasync/conversion/BlobConversions.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.SqlException;
4-
import com.github.pgasync.impl.Oid;
5-
6-
import java.nio.charset.Charset;
7-
import java.nio.charset.StandardCharsets;
3+
import com.pgasync.SqlException;
4+
import com.github.pgasync.Oid;
85

96
import static javax.xml.bind.DatatypeConverter.parseHexBinary;
107
import static javax.xml.bind.DatatypeConverter.printHexBinary;

src/main/java/com/github/pgasync/impl/conversion/BooleanConversions.java renamed to src/main/java/com/github/pgasync/conversion/BooleanConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.SqlException;
4-
import com.github.pgasync.impl.Oid;
3+
import com.pgasync.SqlException;
4+
import com.github.pgasync.Oid;
55

66
/**
77
* @author Antti Laisi

src/main/java/com/github/pgasync/impl/conversion/DataConverter.java renamed to src/main/java/com/github/pgasync/conversion/DataConverter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.Converter;
4-
import com.github.pgasync.impl.Oid;
3+
import com.pgasync.Converter;
4+
import com.github.pgasync.Oid;
55

66
import java.math.BigDecimal;
77
import java.math.BigInteger;

src/main/java/com/github/pgasync/impl/conversion/NumericConversions.java renamed to src/main/java/com/github/pgasync/conversion/NumericConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.SqlException;
4-
import com.github.pgasync.impl.Oid;
3+
import com.pgasync.SqlException;
4+
import com.github.pgasync.Oid;
55

66
import java.math.BigDecimal;
77
import java.math.BigInteger;

src/main/java/com/github/pgasync/impl/conversion/StringConversions.java renamed to src/main/java/com/github/pgasync/conversion/StringConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.SqlException;
4-
import com.github.pgasync.impl.Oid;
3+
import com.pgasync.SqlException;
4+
import com.github.pgasync.Oid;
55

66
/**
77
* @author Antti Laisi

src/main/java/com/github/pgasync/impl/conversion/TemporalConversions.java renamed to src/main/java/com/github/pgasync/conversion/TemporalConversions.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package com.github.pgasync.impl.conversion;
1+
package com.github.pgasync.conversion;
22

3-
import com.github.pgasync.SqlException;
4-
import com.github.pgasync.impl.Oid;
3+
import com.pgasync.SqlException;
4+
import com.github.pgasync.Oid;
55

66
import java.sql.Date;
77
import java.sql.Time;

src/main/java/com/github/pgasync/impl/message/frontend/SSLRequest.java

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/main/java/com/github/pgasync/impl/io/Decoder.java renamed to src/main/java/com/github/pgasync/io/Decoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io;
15+
package com.github.pgasync.io;
1616

17-
import com.github.pgasync.impl.message.Message;
17+
import com.github.pgasync.message.Message;
1818

1919
import java.nio.ByteBuffer;
2020
import java.nio.charset.Charset;

src/main/java/com/github/pgasync/impl/io/Encoder.java renamed to src/main/java/com/github/pgasync/io/Encoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io;
15+
package com.github.pgasync.io;
1616

17-
import com.github.pgasync.impl.message.Message;
17+
import com.github.pgasync.message.Message;
1818

1919
import java.nio.ByteBuffer;
2020
import java.nio.charset.Charset;

src/main/java/com/github/pgasync/impl/io/IO.java renamed to src/main/java/com/github/pgasync/io/IO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io;
15+
package com.github.pgasync.io;
1616

1717
import java.io.ByteArrayOutputStream;
1818
import java.nio.ByteBuffer;

src/main/java/com/github/pgasync/impl/io/backend/AuthenticationDecoder.java renamed to src/main/java/com/github/pgasync/io/backend/AuthenticationDecoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io.backend;
15+
package com.github.pgasync.io.backend;
1616

17-
import com.github.pgasync.impl.io.Decoder;
18-
import com.github.pgasync.impl.message.backend.Authentication;
17+
import com.github.pgasync.io.Decoder;
18+
import com.github.pgasync.message.backend.Authentication;
1919

2020
import java.nio.ByteBuffer;
2121
import java.nio.charset.Charset;

src/main/java/com/github/pgasync/impl/io/backend/BindCompleteDecoder.java renamed to src/main/java/com/github/pgasync/io/backend/BindCompleteDecoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io.backend;
15+
package com.github.pgasync.io.backend;
1616

17-
import com.github.pgasync.impl.io.Decoder;
18-
import com.github.pgasync.impl.message.backend.BIndicators;
17+
import com.github.pgasync.io.Decoder;
18+
import com.github.pgasync.message.backend.BIndicators;
1919

2020
import java.nio.ByteBuffer;
2121
import java.nio.charset.Charset;

src/main/java/com/github/pgasync/impl/io/backend/CloseCompleteDecoder.java renamed to src/main/java/com/github/pgasync/io/backend/CloseCompleteDecoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io.backend;
15+
package com.github.pgasync.io.backend;
1616

17-
import com.github.pgasync.impl.io.Decoder;
18-
import com.github.pgasync.impl.message.backend.BIndicators;
17+
import com.github.pgasync.io.Decoder;
18+
import com.github.pgasync.message.backend.BIndicators;
1919

2020
import java.nio.ByteBuffer;
2121
import java.nio.charset.Charset;

src/main/java/com/github/pgasync/impl/io/backend/CommandCompleteDecoder.java renamed to src/main/java/com/github/pgasync/io/backend/CommandCompleteDecoder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io.backend;
15+
package com.github.pgasync.io.backend;
1616

17-
import com.github.pgasync.impl.io.Decoder;
18-
import com.github.pgasync.impl.message.backend.CommandComplete;
17+
import com.github.pgasync.io.Decoder;
18+
import com.github.pgasync.message.backend.CommandComplete;
1919

2020
import java.nio.ByteBuffer;
2121
import java.nio.charset.Charset;
2222

23-
import static com.github.pgasync.impl.io.IO.getCString;
23+
import static com.github.pgasync.io.IO.getCString;
2424

2525
/**
2626
* See <a href="www.postgresql.org/docs/9.3/static/protocol-message-formats.html">Postgres message formats</a>

src/main/java/com/github/pgasync/impl/io/backend/DataRowDecoder.java renamed to src/main/java/com/github/pgasync/io/backend/DataRowDecoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
* limitations under the License.
1313
*/
1414

15-
package com.github.pgasync.impl.io.backend;
15+
package com.github.pgasync.io.backend;
1616

17-
import com.github.pgasync.impl.io.Decoder;
18-
import com.github.pgasync.impl.message.backend.DataRow;
17+
import com.github.pgasync.io.Decoder;
18+
import com.github.pgasync.message.backend.DataRow;
1919

2020
import java.nio.ByteBuffer;
2121
import java.nio.charset.Charset;

0 commit comments

Comments
 (0)