Class CustomerEntity

  • All Implemented Interfaces:
    Customer, CustomerRemote, java.io.Serializable, java.rmi.Remote

    public class CustomerEntity
    extends java.rmi.server.UnicastRemoteObject
    implements CustomerRemote
    Customer Entity - the server entity (from persistence) Note: To better visualize the runtime differences between direct remoting and using DATA TRANSFER OBJECT, CustomerEntity itself has been implemented as remote object, this is only for testing here and rather atypical!
    Author:
    Karl Eilebrecht
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomerEntity()
      Constructor
      CustomerEntity​(java.lang.String customerId, java.lang.String lastName, java.lang.String firstName, java.lang.String street, java.lang.String zipCode, java.lang.String city)
      Creates new entity from the given data
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCity()
      Returns the city of the customer
      java.lang.String getCustomerId()
      Returns id of customer
      java.lang.String getFirstName()
      Returns the first name of the customer
      java.lang.String getLastName()
      Returns the customer's last name
      java.lang.String getStreet()
      Returns the street address of customer
      java.lang.String getZipCode()
      Returns the zip-code of the customer
      void setCity​(java.lang.String city)
      Sets the city of the customer
      void setCustomerId​(java.lang.String customerId)
      Sets the id of customer
      void setFirstName​(java.lang.String firstName)
      Sets the first name of the customer
      void setLastName​(java.lang.String lastName)
      Sets the last name of customer
      void setStreet​(java.lang.String street)
      Sets the street of the customer
      void setZipCode​(java.lang.String zipCode)
      Sets the zip-code of the customer
      java.lang.String toString()  
      • Methods inherited from class java.rmi.server.UnicastRemoteObject

        clone, exportObject, exportObject, 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, toStub
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CustomerEntity

        public CustomerEntity()
                       throws java.rmi.RemoteException
        Constructor
        Throws:
        java.rmi.RemoteException - on communication error
      • CustomerEntity

        public CustomerEntity​(java.lang.String customerId,
                              java.lang.String lastName,
                              java.lang.String firstName,
                              java.lang.String street,
                              java.lang.String zipCode,
                              java.lang.String city)
                       throws java.rmi.RemoteException
        Creates new entity from the given data
        Parameters:
        customerId - identifier
        lastName - person's last name
        firstName - person's first name
        street - address field
        zipCode - address field
        city - address field
        Throws:
        java.rmi.RemoteException - on communication error
    • Method Detail

      • getCustomerId

        public java.lang.String getCustomerId()
                                       throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns id of customer
        Specified by:
        getCustomerId in interface Customer
        Returns:
        customerId
        Throws:
        java.rmi.RemoteException
      • setCustomerId

        public void setCustomerId​(java.lang.String customerId)
                           throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the id of customer
        Specified by:
        setCustomerId in interface Customer
        Parameters:
        customerId - identifier
        Throws:
        java.rmi.RemoteException
      • getLastName

        public java.lang.String getLastName()
                                     throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns the customer's last name
        Specified by:
        getLastName in interface Customer
        Returns:
        last name of customer
        Throws:
        java.rmi.RemoteException
      • setLastName

        public void setLastName​(java.lang.String lastName)
                         throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the last name of customer
        Specified by:
        setLastName in interface Customer
        Parameters:
        lastName - person's last name
        Throws:
        java.rmi.RemoteException
      • getFirstName

        public java.lang.String getFirstName()
                                      throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns the first name of the customer
        Specified by:
        getFirstName in interface Customer
        Returns:
        firstName
        Throws:
        java.rmi.RemoteException
      • setFirstName

        public void setFirstName​(java.lang.String firstName)
                          throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the first name of the customer
        Specified by:
        setFirstName in interface Customer
        Parameters:
        firstName - person's first name
        Throws:
        java.rmi.RemoteException
      • getStreet

        public java.lang.String getStreet()
                                   throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns the street address of customer
        Specified by:
        getStreet in interface Customer
        Returns:
        street
        Throws:
        java.rmi.RemoteException
      • setStreet

        public void setStreet​(java.lang.String street)
                       throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the street of the customer
        Specified by:
        setStreet in interface Customer
        Parameters:
        street - address field
        Throws:
        java.rmi.RemoteException
      • getZipCode

        public java.lang.String getZipCode()
                                    throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns the zip-code of the customer
        Specified by:
        getZipCode in interface Customer
        Returns:
        zipCode address field
        Throws:
        java.rmi.RemoteException
      • setZipCode

        public void setZipCode​(java.lang.String zipCode)
                        throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the zip-code of the customer
        Specified by:
        setZipCode in interface Customer
        Parameters:
        zipCode - address field
        Throws:
        java.rmi.RemoteException
      • getCity

        public java.lang.String getCity()
                                 throws java.rmi.RemoteException
        Description copied from interface: Customer
        Returns the city of the customer
        Specified by:
        getCity in interface Customer
        Returns:
        city address field
        Throws:
        java.rmi.RemoteException
      • setCity

        public void setCity​(java.lang.String city)
                     throws java.rmi.RemoteException
        Description copied from interface: Customer
        Sets the city of the customer
        Specified by:
        setCity in interface Customer
        Parameters:
        city - address field
        Throws:
        java.rmi.RemoteException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.rmi.server.RemoteObject