Package ds.shared.rmi

Examples of ds.shared.rmi.FileServerInterface


    LOGGER.debug("Forwarding file to client " + file);
   
    int loc = NodeSelecter.select_get(file);
   
    NodeInfo info = nodes.get(loc);
    FileServerInterface node = info.getNode();
    Socket sourceSocket = info.getSocket();
   
    // Request file transfer
    boolean response = false;
    try {
      response = node.getFile(file);
    } catch (RemoteException e1) {
      e1.printStackTrace();
      return;
    }
     
    if (response)
      LOGGER.debug("Received permission to put file ");
    else {
      LOGGER.info("Permission denied");
      return;
    }
   
    // Get file size
    long size;
    try {
      size = node.getFileSize(file);
    } catch (RemoteException e1) {
      e1.printStackTrace();
      return;
    }
       
View Full Code Here


   
    int loc = NodeSelecter.select_put();
    LOGGER.debug("Selected node " + loc);
   
    NodeInfo info = nodes.get(loc);
    FileServerInterface node = info.getNode();
    Socket destinationSocket = info.getSocket();
   
    // Request the file transfer to the node
    boolean response = false;
    try {
      response = node.putFile(file, size);
    } catch (RemoteException e1) {
      e1.printStackTrace();
    }
   
    if (response)
View Full Code Here

  public boolean register(String name) throws RemoteException {
    try {
        // Assume localhost for now
        String server = "localhost";
       
      FileServerInterface node = (FileServerInterface) Naming.lookup ("//"+server+"/"+name);
      LOGGER.debug("Registering node " + name);

        int port = node.getServerSocketPort();
      LOGGER.debug("Connecting to socket on " + server + ":" + port);
        Socket socket = new Socket(server, port);
      LOGGER.debug("Opened socket connection");
     
      NodeInfo info = new NodeInfo(node, socket, name);
View Full Code Here

TOP

Related Classes of ds.shared.rmi.FileServerInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.