Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract messages of unsupported exception as constants #3887

Merged
merged 7 commits into from
Jul 16, 2024
22 changes: 12 additions & 10 deletions src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
public class MultiClusterTransaction extends TransactionBase {

private static final Builder<?> NO_OP_BUILDER = BuilderFactory.RAW_OBJECT;

private static final String GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE = "Graph commands are not supported.";

private final CircuitBreakerFailoverConnectionProvider failoverProvider;
private final AtomicInteger extraCommandCount = new AtomicInteger();
Expand Down Expand Up @@ -213,52 +215,52 @@ public final String discard() {
// RedisGraph commands
@Override
public Response<ResultSet> graphQuery(String name, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<String> graphDelete(String name) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<List<String>> graphProfile(String graphName, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}
// RedisGraph commands
}
Loading