private void processAddMasterFile(Sim_event ev) {
        if (ev == null) {
            return;
        }

        Object[] pack = (Object[]) ev.get_data();
        if (pack == null) {
            return;
        }

        File file = (File) pack[0]; // get the file
        file.setMasterCopy(true); // set the file into a master copy
        int sentFrom = ((Integer) pack[1]).intValue(); // get sender ID

        /******     // DEBUG
         System.out.println(super.get_name() + ".addMasterFile(): " +
         file.getName() + " from " + GridSim.getEntityName(sentFrom));
         *******/

        Object[] data = new Object[3];
        data[0] = file.getName();

        int msg = addFile(file); // add the file
        if (msg == DataGridTags.FILE_ADD_SUCCESSFUL) {
            registerMasterFile(file);
            data[1] = new Integer(sentFrom);
            masterFilesWaitingForAddACK_.add(data);
        } else {
            data[1] = new Integer(-1); // no sender id
            data[2] = new Integer(msg); // the result of adding a master file

            sim_schedule(outputPort_, 0, DataGridTags.FILE_ADD_MASTER_RESULT,
                    new IO_data(data, DataGridTags.PKT_SIZE, sentFrom));
        }
    }