Package com.esri.gpt.framework.collection

Examples of com.esri.gpt.framework.collection.StringSet


    LdapQueryFunctions queryFunctions = new LdapQueryFunctions(getConfiguration());
    LdapUserProperties userProps = getConfiguration().getUserProperties();
    boolean bMultipleFound = false;
    String sBaseDN = userProps.getUserSearchDIT();
    String sFilter = userProps.returnUserLoginSearchFilter(username);
    StringSet ssDNs = queryFunctions.searchDNs(dirContext,sBaseDN,sFilter);

    // loop through each DN found, check for an email address match
    for (String sDN: ssDNs) {
      User userTmp = new User();
      userTmp.setDistinguishedName(sDN);
View Full Code Here


    sName = reference.getReferenceName();
  }

  // add the reference
  if ((sName.length() > 0) && (findByTag(sName) == null)) {
    StringSet tags = reference.getTags();
    tags.add(sName);
    if (reference.getIsJndiBased()) {
      tags.add(reference.getJndiName());
    }

    // remove tags that have already been referenced
    Iterator<String> it = _hmReferencesByTagName.keySet().iterator();
    while (it.hasNext()) {
      tags.remove(it.next());
    }

    // store new references and tags
    int nTags = tags.size();
    if (nTags > 0) {
      _hmReferencesByName.put(sName.toLowerCase(),reference);
      for (String sTag: tags) {
        _hmReferencesByTagName.put(sTag.toLowerCase(),reference);
      }
View Full Code Here

*           the search exception
*/
public HrRecord readHarvestRecord(String rid, RequestContext context)
    throws SearchException {
 
  StringSet ridSet = new StringSet();
  ridSet.add(rid);
  Map<String, HrRecord> mapHrRecord = this.readHarvestRecords(ridSet, context);
  if(mapHrRecord.size() < 1 || mapHrRecord.get(rid) == null) {
    throw new SearchException("Could not get record from db with rid = " + rid);
  }
  return mapHrRecord.get(rid);
View Full Code Here

*/
protected StringSet readAttribute(DirContext dirContext,
                                  String objectDN,
                                  String attrubuteName)
  throws NamingException {
  StringSet values = new StringSet();
  try{   
    if ((objectDN.length() > 0) && (attrubuteName.length() > 0)) {
      String[] aReturn = new String[1];
      aReturn[0] = attrubuteName;
      try{
View Full Code Here

* @throws NamingException if an exception occurs
*/
protected StringSet readGroupMembers(DirContext dirContext,
                                     String groupDN)
  throws NamingException {
  StringSet members = new StringSet();
  groupDN = Val.chkStr(groupDN);
  String sDynamic = getConfiguration().getGroupProperties().getGroupDynamicMembersAttribute();
  if (groupDN.length() > 0) {
    if (sDynamic.length() > 0) {
      members = readAttribute(dirContext,groupDN,sDynamic);
View Full Code Here

  String sDisplayName = userDN;
  String sDisplayAttr = getConfiguration().getUserProperties().getUserDisplayNameAttribute();

  if ((userDN.length() > 0) && (sDisplayAttr.length() > 0)) {
    //try {
      StringSet ss = readAttribute(dirContext,userDN,sDisplayAttr);
      if (ss.size() > 0) {
        sDisplayName = ss.iterator().next();
      }
    //} catch (Exception e) {
    //  sDisplayName = userDN;
      //System.err.println("Error reading user display name for distinguished name: "+userDN);
      //e.printStackTrace(System.err);
View Full Code Here

      }
     
    } else {
     
      // read group membership based upon a dynamic attribute
      StringSet groupDNs = readAttribute(dirContext,sUserDN,sDynamicAttribute);
      for (String sDN: groupDNs) {
        sDN = sDN.toLowerCase();
        if (sDN.length() > 0) {
          String sName = "";
          if (sNameAttribute.length() > 0) {
            StringSet ss = readAttribute(dirContext,sDN,sNameAttribute);
            if (ss.size() > 0) {
              sName = ss.iterator().next();
            }
          }
          Group group = new Group(sDN);
          group.setDistinguishedName(sDN);
          group.setName(sName);
View Full Code Here

  LdapNameMapping nameMap =  getConfiguration().getUserProperties().getUserProfileMapping();
  String sAttrName = nameMap.findLdapName(UserAttributeMap.TAG_USER_NAME);
  if (sAttrName.length() == 0) sAttrName = "cn";
  if ((userDN.length() > 0) && (sAttrName.length() > 0)) {
    //try {
      StringSet ss = readAttribute(dirContext,userDN,sAttrName);
      if (ss.size() > 0) {
        sName = ss.iterator().next();
      } else if (!sAttrName.equals("cn")) {
        ss = readAttribute(dirContext,userDN,"cn");
        if (ss.size() > 0) {
          sName = ss.iterator().next();
        }
      }
    //} catch (Exception e) {
    //  sName = userDN;
      //System.err.println("Error reading username for distinguished name: "+userDN);
View Full Code Here

*/
protected StringSet searchDNs(DirContext dirContext,
                              String baseDN,
                              String filter)
  throws NamingException {
  StringSet names = new StringSet(false,false,true);
  NamingEnumeration<SearchResult> enSearch = null;
  try {
    baseDN = Val.chkStr(baseDN);
    filter = Val.chkStr(filter);
    if (filter.length() > 0) {
      SearchControls controls = new SearchControls();
      controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
      enSearch = dirContext.search(baseDN,filter,controls);
      try {
        while (enSearch.hasMore()) {
          SearchResult result = (SearchResult)enSearch.next();
          names.add(buildFullDN(result.getName(),baseDN));
        }
      } catch (PartialResultException pre) {
        LogUtil.getLogger().finer(pre.toString());
      } catch (LimitExceededException lee) {
          LogUtil.getLogger().finer(lee.toString());
View Full Code Here

 
//constructors ================================================================

/** Default constructor. */
public MailRequest() {
  setRecipients(new StringSet());
}
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.collection.StringSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.