Skip to content

Commit e8ae268

Browse files
committed
Remove getProcessId/getSecretKey from Connection contract that is specific to PostgreSQL and instead use downcast.
1 parent b25f240 commit e8ae268

File tree

7 files changed

+5
-47
lines changed

7 files changed

+5
-47
lines changed

vertx-oracle-client/src/main/java/io/vertx/oracleclient/impl/OracleJdbcConnection.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,7 @@ public void close(Holder holder, Completable<Void> promise) {
141141
context.runOnContext(v -> close(holder, promise));
142142
}
143143
}
144-
145-
@Override
146-
public int getProcessId() {
147-
throw new UnsupportedOperationException();
148-
}
149-
150-
@Override
151-
public int getSecretKey() {
152-
throw new UnsupportedOperationException();
153-
}
154-
144+
155145
public Future<Void> afterAcquire() {
156146
PromiseInternal<Void> promise = context.owner().promise();
157147
context.<Void>executeBlocking(() -> {

vertx-pg-client/src/main/java/io/vertx/pgclient/impl/PgConnectionImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ public PgConnection noticeHandler(Handler<PgNotice> handler) {
115115

116116
@Override
117117
public int processId() {
118-
return conn.getProcessId();
118+
PgSocketConnection actual = (PgSocketConnection) conn.unwrap();
119+
return actual.getProcessId();
119120
}
120121

121122
@Override
122123
public int secretKey() {
123-
return conn.getSecretKey();
124+
PgSocketConnection actual = (PgSocketConnection) conn.unwrap();
125+
return actual.getSecretKey();
124126
}
125127

126128
@Override

vertx-pg-client/src/main/java/io/vertx/pgclient/impl/PgSocketConnection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,10 @@ protected void handleException(Throwable t) {
125125
}
126126
}
127127

128-
@Override
129128
public int getProcessId() {
130129
return processId;
131130
}
132131

133-
@Override
134132
public int getSecretKey() {
135133
return secretKey;
136134
}

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/SocketConnectionBase.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,6 @@ public void init(Holder holder) {
170170
this.holder = holder;
171171
}
172172

173-
@Override
174-
public int getProcessId() {
175-
throw new UnsupportedOperationException();
176-
}
177-
178-
@Override
179-
public int getSecretKey() {
180-
throw new UnsupportedOperationException();
181-
}
182-
183173
@Override
184174
public void close(Holder holder, Completable<Void> promise) {
185175
if (Vertx.currentContext() == context) {

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool/SqlConnectionPool.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,6 @@ public void handleException(Throwable err) {
481481
}
482482
}
483483

484-
@Override
485-
public int getProcessId() {
486-
return conn.getProcessId();
487-
}
488-
489-
@Override
490-
public int getSecretKey() {
491-
return conn.getSecretKey();
492-
}
493-
494484
@Override
495485
public Connection unwrap() {
496486
return conn;

vertx-sql-client/src/main/java/io/vertx/sqlclient/internal/Connection.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ default String system() {
6363

6464
void close(Holder holder, Completable<Void> promise);
6565

66-
int getProcessId();
67-
68-
int getSecretKey();
69-
7066
/**
7167
* The connection holder that handles connection interactions with the outer world, e.g. handling an event.
7268
*/

vertx-sql-client/src/test/java/io/vertx/tests/sqlclient/spi/backend/GenericDriverTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,6 @@ public void close(Holder holder, Completable<Void> promise) {
118118
promise.succeed();
119119
}
120120
@Override
121-
public int getProcessId() {
122-
return 0;
123-
}
124-
@Override
125-
public int getSecretKey() {
126-
return 0;
127-
}
128-
@Override
129121
public <R> void schedule(CommandBase<R> cmd, Completable<R> handler) {
130122
if (cmd instanceof SimpleQueryCommand) {
131123
SimpleQueryCommand simpleQueryCmd = (SimpleQueryCommand) cmd;

0 commit comments

Comments
 (0)