}
protected void openRemoteDatabase(final String iUserName, final String iUserPassword) throws IOException {
createConnectionPool();
final OChannelBinaryClient network = beginRequest(OChannelBinaryProtocol.REQUEST_DB_OPEN);
try {
network.writeString(name).writeString(iUserName).writeString(iUserPassword);
} finally {
endRequest(network);
}
try {
beginResponse(network);
final int sessionId = network.readInt();
setSessionId(sessionId);
OLogManager.instance().debug(null, "Client connected with session id: " + sessionId);
int tot = network.readInt();
String clusterName;
for (int i = 0; i < tot; ++i) {
clusterName = network.readString().toLowerCase();
clustersIds.put(clusterName, network.readInt());
clustersTypes.put(clusterName, network.readString());
}
// READ CLUSTER CONFIGURATION
updateClusterConfiguration(network.readBytes());
} finally {
endResponse(network);
}