static Subject getOwner(DataSource ds, String name) { try { KeyValueDAO dao = new KeyValueDAO(ds, null, "tap_schema"); String key = name + ".owner"; KeyValue kv = dao.get(key); if (kv == null || kv.value == null) { return null; } IdentityManager im = AuthenticationUtil.getIdentityManager(); if (im == null) { throw new RuntimeException("CONFIG: no IdentityManager implementation available"); } Subject s = im.toSubject(kv.value); log.debug("object: " + name + " owner: " + s); return s; } catch (RuntimeException rethrow) { throw rethrow; } catch (Exception ex) { throw new RuntimeException("CONFIG: failed to find owner for object " + name, ex); } }
Subject s = identManager.toSubject(ret.appData); ret.setOwnerID(identManager.toOwnerString(s));