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

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


  private UserManager userManager;
 
  @Test
  public void testSendInvitationLink() {
    try {
      Sessiondata sessionData = mService.getsessiondata();
     
      User us = (User) userManager.loginUser(sessionData.getSession_id(), username, userpass, null, null, false);
     
      invitationService.sendInvitationHash(sessionData.getSession_id(), username, "message", "sebawagner@apache.org",
          "subject", 1L, "", false, "", 1, new Date(), "12:00", new Date(), "14:00", 1L, us.getTimeZoneId(), true);
     
    } catch (Exception err) {
      log.error("[testSendInvitationLink]", err);
    }
View Full Code Here


    //FIXME code is duplicated from MainService, need to be unified
    SOAPLoginDao soapDao = getBean(SOAPLoginDao.class);
    SOAPLogin soapLogin = soapDao.get(secureHash);
    if (soapLogin != null && !soapLogin.getUsed()) { //add code for  || (soapLogin.getAllowSameURLMultipleTimes())
      SessiondataDao sessionDao = getBean(SessiondataDao.class);
      Sessiondata sd = sessionDao.getSessionByHash(soapLogin.getSessionHash());
      if (sd != null && sd.getSessionXml() != null) {
        RemoteSessionObject remoteUser = RemoteSessionObject.fromXml(sd.getSessionXml());
        if (remoteUser != null && !Strings.isEmpty(remoteUser.getExternalUserId())) {
          AdminUserDao userDao = getBean(AdminUserDao.class);
          User user = userDao.getExternalUser(remoteUser.getExternalUserId(), remoteUser.getExternalUserType());
          if (user == null) {
            user = userDao.getNewUserInstance(null);
View Full Code Here

      bind();
    }
  }
 
  public boolean signIn(String login, String password, String ldapConfigFileName) {
    Sessiondata sessData = getBean(SessiondataDao.class).startsession();
    SID = sessData.getSession_id();
    Object _u = Strings.isEmpty(ldapConfigFileName)
        ? getBean(IUserManager.class).loginUser(SID, login, password, null, null, false)
        : getBean(ILdapLoginManagement.class).doLdapLogin(login, password, null, null, SID, ldapConfigFileName);
   
    if (_u instanceof User) {
View Full Code Here

 
  public String getValidatedSid() {
    SessiondataDao sessionDao = getBean(SessiondataDao.class);
    Long _userId = sessionDao.checkSession(SID);
    if (_userId == null || userId != _userId) {
      Sessiondata sessionData = sessionDao.getSessionByHash(SID);
      if (sessionData == null) {
        sessionData = sessionDao.startsession();
      }
      if (!sessionDao.updateUser(sessionData.getSession_id(), userId, false, languageId)) {
        //something bad, force user to re-login
        invalidate();
      } else {
        SID = sessionData.getSession_id();
      }
    }
    return SID;
  }
View Full Code Here

  public Long loginUserByRemote(String SID) {
    try {
      Long users_id = sessiondataDao.checkSession(SID);
      Long user_level = userManager.getUserLevelByID(users_id);
      if (AuthLevelUtil.checkWebServiceLevel(user_level)) {
        Sessiondata sd = sessiondataDao.getSessionByHash(SID);
        if (sd == null || sd.getSessionXml() == null) {
          return new Long(-37);
        } else {
          RemoteSessionObject userObject = RemoteSessionObject.fromXml(sd.getSessionXml());

          log.debug(userObject.toString());

          IConnection current = Red5.getConnectionLocal();
          String streamId = current.getClient().getId();
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

    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("[getSessionByHash]: ", 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

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.