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

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

        String filename = (String) data[0]; // get file name
        int registrationID = ((Integer) data[1]).intValue(); // get unique ID
        int msg = ((Integer) data[2]).intValue(); // get result

        // if registration is successful
        if (msg == DataGridTags.CTLG_ADD_MASTER_SUCCESSFUL) {
            setID(filename, registrationID); // set the id of this file
        }

        // search this request from the waiting list
        Object[] dataTemp = searchEvent(filename, masterFilesWaitingForAddACK_);
        if (dataTemp != null) {
            // if the addition was not successful, delete the file
            if (msg != DataGridTags.CTLG_ADD_MASTER_SUCCESSFUL) {
                this.deleteFileFromStorage(filename, true, false);
            } else {
                msg = DataGridTags.FILE_ADD_SUCCESSFUL;
            }

            // delete this event from the waiting list
            masterFilesWaitingForAddACK_.remove(dataTemp);

            // send back the result to sender
            int senderID = ((Integer) dataTemp[1]).intValue();
            Object pack[] = new Object[3];
            pack[0] = filename; // file name
            pack[1] = new Integer(registrationID); // unique id
            pack[2] = new Integer(msg); // message

            sim_schedule(outputPort_, 0, DataGridTags.FILE_ADD_MASTER_RESULT,
                    new IO_data(pack, DataGridTags.PKT_SIZE, senderID));
        }
    }