Example #1
0
 /**
  * Obtains an instance from a security, locking by strong object identifier if possible and the
  * external identifier bundle if not. The result will contain the resolved target and one type of
  * reference.
  *
  * @param security the security to store, not null
  * @return the link with target and object identifier set, not null
  */
 public static ManageableSecurityLink of(Security security) {
   ArgumentChecker.notNull(security, "security");
   ManageableSecurityLink link = new ManageableSecurityLink();
   link.setAndLockTarget(security);
   if (link.getObjectId() == null) {
     link.setExternalId(security.getExternalIdBundle());
   }
   return link;
 }