public SPlatformSessionImpl(final SPlatformSession session) { id = session.getId(); creationDate = session.getCreationDate(); duration = session.getDuration(); lastRenewDate = session.getLastRenewDate(); userName = session.getUserName(); userId = session.getUserId(); }
public SPlatformSessionImpl(final SPlatformSession session) { id = session.getId(); creationDate = session.getCreationDate(); duration = session.getDuration(); lastRenewDate = session.getLastRenewDate(); userName = session.getUserName(); userId = session.getUserId(); }
public PlatformSession login() throws PlatformLoginException { try { PlatformServiceAccessor platformAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); final PlatformSessionService platformSessionService = platformAccessor.getPlatformSessionService(); SPlatformSession platformSession = platformSessionService.createSession("local"); final Date creationDate = platformSession.getCreationDate(); return new PlatformSessionImpl(platformSession.getId(), creationDate, platformSession.getDuration(), "local", platformSession.getUserId()); } catch (final Exception e) { throw new PlatformLoginException(e); } } }
public PlatformSession login() throws PlatformLoginException { try { PlatformServiceAccessor platformAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); final PlatformSessionService platformSessionService = platformAccessor.getPlatformSessionService(); SPlatformSession platformSession = platformSessionService.createSession("local"); final Date creationDate = platformSession.getCreationDate(); return new PlatformSessionImpl(platformSession.getId(), creationDate, platformSession.getDuration(), "local", platformSession.getUserId()); } catch (final Exception e) { throw new PlatformLoginException(e); } } }
@Override @CustomTransactions @AvailableOnStoppedNode public PlatformSession login(final String userName, final String password) throws PlatformLoginException { PlatformServiceAccessor platformAccessor; try { platformAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); } catch (final Exception e) { e.printStackTrace();// no logger available yet throw new PlatformLoginException(e.getMessage()); } final PlatformLoginService platformLoginService = platformAccessor.getPlatformLoginService(); // PlatformService platformService = platformAccessor.getPlatformService(); // TO UNCOMMENT lvaills // first call before create session: put the platform in cache if necessary // putPlatformInCacheIfNecessary(platformAccessor, platformService); // TO UNCOMMENT lvaills final SPlatformSession platformSession; try { platformSession = platformLoginService.login(userName, password); } catch (SPlatformLoginException e) { throw new PlatformLoginException(e); } catch (SInvalidPlatformCredentialsException ignored) { throw new InvalidPlatformCredentialsException("Wrong username of password"); } final long id = platformSession.getId(); final Date creationDate = platformSession.getCreationDate(); final long duration = platformSession.getDuration(); final long userId = platformSession.getUserId(); return new PlatformSessionImpl(id, creationDate, duration, userName, userId); }
@Override @CustomTransactions @AvailableOnStoppedNode public PlatformSession login(final String userName, final String password) throws PlatformLoginException { PlatformServiceAccessor platformAccessor; try { platformAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); } catch (final Exception e) { e.printStackTrace();// no logger available yet throw new PlatformLoginException(e.getMessage()); } final PlatformLoginService platformLoginService = platformAccessor.getPlatformLoginService(); // PlatformService platformService = platformAccessor.getPlatformService(); // TO UNCOMMENT lvaills // first call before create session: put the platform in cache if necessary // putPlatformInCacheIfNecessary(platformAccessor, platformService); // TO UNCOMMENT lvaills final SPlatformSession platformSession; try { platformSession = platformLoginService.login(userName, password); } catch (SPlatformLoginException e) { throw new PlatformLoginException(e); } catch (SInvalidPlatformCredentialsException ignored) { throw new InvalidPlatformCredentialsException("Wrong username of password"); } final long id = platformSession.getId(); final Date creationDate = platformSession.getCreationDate(); final long duration = platformSession.getDuration(); final long userId = platformSession.getUserId(); return new PlatformSessionImpl(id, creationDate, duration, userName, userId); }