return connInstance;
}
public ConnInstance updateConnInstance(final long connInstanceId, final ConnInstanceTO connInstanceTO) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
if (connInstanceId == 0) {
sce.getElements().add("connector id");
}
ConnInstance connInstance = connInstanceDAO.find(connInstanceId);
connInstance.setCapabilities(connInstanceTO.getCapabilities());
if (connInstanceTO.getLocation() != null) {
connInstance.setLocation(connInstanceTO.getLocation());
}
if (connInstanceTO.getBundleName() != null) {
connInstance.setBundleName(connInstanceTO.getBundleName());
}
if (connInstanceTO.getVersion() != null) {
connInstance.setVersion(connInstanceTO.getVersion());
}
if (connInstanceTO.getConnectorName() != null) {
connInstance.setConnectorName(connInstanceTO.getConnectorName());
}
if (connInstanceTO.getConfiguration() != null && !connInstanceTO.getConfiguration().isEmpty()) {
connInstance.setConfiguration(connInstanceTO.getConfiguration());
}
if (connInstanceTO.getDisplayName() != null) {
connInstance.setDisplayName(connInstanceTO.getDisplayName());
}
if (connInstanceTO.getConnRequestTimeout() != null) {
connInstance.setConnRequestTimeout(connInstanceTO.getConnRequestTimeout());
}
if (connInstanceTO.getPoolConf() == null) {
connInstance.setPoolConf(null);
} else {
connInstance.setPoolConf(ConnPoolConfUtil.getConnPoolConf(connInstanceTO.getPoolConf()));
}
if (!sce.isEmpty()) {
throw sce;
}
return connInstance;
}