Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.SecLoginlog


  /*
   * ++++++++++++++++++++++ Userlog +++++++++++++++++++++
   */

  private void dummy() {
    saveCompleteIPDataFromLookUpHost(new SecLoginlog());
  }
View Full Code Here


    // if (Executions.getCurrent().getUserAgent() != null) {
    // browserType = Executions.getCurrent().getUserAgent();
    // }

    final SecLoginlog log = this.loginLoggingService.saveLog(userName, clientAddress, sessionId, browserType, 0);
    /** For testing on a local tomcat */
    // log.setLglIp("95.111.227.104");
    saveSimpleIPDataFromTable(log);
    /**
     * For the complete geo-data use this with care about the case of a
View Full Code Here

    // if (Executions.getCurrent().getUserAgent() != null) {
    // browserType = Executions.getCurrent().getUserAgent();
    // }

    final SecLoginlog log = this.loginLoggingService.saveLog(userName, clientAddress, sessionId, browserType, 1);

    /** For testing on a local tomcat */
    // log.setLglIp("95.111.227.104");
    saveSimpleIPDataFromTable(log);
    /**
 
View Full Code Here

   */
  public LoginLoggingServiceImpl() {
  }

  public SecLoginlog getNewSecLoginlog() {
    return new SecLoginlog();
  }
View Full Code Here

@Repository
public class SecLoginlogDAOImpl extends BasisDAO<SecLoginlog> implements SecLoginlogDAO {

  @Override
  public SecLoginlog getNewSecLoginlog() {
    return new SecLoginlog();
  }
View Full Code Here

    return getHibernateTemplate().find(hqlStr);
  }

  public SecLoginlog saveLog(String userName, String clientAddress, String sessionId, String browserType, int status) {

    SecLoginlog log = getNewSecLoginlog();

    log.setLglLoginname(userName);
    log.setLglSessionid(sessionId);
    log.setBrowserType(browserType);
    log.setLglIp(clientAddress);
    log.setLglLogtime(new Date());
    log.setLglStatusid(status);
    save(log);

    return log;
  }
View Full Code Here

  }

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final SecLoginlog log = (SecLoginlog) data;

    Listcell lc;
    final LoginStatus loginStatus = getLoginLoggingService().getTypById(log.getLglStatusid());

    lc = new Listcell(getDateTime(log.getLglLogtime()));

    if (log.getLglStatusid() == 0) {
      lc.setStyle("color:red");
    }
    lc.setParent(item);

    lc = new Listcell(log.getLglLoginname());
    if (log.getLglStatusid() == 0) {
      lc.setStyle("color:red");
    }
    lc.setParent(item);

    lc = new Listcell(loginStatus.getStpTypname());
    if (log.getLglStatusid() == 0) {
      lc.setStyle("color:red");
    }
    lc.setParent(item);

    // lc = new Listcell(log.getLglIp());
    // truncate the IP for privacy
    lc = new Listcell(truncateIPForPrivacy(log.getLglIp()));
    if (log.getLglStatusid() == 0) {
      lc.setStyle("color:red");
    }
    lc.setParent(item);

    /* Country Code / Flag+Short+Provider-City */
    final String currentIp = log.getLglIp();
    final Ip2Country ip2 = log.getIp2Country();

    if (ip2 != null) {
      lc = new Listcell();
      final Hbox hbox = new Hbox();
      hbox.setParent(lc);

      // Fill with the related data for CountryCode
      final CountryCode cc = ip2.getCountryCode();
      if (cc != null) {
        /* Flag-image */
        final Image img = new Image();
        final String path = "/images/countrycode_flags/";
        final String flag = StringUtils.lowerCase(cc.getCcdCode2()) + ".gif";
        img.setSrc(path + flag);
        hbox.appendChild(img);

        final Separator sep = new Separator();
        hbox.appendChild(sep);

        /* Country */
        final Label label = new Label();
        label.setValue(cc.getCcdCode2());
        hbox.appendChild(label);

        // show other stuff from the Ip2Country
        /* Provider-City */
        final Label label2 = new Label();
        if (StringUtils.isNotBlank(ip2.getI2cCity())) {
          label2.setValue("(" + ip2.getI2cCity() + ")");
        } else {
          label2.setValue("");
        }

        hbox.appendChild(label2);
      }

      lc.setParent(item);

    } else {
      lc = new Listcell();
      final Hbox hbox = new Hbox();
      hbox.setParent(lc);

      /* Flag-image */
      final Image img = new Image();
      final String path = "/images/countrycode_flags/";
      final String flag = "xx.gif";
      img.setSrc(path + flag);
      hbox.appendChild(img);
      final Label label = new Label();
      label.setValue("Unknown");
      hbox.appendChild(label);

      lc.setParent(item);

    }

    /* Session-ID */
    lc = new Listcell(log.getLglSessionid());
    if (log.getLglStatusid() == 0) {
      lc.setStyle("color:red");
    }
    lc.setParent(item);

    item.setAttribute("data", data);
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.SecLoginlog

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.