public int getReplicaLocation(String lfn)
    {
        if (lfn == null) {
            return -1;
        }

        int resourceID = -1;
        int eventTag = DataGridTags.CTLG_GET_REPLICA;   // set tag name

        // consult with the RC first
        int rcID = getReplicaCatalogueID();
        if (rcID == -1) {
            return -1;
        }

        // sends a request to this RC
        sendEvent(eventTag, lfn, rcID);

        // waiting for a response from the RC
        Sim_type_p tag = new Sim_type_p(DataGridTags.CTLG_REPLICA_DELIVERY);

        // only look for this type of ack
        Sim_event ev = new Sim_event();
        super.sim_get_next(tag, ev);

        try
        {
            Object[] data = (Object[]) ev.get_data();   // get the data
            Integer resID = (Integer) data[1];          // get the resource ID
            if (resID != null) {
                resourceID = resID.intValue();
            }
        }
        catch (Exception e)
        {
            resourceID = -1;
            System.out.println(super.get_name()
                    + ".getReplicaLocation(): Exception");
        }

        return resourceID;
    }