public ResourceUpgradeReport upgrade(ResourceUpgradeContext<PostgresServerComponent<?>> inventoriedResource) {
String currentResourceKey = inventoriedResource.getResourceKey();
if (!currentResourceKey.startsWith(OID_PREFIX)) {
// currentResourceKey is the user name
ResourceUpgradeReport report = new ResourceUpgradeReport();
try {
long userOid = getUserOid(currentResourceKey, inventoriedResource.getParentResourceComponent()
.getPooledConnectionProvider());
if (userOid == -1) {
LOG.warn("Could not find oid of user [" + currentResourceKey + "]");
return null;
}
report.setNewResourceKey(createResourceKey(userOid));
return report;
} catch (SQLException e) {
LOG.warn("Exception thrown while searching oid of user [" + currentResourceKey + "]", e);
}
}