private void createConnection(long connectorId) throws IOException {
printlnResource(Constants.RES_CREATE_CREATING_CONN, connectorId);
ConsoleReader reader = new ConsoleReader();
MConnection connection = client.newConnection(connectorId);
ResourceBundle connectorBundle = client.getResourceBundle(connectorId);
ResourceBundle frameworkBundle = client.getFrameworkResourceBundle();
Status status = Status.FINE;
printlnResource(Constants.RES_PROMPT_FILL_CONN_METADATA);
do {
// Print error introduction if needed
if( !status.canProceed() ) {
errorIntroduction();
}
// Fill in data from user
if(!fillConnection(reader, connection, connectorBundle, frameworkBundle)) {
return;
}
// Try to create
status = client.createConnection(connection);
} while(!status.canProceed());
FormDisplayer.displayFormWarning(connection);
printlnResource(Constants.RES_CREATE_CONN_SUCCESSFUL, status.name(), connection.getPersistenceId());
}