Search in sources :

Example 6 with MongoInstance

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();
}
Also used : MongoInstance(org.mongodb.meclipse.preferences.MongoInstance)

Aggregations

MongoInstance (org.mongodb.meclipse.preferences.MongoInstance)6 File (java.io.File)2 IOException (java.io.IOException)2 IPath (org.eclipse.core.runtime.IPath)2 CsvReader (com.csvreader.CsvReader)1 CsvWriter (com.csvreader.CsvWriter)1 Mongo (com.mongodb.Mongo)1 MongoException (com.mongodb.MongoException)1 BufferedReader (java.io.BufferedReader)1 FileReader (java.io.FileReader)1 FileWriter (java.io.FileWriter)1 UnknownHostException (java.net.UnknownHostException)1 ArrayList (java.util.ArrayList)1