Skip to content

Commit 7e93c76

Browse files
committed
MSSQL command messages should be named MSSQLCommandMessage instead of MSSQLCommandCodec for more clarity.
1 parent 739e6b9 commit 7e93c76

18 files changed

+56
-57
lines changed

vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/MSSQLSocketConnection.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import io.vertx.core.spi.metrics.ClientMetrics;
2828
import io.vertx.mssqlclient.MSSQLConnectOptions;
2929
import io.vertx.mssqlclient.MSSQLInfo;
30-
import io.vertx.mssqlclient.impl.codec.ExtendedQueryCommandBaseCodec;
31-
import io.vertx.mssqlclient.impl.codec.MSSQLCommandCodec;
30+
import io.vertx.mssqlclient.impl.codec.ExtendedQueryMSSQLCommandBaseMessage;
31+
import io.vertx.mssqlclient.impl.codec.MSSQLCommandMessage;
3232
import io.vertx.mssqlclient.impl.codec.MSSQLPreparedStatement;
3333
import io.vertx.mssqlclient.impl.codec.TdsLoginSentCompletionHandler;
3434
import io.vertx.mssqlclient.impl.codec.TdsMessageCodec;
@@ -156,12 +156,12 @@ public void init() {
156156

157157
@Override
158158
protected CommandMessage<?, ?> toMessage(ExtendedQueryCommand<?> command, PreparedStatement preparedStatement) {
159-
return ExtendedQueryCommandBaseCodec.create(command, (MSSQLPreparedStatement)preparedStatement);
159+
return ExtendedQueryMSSQLCommandBaseMessage.create(command, (MSSQLPreparedStatement)preparedStatement);
160160
}
161161

162162
@Override
163163
protected CommandMessage<?, ?> toMessage(CommandBase<?> command) {
164-
return MSSQLCommandCodec.wrap(command);
164+
return MSSQLCommandMessage.wrap(command);
165165
}
166166

167167
@Override
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
import io.vertx.sqlclient.spi.protocol.CloseConnectionCommand;
1515

16-
class CloseConnectionCommandCodec extends MSSQLCommandCodec<Void, CloseConnectionCommand> {
17-
CloseConnectionCommandCodec(CloseConnectionCommand cmd) {
16+
class CloseConnectionMSSQLCommandMessage extends MSSQLCommandMessage<Void, CloseConnectionCommand> {
17+
CloseConnectionMSSQLCommandMessage(CloseConnectionCommand cmd) {
1818
super(cmd);
1919
}
2020

vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/CloseCursorCommandCodec.java renamed to vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/CloseCursorMSSQLCommandMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
import static io.vertx.mssqlclient.impl.codec.DataType.INTN;
1919
import static io.vertx.mssqlclient.impl.codec.MessageType.RPC;
2020

21-
public class CloseCursorCommandCodec extends MSSQLCommandCodec<Void, CloseCursorCommand> {
21+
public class CloseCursorMSSQLCommandMessage extends MSSQLCommandMessage<Void, CloseCursorCommand> {
2222

2323
private CursorData cursorData;
2424
private boolean cursorClosed;
2525

26-
public CloseCursorCommandCodec(CloseCursorCommand cmd) {
26+
public CloseCursorMSSQLCommandMessage(CloseCursorCommand cmd) {
2727
super(cmd);
2828
}
2929

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
import static io.vertx.mssqlclient.impl.codec.DataType.INTN;
1919
import static io.vertx.mssqlclient.impl.codec.MessageType.RPC;
2020

21-
class CloseStatementCommandCodec extends MSSQLCommandCodec<Void, CloseStatementCommand> {
21+
class CloseStatementMSSQLCommandMessage extends MSSQLCommandMessage<Void, CloseStatementCommand> {
2222

23-
CloseStatementCommandCodec(CloseStatementCommand cmd) {
23+
CloseStatementMSSQLCommandMessage(CloseStatementCommand cmd) {
2424
super(cmd);
2525
}
2626

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818

1919
import java.util.List;
2020

21-
class ExtendedBatchQueryCommandCodec<T> extends ExtendedQueryCommandBaseCodec<T> {
21+
class ExtendedBatchQueryMSSQLCommandMessage<T> extends ExtendedQueryMSSQLCommandBaseMessage<T> {
2222

2323
private final List<TupleBase> paramsList;
2424

2525
private int paramsIdx;
2626
private int messageDecoded;
2727

28-
ExtendedBatchQueryCommandCodec(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
28+
ExtendedBatchQueryMSSQLCommandMessage(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
2929
super(cmd, ps);
3030
paramsList = cmd.paramsList();
3131
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import static io.vertx.mssqlclient.impl.codec.DataType.NVARCHAR;
2020
import static io.vertx.mssqlclient.impl.codec.MessageType.RPC;
2121

22-
class ExtendedCursorQueryCommandCodec<T> extends ExtendedQueryCommandBaseCodec<T> {
22+
class ExtendedCursorQueryMSSQLCommandMessage<T> extends ExtendedQueryMSSQLCommandBaseMessage<T> {
2323

2424
private CursorData cursorData;
2525

26-
ExtendedCursorQueryCommandCodec(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
26+
ExtendedCursorQueryMSSQLCommandMessage(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
2727
super(cmd, ps);
2828
}
2929

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919
import static io.vertx.mssqlclient.impl.codec.DataType.*;
2020
import static io.vertx.mssqlclient.impl.codec.MessageType.RPC;
2121

22-
public abstract class ExtendedQueryCommandBaseCodec<T> extends QueryCommandBaseCodec<T, ExtendedQueryCommand<T>> {
22+
public abstract class ExtendedQueryMSSQLCommandBaseMessage<T> extends QueryMSSQLCommandBaseMessage<T, ExtendedQueryCommand<T>> {
2323

2424
final MSSQLPreparedStatement ps;
2525

26-
public ExtendedQueryCommandBaseCodec(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
26+
public ExtendedQueryMSSQLCommandBaseMessage(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
2727
super(cmd);
2828
this.ps = ps;
2929
}
3030

31-
public static <U> MSSQLCommandCodec<?, ?> create(ExtendedQueryCommand<U> queryCmd, MSSQLPreparedStatement ps) {
31+
public static <U> MSSQLCommandMessage<?, ?> create(ExtendedQueryCommand<U> queryCmd, MSSQLPreparedStatement ps) {
3232
if (queryCmd.isBatch()) {
33-
return new ExtendedBatchQueryCommandCodec<>(queryCmd, ps);
33+
return new ExtendedBatchQueryMSSQLCommandMessage<>(queryCmd, ps);
3434
} else if (queryCmd.cursorId() != null) {
35-
return new ExtendedCursorQueryCommandCodec<>(queryCmd, ps);
35+
return new ExtendedCursorQueryMSSQLCommandMessage<>(queryCmd, ps);
3636
} else {
37-
return new ExtendedQueryCommandCodec<>(queryCmd, ps);
37+
return new ExtendedQueryMSSQLCommandMessage<>(queryCmd, ps);
3838
}
3939
}
4040

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
import io.vertx.sqlclient.internal.TupleBase;
1515
import io.vertx.sqlclient.spi.protocol.ExtendedQueryCommand;
1616

17-
class ExtendedQueryCommandCodec<T> extends ExtendedQueryCommandBaseCodec<T> {
17+
class ExtendedQueryMSSQLCommandMessage<T> extends ExtendedQueryMSSQLCommandBaseMessage<T> {
1818

19-
ExtendedQueryCommandCodec(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
19+
ExtendedQueryMSSQLCommandMessage(ExtendedQueryCommand<T> cmd, MSSQLPreparedStatement ps) {
2020
super(cmd, ps);
2121
}
2222

vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/InitCommandCodec.java renamed to vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/InitMSSQLCommandMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
import static java.nio.charset.StandardCharsets.UTF_16LE;
2828
import static java.util.Locale.ENGLISH;
2929

30-
class InitCommandCodec extends MSSQLCommandCodec<Connection, InitCommand> {
30+
class InitMSSQLCommandMessage extends MSSQLCommandMessage<Connection, InitCommand> {
3131

3232
static final Object LOGIN_SENT = new Object();
3333

34-
InitCommandCodec(InitCommand cmd) {
34+
InitMSSQLCommandMessage(InitCommand cmd) {
3535
super(cmd);
3636
}
3737

vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/MSSQLCommandCodec.java renamed to vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/MSSQLCommandMessage.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,32 @@
3232
import static io.vertx.mssqlclient.impl.utils.ByteBufUtils.readUnsignedByteLengthString;
3333
import static io.vertx.mssqlclient.impl.utils.ByteBufUtils.readUnsignedShortLengthString;
3434

35-
public abstract class MSSQLCommandCodec<R, C extends CommandBase<R>> extends CommandMessage<R, C> {
35+
public abstract class MSSQLCommandMessage<R, C extends CommandBase<R>> extends CommandMessage<R, C> {
3636

3737
public TdsMessageCodec tdsMessageCodec;
3838

3939
public MSSQLException failure;
4040
public R result;
4141

42-
MSSQLCommandCodec(C cmd) {
42+
MSSQLCommandMessage(C cmd) {
4343
super(cmd);
4444
}
4545

46-
public static MSSQLCommandCodec<?, ?> wrap(CommandBase<?> cmd) {
46+
public static MSSQLCommandMessage<?, ?> wrap(CommandBase<?> cmd) {
4747
if (cmd instanceof PreLoginCommand) {
48-
return new PreLoginCommandCodec((PreLoginCommand) cmd);
48+
return new PreLoginMSSQLCommandMessage((PreLoginCommand) cmd);
4949
} else if (cmd instanceof InitCommand) {
50-
return new InitCommandCodec((InitCommand) cmd);
50+
return new InitMSSQLCommandMessage((InitCommand) cmd);
5151
} else if (cmd instanceof SimpleQueryCommand) {
52-
return new SQLBatchCommandCodec<>((SimpleQueryCommand<?>) cmd);
52+
return new SQLBatchMSSQLCommandMessage<>((SimpleQueryCommand<?>) cmd);
5353
} else if (cmd instanceof PrepareStatementCommand) {
54-
return new PrepareStatementCodec((PrepareStatementCommand) cmd);
54+
return new PrepareStatementMSSQLMessage((PrepareStatementCommand) cmd);
5555
} else if (cmd instanceof CloseStatementCommand) {
56-
return new CloseStatementCommandCodec((CloseStatementCommand) cmd);
56+
return new CloseStatementMSSQLCommandMessage((CloseStatementCommand) cmd);
5757
} else if (cmd == CloseConnectionCommand.INSTANCE) {
58-
return new CloseConnectionCommandCodec((CloseConnectionCommand) cmd);
58+
return new CloseConnectionMSSQLCommandMessage((CloseConnectionCommand) cmd);
5959
} else if (cmd instanceof CloseCursorCommand) {
60-
return new CloseCursorCommandCodec((CloseCursorCommand) cmd);
60+
return new CloseCursorMSSQLCommandMessage((CloseCursorCommand) cmd);
6161
} else {
6262
throw new UnsupportedOperationException();
6363
}

0 commit comments

Comments
 (0)