private boolean receiveDataGridlet(DataGridlet dg) {
        if (dg == null) {
            return false;
        }

        // get a list of required files
        LinkedList list = (LinkedList) (dg.getRequiredFiles()).clone();
        int serviceLevel = dg.getNetServiceLevel(); // get priority

        // for each file, check whether it is available or not
        for (int i = 0; i < list.size(); i++) {
            String filename = (String) list.get(i); // get file name

            // if the file is already on the local storage, the
            // transfer from a remote site is not needed
            if (contains(filename)) {
                dg.deleteRequiredFile(filename); // delete from the list
            }
            // if the file is not available, then make a replica request
            else {
                // if the file should have higher QoS
                if (serviceLevel == 1) {
                    priorityFile_.add(filename);
                }

                Object[] packet = new Object[2];
                packet[0] = filename;
                packet[1] = super.resIdObj_;
                sim_schedule(outputPort_, 0, DataGridTags.CTLG_GET_REPLICA,
                        new IO_data(packet, DataGridTags.PKT_SIZE, super.rcID_));
            }
        }

        // if all files are available locally
        if (dg.getRequiredFiles().size() == 0) {
            dg.setResourceParameter(super.resourceID_, 0);
            policy_.gridletSubmit(dg, false); // start executing this job
        } else { // otherwise, put into the queue
            waitingDataGridlet_.add(dg);
        }

        return true;
    }