Package org.apache.openmeetings.persistence.beans.basic

Examples of org.apache.openmeetings.persistence.beans.basic.Sessiondata


  @Autowired
  private UserManager userManager;

  @Test
  public void testTestLogin(){
    Sessiondata sessionData = mService.getsessiondata();
   
    User us = (User) userManager.loginUser(sessionData.getSession_id(), username, userpass, null, null, false);
   
    assertNotNull("User is unable to login", us);
   
    //mService.getLanguageById(1);
   
View Full Code Here


  @Autowired
  private MainService mService;

  @Test
  public void testTestAuth() {
    Sessiondata sessionData = mService.getsessiondata();

    System.out.println("sessionData: " + sessionData.getSession_id());

    String tTemp = manageCryptStyle.getInstanceOfCrypt().createPassPhrase(
        "test");

    System.out.println("tTemp: " + tTemp);
View Full Code Here

  public boolean isSignedIn() {
    return (userId > -1);
  }

  public boolean signIn(String login, String password) {
    Sessiondata sessData = Application.getBean(SessiondataDao.class).startsession();
    SID = sessData.getSession_id();
    Object u = Application.getBean(UserManager.class).loginUser(SID, login, password,
        null, null, false);
   
    if (u instanceof User) {
      User user = (User)u;
View Full Code Here

    try {

      log.debug("startsession :: startsession");

      long thistime = new Date().getTime();
      Sessiondata sessiondata = new Sessiondata();
      sessiondata.setSession_id(manageCryptStyle.getInstanceOfCrypt()
          .createPassPhrase(String.valueOf(thistime).toString()));
      sessiondata.setRefresh_time(new Date());
      sessiondata.setStarttermin_time(new Date());
      sessiondata.setUser_id(null);

      sessiondata = em.merge(sessiondata);

      return sessiondata;
    } catch (Exception ex2) {
View Full Code Here

      if (fullList.size() == 0) {
        log.error("Could not find session to update: " + SID);
        return null;
      }

      Sessiondata sd = fullList.get(0);

      return sd;
    } catch (Exception ex2) {
      log.error("[updateUser]: ", ex2);
    }
View Full Code Here

    try {
      TypedQuery<Sessiondata> query = em.createNamedQuery("getSessionById", Sessiondata.class);
      query.setParameter("session_id", SID);
      List<Sessiondata> sessions = query.getResultList();

      Sessiondata sessiondata = null;
      if (sessions != null && sessions.size() > 0) {
        sessiondata = sessions.get(0);
      }

      // Update the Session Object
      if (sessiondata != null)
        updatesession(SID);

      // Checks if wether the Session or the User Object of that Session
      // is set yet
      if (sessiondata == null || sessiondata.getUser_id() == null
          || sessiondata.getUser_id().equals(new Long(0))) {
        return new Long(0);
      } else {
        return sessiondata.getUser_id();
      }
    } catch (Exception ex2) {
      log.error("[checkSession]: ", ex2);
    }
    return null;
View Full Code Here

      TypedQuery<Sessiondata> query = em.createNamedQuery("getSessionById", Sessiondata.class);
      query.setParameter("session_id", SID);

      List<Sessiondata> sessions = query.getResultList();

      Sessiondata sessiondata = null;
      if (sessions != null && sessions.size() > 0) {
        sessiondata = sessions.get(0);
      }

      if (sessiondata == null) {
        log.error("Could not find session to Update");
        return false;
      }
      log.debug("Found session to update: " + sessiondata.getSession_id()
          + " userId: " + USER_ID);

      sessiondata.setRefresh_time(new Date());
      sessiondata.setUser_id(USER_ID);
      if (sessiondata.getId() == null) {
        em.persist(sessiondata);
      } else {
        if (!em.contains(sessiondata)) {
          em.merge(sessiondata);
        }
View Full Code Here

  }

  public User loginUserByRemoteHash(String SID, String remoteHash) {
    try {

      Sessiondata sessionData = sessiondataDao
          .getSessionByHash(remoteHash);

      if (sessionData != null) {

        User u = getUserById(sessionData.getUser_id());

        sessiondataDao.updateUserWithoutSession(SID, u.getUser_id());

        return u;
      }
View Full Code Here

      TypedQuery<Sessiondata> query = em.createNamedQuery("getSessionById", Sessiondata.class);
      query.setParameter("session_id", SID);

      List<Sessiondata> sessions = query.getResultList();

      Sessiondata sessiondata = null;
      if (sessions != null && sessions.size() > 0) {
        sessiondata = sessions.get(0);
      }

      if (sessiondata == null) {
        log.error("Could not find session to Update");
        return false;
      }
      log.debug("Found session to update: " + sessiondata.getSession_id()
          + " userId: " + USER_ID);

      sessiondata.setRefresh_time(new Date());
      sessiondata.setUser_id(USER_ID);
      if (storePermanent) {
        sessiondata.setStorePermanent(storePermanent);
      }
      sessiondata.setLanguage_id(language_id);
      if (sessiondata.getId() == null) {
        em.persist(sessiondata);
      } else {
        if (!em.contains(sessiondata)) {
          em.merge(sessiondata);
        }
View Full Code Here

      TypedQuery<Sessiondata> query = em.createNamedQuery("getSessionById", Sessiondata.class);
      query.setParameter("session_id", SID);

      List<Sessiondata> sessions = query.getResultList();

      Sessiondata sessiondata = null;
      if (sessions != null && sessions.size() > 0) {
        sessiondata = sessions.get(0);
      }

      if (sessiondata == null) {
        log.error("Could not find session to Update");
        return false;
      }
      log.debug("Found session to update: " + sessiondata.getSession_id()
          + " organisation_id: " + organization_id);

      sessiondata.setRefresh_time(new Date());
      sessiondata.setOrganization_id(organization_id);
      if (sessiondata.getId() == null) {
        em.persist(sessiondata);
      } else {
        if (!em.contains(sessiondata)) {
          em.merge(sessiondata);
        }
View Full Code Here

TOP

Related Classes of org.apache.openmeetings.persistence.beans.basic.Sessiondata

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.