cz.luboss.pensum
Class PeServerRMI

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bycz.luboss.pensum.PeServerRMI
All Implemented Interfaces:
MedullaRMI, PensumRMI, java.rmi.Remote, java.io.Serializable

public class PeServerRMI
extends java.rmi.server.UnicastRemoteObject
implements PensumRMI

RMI server pro aplikaci Pensum

Author:
LKC
See Also:
Serialized Form

Constructor Summary
PeServerRMI()
          Konstruktor
 
Method Summary
 boolean AddProduct(int nSessionID, PeJob job, PeProduct product)
          Prida vyrobek do jobu
 boolean DeleteArrayRMI(int nSessionID, MeArray array)
          Smaze data z pole z RMI
 boolean DeleteDataRMI(int nSessionID, MeItem item)
          Smaze objekt z RMI
 boolean IsValidSession(int nSessionID)
          Zjisti zda je session platna
 MeArray LoadArrayRMI(int nSessionID, MeArray array, MePodminka podminka)
          Nahraje data do pole z RMI
 MeItem LoadDataRMI(int nSessionID, MeItem item, MePodminka podminka)
          Nahraje data do objektu z RMI
 MeSession LoadSession(java.lang.String sLogin, java.lang.String sPassword)
          Zaloguje uzivatele a vrati jeho session
static void main(java.lang.String[] args)
           
 boolean SaveArrayRMI(int nSessionID, MeArray array)
          Ulozi data z pole z RMI
 int SaveDataRMI(int nSessionID, MeItem item)
          Ulozi data z objektu do RMI a vrati ID objektu
 MeDataTest sendTest(MeDataTest message)
          Otestuje rozhrani RMI
 boolean SetStavOper(int nSessionID, PeRunOperation operation, int nStav)
          Nastavi na operaci stav
 boolean SetStavPart(int nSessionID, PeRunPart part, int nStav)
          Nastavi na dilci a jeho operacich stav
 boolean SetStavProduct(int nSessionID, PeRunProduct product, int nStav)
          Nastavi na produktu a jeho dilcich stav
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeServerRMI

public PeServerRMI()
            throws java.rmi.RemoteException
Konstruktor

Method Detail

main

public static void main(java.lang.String[] args)

sendTest

public MeDataTest sendTest(MeDataTest message)
Otestuje rozhrani RMI

Specified by:
sendTest in interface MedullaRMI
Parameters:
message - testovaci objekt
Returns:
testovaci objekt

LoadSession

public MeSession LoadSession(java.lang.String sLogin,
                             java.lang.String sPassword)
Zaloguje uzivatele a vrati jeho session

Specified by:
LoadSession in interface MedullaRMI
Parameters:
sLogin - login uzivatele
sPassword - heslo uzivatele
Returns:
vytvorena Session

IsValidSession

public boolean IsValidSession(int nSessionID)
Zjisti zda je session platna

Specified by:
IsValidSession in interface MedullaRMI
Parameters:
nSessionID - ID session, ktera se testuje
Returns:
vis popis

LoadDataRMI

public MeItem LoadDataRMI(int nSessionID,
                          MeItem item,
                          MePodminka podminka)
Nahraje data do objektu z RMI

Specified by:
LoadDataRMI in interface MedullaRMI
Parameters:
nSessionID - Session
item - objekt, ktery nacitame
podminka - vyberova podminka
Returns:
nacteny prvek

SaveDataRMI

public int SaveDataRMI(int nSessionID,
                       MeItem item)
Ulozi data z objektu do RMI a vrati ID objektu

Specified by:
SaveDataRMI in interface MedullaRMI
Parameters:
nSessionID - Session
item - objekt, ktery ukladame
Returns:
ID objektu

DeleteDataRMI

public boolean DeleteDataRMI(int nSessionID,
                             MeItem item)
Smaze objekt z RMI

Specified by:
DeleteDataRMI in interface MedullaRMI
Parameters:
nSessionID - Session
item - objekt, ktery mazem
Returns:
prubeh funkce

LoadArrayRMI

public MeArray LoadArrayRMI(int nSessionID,
                            MeArray array,
                            MePodminka podminka)
Nahraje data do pole z RMI

Specified by:
LoadArrayRMI in interface MedullaRMI
Parameters:
nSessionID - Session
array - pole objektu, ktery nacitame
podminka - vyberova podminka
Returns:
prubeh funkce

SaveArrayRMI

public boolean SaveArrayRMI(int nSessionID,
                            MeArray array)
Ulozi data z pole z RMI

Specified by:
SaveArrayRMI in interface MedullaRMI
Parameters:
nSessionID - Session
array - pole objektu, ktery ukladame
Returns:
prubeh funkce

DeleteArrayRMI

public boolean DeleteArrayRMI(int nSessionID,
                              MeArray array)
Smaze data z pole z RMI

Specified by:
DeleteArrayRMI in interface MedullaRMI
Parameters:
nSessionID - Session
array - pole objektu
Returns:
prubeh funkce

AddProduct

public boolean AddProduct(int nSessionID,
                          PeJob job,
                          PeProduct product)
Prida vyrobek do jobu

Specified by:
AddProduct in interface PensumRMI
Parameters:
nSessionID - Session
job - job, do ktereho je treba dat cely vyrobek
product - vkladany vyrobek
Returns:
prubeh funkce

SetStavProduct

public boolean SetStavProduct(int nSessionID,
                              PeRunProduct product,
                              int nStav)
Nastavi na produktu a jeho dilcich stav

Specified by:
SetStavProduct in interface PensumRMI
Parameters:
nSessionID - Session
product - vyrobek
nStav - stav pro nastaveni
Returns:
prubeh funkce

SetStavPart

public boolean SetStavPart(int nSessionID,
                           PeRunPart part,
                           int nStav)
Nastavi na dilci a jeho operacich stav

Specified by:
SetStavPart in interface PensumRMI
Parameters:
nSessionID - Session
part - dilec
nStav - stav pro nastaveni
Returns:
prubeh funkce

SetStavOper

public boolean SetStavOper(int nSessionID,
                           PeRunOperation operation,
                           int nStav)
Nastavi na operaci stav

Specified by:
SetStavOper in interface PensumRMI
Parameters:
nSessionID - Session
operation - operace
nStav - stav pro nastaveni
Returns:
prubeh funkce