Package org.openmeetings.app.persistence.beans.basic

Examples of org.openmeetings.app.persistence.beans.basic.LdapConfig


   
    Element ldapconfigs = root.addElement("ldapconfigs");

    for (Iterator<LdapConfig> it = ldapConfigList.iterator();it.hasNext();) {
     
      LdapConfig ldapC = it.next();

      Element ldapconfig = ldapconfigs.addElement("ldapconfig");
     
      ldapconfig.addElement("name").addCDATA(formatString(""+ldapC.getName()));
      ldapconfig.addElement("configFileName").addCDATA(formatString(""+ldapC.getConfigFileName()));
      ldapconfig.addElement("addDomainToUserName").addCDATA(formatString(""+ldapC.getAddDomainToUserName()));
      ldapconfig.addElement("domain").addCDATA(formatString(""+ldapC.getDomain()));
      ldapconfig.addElement("isActive").addCDATA(formatString(""+ldapC.getIsActive()));

    }

    return document;
  }
View Full Code Here


                Boolean addDomainToUserName = importBooleanType(unformatString(ldapconfigObject.element("addDomainToUserName").getText()));
                String domain = unformatString(ldapconfigObject.element("domain").getText());
                Boolean isActive = importBooleanType(unformatString(ldapconfigObject.element("isActive").getText()));
               
               
                LdapConfig ldapConfig = new LdapConfig();
                ldapConfig.setName(name);
                ldapConfig.setConfigFileName(configFileName);
                ldapConfig.setAddDomainToUserName(addDomainToUserName);
                ldapConfig.setDomain(domain);
                ldapConfig.setIsActive(isActive);
               
                ldapConfigsList.add(ldapConfig);
               
              }
             
View Full Code Here

   */
   public boolean getLdapPwdSynchStatus(Long ldapConfigId){ //TIBO
      // Retrieve Configuration Data
      HashMap<String, String> configData;
     
      LdapConfig ldapConfig = LdapConfigDaoImpl.getInstance().getLdapConfigById(ldapConfigId);
     
      try{
        configData= getLdapConfigData(ldapConfig.getConfigFileName());
      }catch(Exception e){
        log.error("Error on getLdapPwdSynchStatus : " + e.getMessage());
        return true;
      }
     
View Full Code Here

        currentClient = this.clientListManager
            .getClientByStreamId(current.getClient().getId());

        // LDAP Loggedin Users cannot use the permanent Login Flag

        LdapConfig ldapConfig = LdapConfigDaoImpl.getInstance()
            .getLdapConfigById(ldapConfigId);

        String ldapLogin = usernameOrEmail;
        if (ldapConfig.getAddDomainToUserName() != null
            && ldapConfig.getAddDomainToUserName()) {
          ldapLogin = usernameOrEmail + "@" + ldapConfig.getDomain();
        }

        o = LdapLoginManagement.getInstance().doLdapLogin(ldapLogin,
            Userpass, currentClient, SID,
            ldapConfig.getConfigFileName());
      } else {

        currentClient = this.clientListManager
            .getClientByStreamId(current.getClient().getId());
View Full Code Here

  public List<LdapConfig> getActiveLdapConfigs() {
    try {
      List<LdapConfig> ldapConfigs = this.ldapConfigDaoImpl.getActiveLdapConfigs();
     
      //Add localhost Domain
      LdapConfig ldapConfig = new LdapConfig();
     
      ldapConfig.setName("local DB [internal]");
      ldapConfig.setLdapConfigId(-1);
     
      List<LdapConfig> returnldapConfigs = new LinkedList<LdapConfig>();
      returnldapConfigs.add(ldapConfig);
     
      for (LdapConfig ldapConfigStored : ldapConfigs) {
View Full Code Here

 
  public Long addLdapConfig(String name, Boolean addDomainToUserName, String configFileName,
      String domain, Long insertedby, Boolean isActive) {
    try {
     
      LdapConfig ldapConfig = new LdapConfig();
      ldapConfig.setAddDomainToUserName(addDomainToUserName);
      ldapConfig.setConfigFileName(configFileName);
      ldapConfig.setDeleted("false");
      ldapConfig.setDomain(domain);
      ldapConfig.setIsActive(isActive);
      ldapConfig.setName(name);
      ldapConfig.setInserted(new Date());
      if (insertedby != null) {
        log.debug("addLdapConfig :1: "+UsersDaoImpl.getInstance().getUser(insertedby));
        ldapConfig.setInsertedby(UsersDaoImpl.getInstance().getUser(insertedby));
      }
     
      log.debug("addLdapConfig :2: "+insertedby);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
 
      ldapConfig = session.merge(ldapConfig);
      Long ldapConfigId = ldapConfig.getLdapConfigId();
 
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      if (ldapConfigId > 0) {
View Full Code Here

 
  public Long updateLdapConfig(Long ldapConfigId, String name, Boolean addDomainToUserName,
      String configFileName, String domain, Long updatedby, Boolean isActive) {
    try {
     
      LdapConfig ldapConfig = this.getLdapConfigById(ldapConfigId);
     
      if (ldapConfig == null) {
        return -1L;
      }
     
      ldapConfig.setAddDomainToUserName(addDomainToUserName);
      ldapConfig.setConfigFileName(configFileName);
      ldapConfig.setDeleted("false");
      ldapConfig.setDomain(domain);
      ldapConfig.setIsActive(isActive);
      ldapConfig.setName(name);
      ldapConfig.setUpdated(new Date());
      if (updatedby != null) {
        log.debug("updateLdapConfig :1: "+UsersDaoImpl.getInstance().getUser(updatedby));
        ldapConfig.setUpdatedby(UsersDaoImpl.getInstance().getUser(updatedby));
      }
     
      log.debug("updateLdapConfig :2: "+updatedby);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
 
      ldapConfig = session.merge(ldapConfig);
      ldapConfigId = ldapConfig.getLdapConfigId();
 
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return ldapConfigId;
View Full Code Here

 
      Query query = session.createQuery(hql);
      query.setParameter("ldapConfigId", ldapConfigId);
      query.setParameter("deleted", "false");
 
      LdapConfig ldapConfig = null;
      try {
        ldapConfig = (LdapConfig) query.getSingleResult();
        } catch (NoResultException ex) {
        }
     
View Full Code Here

 
 
  public Long deleteLdapConfigById(Long ldapConfigId) {
    try {
     
      LdapConfig ldapConfig = this.getLdapConfigById(ldapConfigId);
     
      if (ldapConfig == null) {
        return null;
      }
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
 
      ldapConfig = session.find(LdapConfig.class, ldapConfig.getLdapConfigId());
      session.remove(ldapConfig);
 
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
View Full Code Here

  public List<LdapConfig> getActiveLdapConfigs() {
    try {
      List<LdapConfig> ldapConfigs = this.ldapConfigDaoImpl.getActiveLdapConfigs();
     
      //Add localhost Domain
      LdapConfig ldapConfig = new LdapConfig();
     
      ldapConfig.setName("local DB [internal]");
      ldapConfig.setLdapConfigId(-1);
     
      List<LdapConfig> returnldapConfigs = new LinkedList<LdapConfig>();
      returnldapConfigs.add(ldapConfig);
     
      for (LdapConfig ldapConfigStored : ldapConfigs) {
View Full Code Here

TOP

Related Classes of org.openmeetings.app.persistence.beans.basic.LdapConfig

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.