Class ProductManagerServer

    • Method Detail

      • findProductById

        public Product findProductById​(java.lang.String id)
                                throws java.rmi.RemoteException
        Description copied from interface: ProductManager
        Finds the product and returns it
        Specified by:
        findProductById in interface ProductManager
        Parameters:
        id - the product's id
        Returns:
        product or null if not found
        Throws:
        java.rmi.RemoteException - on remoting error
      • acquireProductId

        public java.lang.String acquireProductId()
                                          throws java.rmi.RemoteException
        Description copied from interface: ProductManager
        Returns a new product-ID, the ID must be acquired before registering a new product
        Specified by:
        acquireProductId in interface ProductManager
        Returns:
        acquired product identifier
        Throws:
        java.rmi.RemoteException - on remoting error
      • registerProduct

        public void registerProduct​(Product product)
                             throws java.rmi.RemoteException
        Description copied from interface: ProductManager
        Registers a new product
        Specified by:
        registerProduct in interface ProductManager
        Parameters:
        product - the product to be registered, including a previously registered id
        Throws:
        java.rmi.RemoteException - on remoting error
      • reset

        public void reset()
                   throws java.rmi.RemoteException
        Description copied from interface: ProductManager
        for testing, resets state
        Specified by:
        reset in interface ProductManager
        Throws:
        java.rmi.RemoteException - on remoting error
      • main

        public static void main​(java.lang.String[] args)
        Creates stand-alone console server
        Parameters:
        args - first argument may optionally specify the port