Package org.jmule.core.servermanager

Examples of org.jmule.core.servermanager.Server


          server_shared_files
              .put(fileHash, sharedFiles.get(fileHash));
        }
        if (files_to_share.size() == 0) return ;
               
        Server server = _server_manager.getConnectedServer();
        _network_manager.offerFilesToServer(server.getClientID(),
            files_to_share);

      }
    };
    sharing_manager_timer.addTask(server_sharing_task, ConfigurationManager.SHARED_FILES_PUBLISH_INTERVAL, true);
View Full Code Here


    return row_names.length;
  }

  public Object getValueAt(int rowIndex, int columnIndex) {
   
    Server c_server = _server_manager.getConnectedServer();
   
    if( columnIndex == 0 ) {
            return row_names[rowIndex];
    }
   
    if( c_server != null ) {
       if( columnIndex == 1 ) {
          switch(rowIndex) {
             case NAME        :    return " " + c_server.getName();
             case IP          :    return " " + c_server.getAddress();
             case DESCRIPTION :    return " " + c_server.getDesc();
             case PING        :    return " " + c_server.getPing();
             case FILES       :    return " " + NumberFormatter.formatSizeHumanReadable(c_server.getNumFiles());
             case USERS       :    return " " + NumberFormatter.formatSizeHumanReadable(c_server.getNumUsers());
             case SOFT_LIMIT  :    return " " + NumberFormatter.formatSizeHumanReadable(c_server.getSoftLimit());
             case HARD_LIMIT  :    return " " + NumberFormatter.formatSizeHumanReadable(c_server.getHardLimit());
             case VERSION     :    return " " + c_server.getVersion();
          }
      }
    }
   
    return "";
View Full Code Here

    //}
    return result;
  }
 
  private boolean connectedServerIn(Server[] servers) {
    Server connected_server = _server_manager.getConnectedServer();
    for(Server server : servers) {
      if( server == connected_server ) return true;
    }
    return false;
  }
View Full Code Here

   *     |
   */   
 
  private ConditionType whichCondition() {
    ServerManager _server_manager = ServerManagerSingleton.getInstance();
    Server connected_server = _server_manager.getConnectedServer();
    int[] selected_rows = this.getSelectedRows();
    Server[] servers = getServersByIndexes( selected_rows );
   
    if( ( connected_server != null ) && ( selected_rows.length == 1 ) && ( servers[0] != connected_server ) )
        return ConditionType.A;
View Full Code Here

  }
 
  public void peerConnected(String ip, int port) {
    try {
      JMPeerConnection connection = getPeerConnection(ip, port);
      Server connected_server = _server_manager.getConnectedServer();
      byte[] server_ip = null;
      int server_port = 0;
      ClientID client_id = null;
      if (connected_server != null) {
        server_ip = connected_server.getAddressAsByte();
        server_port = connected_server.getPort();
        client_id = connected_server.getClientID();
      }
      Packet packet = PacketFactory.getPeerHelloPacket(_config_manager
          .getUserHash(), client_id, _config_manager.getTCP(),
          server_ip, server_port, _config_manager.getNickName(),
          E2DKConstants.DefaultJMuleFeatures);
View Full Code Here

      connection.usePort = peerListenPort;
     
      _peer_manager.helloFromPeer(peerIP, peerPort, userHash, clientID,
          peerListenPort, tagList, serverIP, serverPort);
     
      Server connected_server = _server_manager.getConnectedServer();
      byte[] server_ip = null;
      int server_port = 0;
      ClientID client_id = null;
      if (connected_server != null) {
        server_ip = connected_server.getAddressAsByte();
        server_port = connected_server.getPort();
        client_id = connected_server.getClientID();
      }
      Packet packet = PacketFactory.getPeerHelloAnswerPacket(
          _config_manager.getUserHash(), client_id, _config_manager
              .getTCP(), _config_manager.getNickName(),
          server_ip, server_port, E2DKConstants.DefaultJMuleFeatures);
View Full Code Here

    selected_server_connect = new MenuItem (selected_server_menu, SWT.PUSH);
    selected_server_connect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.connect_to"));
    selected_server_connect.setImage(SWTImageRepository.getImage("server_connect.png"));
    selected_server_connect.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(final SelectionEvent e) {
      Server selected_server = (Server) getSelectedObject();
      wrapper.connectTo(selected_server);
    }} );
   
    selected_server_disconnect = new MenuItem (selected_server_menu, SWT.PUSH);
    selected_server_disconnect.setText (Localizer._("mainwindow.serverlisttab.serverlist.popupmenu.disconnect_from"));
View Full Code Here

TOP

Related Classes of org.jmule.core.servermanager.Server

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.