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

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


  @Autowired
  private MainService mService;

  @Test
  public void testTestLogin(){
    Sessiondata sessionData = mService.getsessiondata();
   
    Users us = (Users) mService.loginUser(sessionData.getSession_id(), username, userpass, false, null, -1L);
   
    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 Users loginUserByRemoteHash(String SID, String remoteHash) {
    try {

      Sessiondata sessionData = sessionManagement
          .getSessionByHash(remoteHash);

      if (sessionData != null) {

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

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

        return u;
      }
View Full Code Here

      Long users_id = sessionManagement.checkSession(SID);
      Long user_level = userManagement.getUserLevelByID(users_id);
      if (authLevelManagement.checkWebServiceLevel(
          user_level)) {

        Sessiondata sd = sessionManagement.getSessionByHash(SID);
        if (sd == null || sd.getSessionXml() == null) {
          return new Long(-37);
        } else {

          // XStream xStream = new XStream(new XppDriver());
          XStream xStream = new XStream(new DomDriver("UTF-8"));
          xStream.setMode(XStream.NO_REFERENCES);

          String xmlString = sd.getSessionXml();
          RemoteSessionObject userObject = (RemoteSessionObject) xStream
              .fromXML(xmlString);

          log.debug("userObject.getUsername(), userObject.getFirstname(), userObject.getLastname() "
              + userObject.getUsername()
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

      TypedQuery<Sessiondata> query = em.createQuery(hql, 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.debug("checkSession USER_ID: "+sessiondata.getUser_id());
      // } else {
      // log.debug("Session IS NULL SID: "+SID);
      // }

      // 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.createQuery(hql, 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());
      // session.refresh(sd);
      sessiondata.setUser_id(USER_ID);
      if (sessiondata.getId() == null) {
        em.persist(sessiondata);
      } else {
        if (!em.contains(sessiondata)) {
          em.merge(sessiondata);
        }
View Full Code Here

      TypedQuery<Sessiondata> query = em.createQuery(hql, 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());
      // session.refresh(sd);
      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.createQuery(hql, 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());
      // session.refresh(sd);
      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.openmeetings.app.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.