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 ClientHelper

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

All Implemented Interfaces:
  java.io.Serializable

    public class ClientHelper

extends Helper

Helper pre objekt Client. Trieda poskytuje zakladne funkcie pre pracu s objektom Client (klient), 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
`ClientHelper()`

Method Summary
`boolean` | `addClient(Client client)` Metoda ulozi noveho klienta do databazy.
`Client` | `authorizeClient(java.lang.String clientId, java.lang.String password)` Metoda sluzi na autorizaciu klienta.
`Client` | `getClient()` Metoda vrati objekt Client, ktory je aktualne ulozeny v triede.
`Client` | `getClient(int id)` Metoda vrati klienta podla zadaneho ID.
`Client` | `getClientByName(java.lang.String name)` Metoda vrati klienta z databazy na zaklade zadaneho nazvu klienta.
`java.util.List<Client>` | `getClientsList()` Metoda vrati zoznam vsetkych klientov, ktory sa nachadzaju v databaze.
`java.util.List<Client>` | `getClientsList(java.lang.String diskName)` Metoda vrati zoznam klientov, ktory sa ukladaju na zadany disk.
`void` | `changeBackupDiskForClients(java.lang.String oldDiskName, java.lang.String newDiskName)` Metoda zmeni zalohovaci disk klientov.
`boolean` | `removeClient(Client userToRemove)` Metoda zmaze klienta z databazy.
`void` | `uploadSucces(Client c)` Metoda sluzi na aktualizaciu datumu poslednej zalohy klienta v tabulke klientov po uspesnom nahrani zalohy na server.

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

### ClientHelper

    public ClientHelper()

Method Detail

### getClient

    public Client getClient()

  Metoda vrati objekt Client, ktory je aktualne ulozeny v triede.

  Returns:
    objekt Client

### getClient

    public Client getClient(int id)

  Metoda vrati klienta podla zadaneho ID.

  Parameters:
    `id` - ID hladaneho klienta
  Returns:
    klient so zadanym ID

### getClientByName

    public Client getClientByName(java.lang.String name)

  Metoda vrati klienta z databazy na zaklade zadaneho nazvu klienta.

  Parameters:
    `name` - nazov klienta
  Returns:
    klient z databazy

### authorizeClient

    public Client authorizeClient(java.lang.String clientId,
                                  java.lang.String password)

  Metoda sluzi na autorizaciu klienta. Metoda overuje ci sa v databaze nachadza zadane ID a heslo.

  Parameters:
    `clientId` - ID klienta
    `password` - autorizacne heslo klienta
  Returns:
    autorizovany klient

### getClientsList

    public java.util.List<Client> getClientsList()

  Metoda vrati zoznam vsetkych klientov, ktory sa nachadzaju v databaze.

  Returns:
    zoznam klientov, objekt List

### getClientsList

    public java.util.List<Client> getClientsList(java.lang.String diskName)

  Metoda vrati zoznam klientov, ktory sa ukladaju na zadany disk.

  Returns:
    zoznam klientov, objekt List

### addClient

    public boolean addClient(Client client)

  Metoda ulozi noveho klienta do databazy.

  Parameters:
    `client` - novy klient
  Returns:
    true, ak sa operacia podarila; false, ak operacia zlyhala

### uploadSucces

    public void uploadSucces(Client c)

  Metoda sluzi na aktualizaciu datumu poslednej zalohy klienta v tabulke klientov po uspesnom nahrani zalohy na server.

  Parameters:
    `c` - klient, ktory ma byt aktualizovany

### removeClient

    public boolean removeClient(Client userToRemove)

  Metoda zmaze klienta z databazy.

  Parameters:
    `userToRemove` - klient, ktory ma byt zmazany
  Returns:
    true, ak sa operacia podari; false, ak sa nepodari

### changeBackupDiskForClients

    public void changeBackupDiskForClients(java.lang.String oldDiskName,
                                           java.lang.String newDiskName)

  Metoda zmeni zalohovaci disk klientov. Tato funkcia sa vola pri prekopirovani zaloh na iny disk.

  Parameters:
    `oldDiskName` - nazov stareho disku
    `newDiskName` - nazov noveho disku

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