コード例 #1
0
  /**
   * Build DN string for sector identifier
   *
   * @param inum Sector Identifier Inum
   * @return DN string for specified sector identifier or DN for sector identifiers branch if inum
   *     is null
   * @throws Exception
   */
  public String getDnForSectorIdentifier(String inum) {
    String sectorIdentifierDn = staticConfiguration.getBaseDn().getSectorIdentifiers();
    if (StringHelper.isEmpty(inum)) {
      return sectorIdentifierDn;
    }

    return String.format("inum=%s,%s", inum, sectorIdentifierDn);
  }
コード例 #2
0
 @Override
 public ResourceSetPermission getResourceSetPermissionByTicket(String p_ticket) {
   try {
     final String baseDn = staticConfiguration.getBaseDn().getClients();
     final Filter filter = Filter.create(String.format("&(oxTicket=%s)", p_ticket));
     final List<ResourceSetPermission> entries =
         ldapEntryManager.findEntries(baseDn, ResourceSetPermission.class, filter);
     if (entries != null && !entries.isEmpty()) {
       return entries.get(0);
     }
   } catch (Exception e) {
     LOG.trace(e.getMessage(), e);
   }
   return null;
 }