Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## vut.msa.helpers
Class UsersHelper

    java.lang.Object
      vut.msa.helpers.Helper
          vut.msa.helpers.UsersHelper

All Implemented Interfaces:
  java.io.Serializable

    public class UsersHelper

extends Helper

Helper pre objekt User. Trieda poskytuje zakladne funkcie pre pracu s objektom User (uzivatel systemy), ako su vytvorenie, zmazanie, ziskanie a podobne.

See Also:
  Serialized Form

Field Summary

Fields inherited from class vut.msa.helpers.Helper
`factory, log, session`

Constructor Summary
`UsersHelper()`

Method Summary
`boolean` | `addNewUser(User newUser)` Metoda sluzi na vlozenie noveho uzivatela do databazy.
`java.lang.String` | `doLogin()` Metoda sluzi na nalogovanie uzivatela do systemu.
`java.lang.String` | `doLogin(java.lang.String password)` Metoda sluzi na nalogovanie uzivatela do systemu.
`User` | `getUser()`
`User` | `getUserById(int id)` Metoda sluzi na ziskanie uzivatela na zaklade zadaneho ID.
`User` | `getUserByPassword(java.lang.String password)` Metoda sluzi na ziskanie uzivatela na zaklade zadaneho uzivatelskeho mena.
`User` | `getUserByUsername(java.lang.String username)` Metoda sluzi na ziskanie uzivatela na zaklade zadaneho uzivatelskeho mena.
`java.util.List<User>` | `getUsersList()` Metoda sluzi na ziskanie zoznamu uzivatelov ulozenych v databaze.
`boolean` | `removeUser(User userToRemove)` Metoda sluzi na zmazanie uzivatela z databazy.

Methods inherited from class vut.msa.helpers.Helper
`endTransaction, openSession`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### UsersHelper

    public UsersHelper()

Method Detail

### getUser

    public User getUser()

### getUserById

    public User getUserById(int id)

  Metoda sluzi na ziskanie uzivatela na zaklade zadaneho ID.

  Parameters:
    `id` - identifikator hladaneho uzivatela
  Returns:
    uzivatel so zadanym ID

### getUserByUsername

    public User getUserByUsername(java.lang.String username)

  Metoda sluzi na ziskanie uzivatela na zaklade zadaneho uzivatelskeho mena.

  Parameters:
    `username` - uziv. meno hladaneho uzivatela
  Returns:
    uzivatel so zadanym menom

### getUserByPassword

    public User getUserByPassword(java.lang.String password)

  Metoda sluzi na ziskanie uzivatela na zaklade zadaneho uzivatelskeho mena.

  Parameters:
    `username` - uzivatelske meno hladaneho uzivatela
  Returns:
    uzivatel so zadanym uzivatelskym menom

### addNewUser

    public boolean addNewUser(User newUser)

  Metoda sluzi na vlozenie noveho uzivatela do databazy.

  Parameters:
    `newUser` - uzivatel, ktory ma byt vlozeny do databazy
  Returns:
    true ak sa vlozenie podarilo, false ak zlyhalo
  Throws:
    `LoggedException` - ak uzivatel nepresiel testami

### removeUser

    public boolean removeUser(User userToRemove)

  Metoda sluzi na zmazanie uzivatela z databazy.

  Parameters:
    `userToRemove` - uzivatel, ktory ma byt zmazany
  Returns:
    true, ak sa operacia podarila, false, ak sa nepodarila

### getUsersList

    public java.util.List<User> getUsersList()

  Metoda sluzi na ziskanie zoznamu uzivatelov ulozenych v databaze.

  Returns:
    zoznam uzivatelov z databazy

### doLogin

    public java.lang.String doLogin()

  Metoda sluzi na nalogovanie uzivatela do systemu. V pripade, ze ma uzivatel zadane spravne heslo, metoda vrati "login", co sluzi na navigaciu do hlavneho menu. V opacnom pripade zobrazi prihlasovacie okno.

  Returns:
    retazec login alebo logout

### doLogin

    public java.lang.String doLogin(java.lang.String password)

  Metoda sluzi na nalogovanie uzivatela do systemu. V pripade, ze ma uzivatel zadane spravne heslo, metoda vrati "login", co sluzi na navigaciu do hlavneho menu. V opacnom pripade zobrazi prihlasovacie okno.

  Returns:
    retazec login alebo logout

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD