Package org.apache.openmeetings.db.entity.server

Examples of org.apache.openmeetings.db.entity.server.Sessiondata


      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

      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

        log.error("Could not find session to update: " + SID);
        return false;
      } else {
        // log.error("Found session to update: "+SID);
      }
      Sessiondata sd = fullList.get(0);
      sd.setRefresh_time(new Date());
      sd.setSessionXml(sessionXml);

      if (sd.getId() == null) {
        em.persist(sd);
      } else {
        if (!em.contains(sd)) {
          em.merge(sd);
        }
View Full Code Here

      if (fullList.size() == 0) {
        log.error("Found NO session to updateSession: ");

      } else {
        // log.debug("Found session to updateSession: ");
        Sessiondata sd = fullList.iterator().next();
        // log.debug("Found session to updateSession sd "+sd.getUser_id()+" "+sd.getSession_id());
        sd.setRefresh_time(new Date());

        if (sd.getId() == null) {
          em.persist(sd);
        } else {
          if (!em.contains(sd)) {
            em.merge(sd);
          }
View Full Code Here

      Calendar rightNow = Calendar.getInstance();
      rightNow.setTimeInMillis(rightNow.getTimeInMillis() - 1800000);
      List<Sessiondata> l = this.getSessionToDelete(rightNow.getTime());
      log.debug("clearSessionTable: " + l.size());
      for (Iterator<Sessiondata> it = l.iterator(); it.hasNext();) {
        Sessiondata sData = it.next();
        sData = em.find(Sessiondata.class, sData.getId());
        em.remove(sData);
      }
    } catch (Exception err) {
      log.error("clearSessionTable", err);
    }
View Full Code Here

        int end_pos = init_pos + 32;
        if (end_pos > aux.length())
          end_pos = aux.length();
        String SID = aux.substring(init_pos, end_pos);

        Sessiondata sData = this.getSessionByHash(SID);

        sData = em.find(Sessiondata.class, sData.getId());
        em.remove(sData);
      }

    } catch (Exception err) {
      log.error("clearSessionByRoomId", err);
View Full Code Here

  @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

    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

TOP

Related Classes of org.apache.openmeetings.db.entity.server.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.