use of org.mongodb.meclipse.preferences.MongoInstance in project meclipse by flaper87.
the class ConnectionWizardPage method checkDuplicateConnection.
public IStatus checkDuplicateConnection(String hostname, int port) {
Iterator<String> it = mongoInstances.iterator();
while (it.hasNext()) {
String cur = it.next();
MongoInstance instance = MeclipsePlugin.getDefault().getMongoInstance(cur);
if (instance.getPort() == port && instance.getHost().equals(hostname)) {
return ValidationStatus.warning(String.format(getCaption("connectionWizard.warn.duplicate"), cur));
}
}
return ValidationStatus.ok();
}
Aggregations