Rev 1317 | Rev 1554 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1317 | Rev 1339 | ||
---|---|---|---|
Line 322... | Line 322... | ||
322 | * Create a new Certificate for usage in URL auto login |
322 | * Create a new Certificate for usage in URL auto login |
323 | * |
323 | * |
324 | * @param userId |
324 | * @param userId |
325 | * @return the certificate string to use in URL |
325 | * @return the certificate string to use in URL |
326 | */ |
326 | */ |
327 | public 1.5.0/docs/api/java/lang/String.html">String createCertificate(long userId) |
327 | public 1.5.0/docs/api/java/lang/String.html">String createCertificateForId(long userId, UserSession usersession) |
328 | { |
328 | { |
329 | User u = DaoFactory.getUserDaoImpl().load(userId); |
329 | User u = DaoFactory.getUserDaoImpl().load(userId); |
330 | return createCertificate(u); |
330 | return createCertificate(u, usersession); |
331 | } |
331 | } |
332 | /** |
332 | /** |
333 | * Create a new Certificate for usage in URL auto login |
333 | * Create a new Certificate for usage in URL auto login |
334 | * |
334 | * |
335 | * @param user to crate certificate |
335 | * @param user to crate certificate |
336 | * @return the certificate string |
336 | * @return the certificate string |
337 | */ |
337 | */ |
338 | public 1.5.0/docs/api/java/lang/String.html">String createCertificate(User user) |
338 | public 1.5.0/docs/api/java/lang/String.html">String createCertificate(User user, UserSession usersession) |
339 | { |
339 | { |
340 | 1.5.0/docs/api/java/lang/String.html">String certificate = user.getId() |
340 | 1.5.0/docs/api/java/lang/String.html">String certificate = user.getId() |
341 | + "-" + 1.5.0/docs/api/java/lang/System.html">System.currentTimeMillis() |
341 | + "-" + 1.5.0/docs/api/java/lang/System.html">System.currentTimeMillis() |
342 | + "-" + 1.5.0/docs/api/java/lang/Thread.html">Thread.currentThread().hashCode() |
342 | + "-" + 1.5.0/docs/api/java/lang/Thread.html">Thread.currentThread().hashCode() |
343 | + "-" + 1.5.0/docs/api/java/lang/Runtime.html">Runtime.getRuntime().freeMemory(); |
343 | + "-" + 1.5.0/docs/api/java/lang/Runtime.html">Runtime.getRuntime().freeMemory(); |
Line 350... | Line 350... | ||
350 | } |
350 | } |
351 | 351 | ||
352 | public static void main(1.5.0/docs/api/java/lang/String.html">String [] args) |
352 | public static void main(1.5.0/docs/api/java/lang/String.html">String [] args) |
353 | { |
353 | { |
354 | AbstractDao.getCurrentSession().beginTransaction(); |
354 | AbstractDao.getCurrentSession().beginTransaction(); |
355 | 1.5.0/docs/api/java/lang/String.html">String certificate = new AuthenticateService().createCertificate(1691); |
355 | 1.5.0/docs/api/java/lang/String.html">String certificate = new AuthenticateService().createCertificateForId(1691,null); |
356 | AbstractDao.getCurrentSession().getTransaction().commit(); |
356 | AbstractDao.getCurrentSession().getTransaction().commit(); |
357 | 357 | ||
358 | } |
358 | } |
359 | } |
359 | } |
360 | 360 |