info.put("param1", "value1"); info.put("param2", "value2"); requests.add(new OpenConnectionRequest("connectionId", info)); requests.add(new CloseConnectionRequest("connectionId")); requests.add(
new OpenConnectionRequest(connectionId, new HashMap<String, String>()), new OpenConnectionResponse());
new OpenConnectionRequest(connectionId, new HashMap<String, String>()), new OpenConnectionResponse());
new OpenConnectionRequest(connectionId, new HashMap<String, String>()), new OpenConnectionResponse());
info.put("param1", "value1"); info.put("param2", "value2"); requests.add(new OpenConnectionRequest("connectionId", info)); requests.add(new CloseConnectionRequest("connectionId")); requests.add(
info.put("param1", "value1"); info.put("param2", "value2"); requests.add(new OpenConnectionRequest("connectionId", info)); requests.add(new CloseConnectionRequest("connectionId")); requests.add(
private static List<Request> getRequestsWithNulls() { LinkedList<Request> requests = new LinkedList<>(); // We're pretty fast and loose on what can be null. requests.add(new SchemasRequest(null, null, null)); // Repeated fields default to an empty list requests.add(new TablesRequest(null, null, null, null, Collections.<String>emptyList())); requests.add(new ColumnsRequest(null, null, null, null, null)); requests.add(new PrepareAndExecuteRequest(null, 0, null, 0)); requests.add(new PrepareRequest(null, null, 0)); requests.add(new CreateStatementRequest(null)); requests.add(new CloseStatementRequest(null, 0)); requests.add(new OpenConnectionRequest(null, null)); requests.add(new CloseConnectionRequest(null)); requests.add(new ConnectionSyncRequest(null, null)); return requests; }
private static List<Request> getRequestsWithNulls() { LinkedList<Request> requests = new LinkedList<>(); // We're pretty fast and loose on what can be null. requests.add(new SchemasRequest(null, null, null)); // Repeated fields default to an empty list requests.add(new TablesRequest(null, null, null, null, Collections.<String>emptyList())); requests.add(new ColumnsRequest(null, null, null, null, null)); requests.add(new PrepareAndExecuteRequest(null, 0, null, 0)); requests.add(new PrepareRequest(null, null, 0)); requests.add(new CreateStatementRequest(null)); requests.add(new CloseStatementRequest(null, 0)); requests.add(new OpenConnectionRequest(null, null)); requests.add(new CloseConnectionRequest(null)); requests.add(new ConnectionSyncRequest(null, null)); return requests; }
@Override public Connection connect(String url, Properties info) throws SQLException { AvaticaConnection conn = (AvaticaConnection) super.connect(url, info); if (conn == null) { // It's not an url for our driver return null; } Service service = conn.getService(); // super.connect(...) should be creating a service and setting it in the AvaticaConnection assert null != service; service.apply( new Service.OpenConnectionRequest(conn.id, Service.OpenConnectionRequest.serializeProperties(info))); return conn; }
@Override public Connection connect(String url, Properties info) throws SQLException { AvaticaConnection conn = (AvaticaConnection) super.connect(url, info); if (conn == null) { // It's not an url for our driver return null; } // Create the corresponding remote connection ConnectionConfig config = conn.config(); Service service = createService(conn, config); service.apply( new Service.OpenConnectionRequest(conn.id, Service.OpenConnectionRequest.serializeProperties(info))); return conn; }
@Override public Connection connect(String url, Properties info) throws SQLException { AvaticaConnection conn = (AvaticaConnection) super.connect(url, info); if (conn == null) { // It's not an url for our driver return null; } Service service = conn.getService(); // super.connect(...) should be creating a service and setting it in the AvaticaConnection assert null != service; service.apply( new Service.OpenConnectionRequest(conn.id, Service.OpenConnectionRequest.serializeProperties(info))); return conn; }
private static List<Request> getRequestsWithNulls() { LinkedList<Request> requests = new LinkedList<>(); // We're pretty fast and loose on what can be null. requests.add(new SchemasRequest(null, null, null)); // Repeated fields default to an empty list requests.add(new TablesRequest(null, null, null, null, Collections.<String>emptyList())); requests.add(new ColumnsRequest(null, null, null, null, null)); requests.add(new PrepareAndExecuteRequest(null, 0, null, 0)); requests.add(new PrepareRequest(null, null, 0)); requests.add(new CreateStatementRequest(null)); requests.add(new CloseStatementRequest(null, 0)); requests.add(new OpenConnectionRequest(null, null)); requests.add(new CloseConnectionRequest(null)); requests.add(new ConnectionSyncRequest(null, null)); return requests; }
@Override Request deserialize(Message genericMsg) { final Requests.OpenConnectionRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.OpenConnectionRequest.class); final Descriptor desc = msg.getDescriptorForType(); String connectionId = null; if (ProtobufService.hasField(msg, desc, Requests.OpenConnectionRequest.CONNECTION_ID_FIELD_NUMBER)) { connectionId = msg.getConnectionId(); } Map<String, String> info = msg.getInfo(); if (info.isEmpty()) { info = null; } return new OpenConnectionRequest(connectionId, info); }
public Void call() { final Service.OpenConnectionResponse response = service.apply(new Service.OpenConnectionRequest(ch.id, info)); return null; } });
/** * Opens the connection on the server. */ public void openConnection() { // Open the connection on the server this.meta.openConnection(handle, OpenConnectionRequest.serializeProperties(info)); }
/** * Opens the connection on the server. */ public void openConnection() { // Open the connection on the server this.meta.openConnection(handle, OpenConnectionRequest.serializeProperties(info)); }
@Override Request deserialize(Message genericMsg) { final Requests.OpenConnectionRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.OpenConnectionRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } Map<String, String> info = msg.getInfoMap(); if (info.isEmpty()) { info = null; } return new OpenConnectionRequest(connectionId, info); }
public Void call() { final Service.OpenConnectionResponse response = service.apply(new Service.OpenConnectionRequest(ch.id, info)); return null; } });
/** * Opens the connection on the server. */ public void openConnection() { // Open the connection on the server this.meta.openConnection(handle, OpenConnectionRequest.serializeProperties(info)); }