if (provider.getName().getString(Locale.getDefault()).equals(domainProviderName)) {
domainProviderId = provider.getId();
}
}
// get the connector which should be created
ConnectorProvider connectorProvider =
getConnectorToCreate(domainProviderId, attributes.get(ServiceCommands.CONNECTOR_TYPE));
String id;
if (attributes.isEmpty() || !attributes.containsKey(org.osgi.framework.Constants.SERVICE_PID)) {
OutputStreamFormater.printValue("Please enter an ID");
id = readUserInput();
} else {
id = attributes.get(org.osgi.framework.Constants.SERVICE_PID);
}
ServiceDescriptor descriptor = connectorProvider.getDescriptor();
OutputStreamFormater.printValue(String.format("Please enter the attributes for %s, keep empty for default",
descriptor.getName().getString(Locale.getDefault())));
// get attributes for connector
Map<String, String> attributeMap = getConnectorAttributes(descriptor.getAttributes(), attributes);
Map<String, Object> properties = new HashMap<String, Object>();
ConnectorDescription connectorDescription =
new ConnectorDescription(domainProviderId, connectorProvider.getId(), attributeMap, properties);
if (force) {
if (id != null && !id.isEmpty()) {
serviceManager.forceCreateWithId(id, connectorDescription);
} else {
serviceManager.forceCreate(connectorDescription);