public TargetObjectBaseCore(ITarget builtFrom,
				IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) {
			this.referenceValues = new List<IReferenceValueBase>();
			this.builtFrom = builtFrom;
			/* foreach */
			foreach (IReferenceValue referenceValue  in  builtFrom.ReferenceValues) {
				referenceValues.Add(new ReferenceValueObjectBaseCore(referenceValue, retrievalManager));
			}
		}
		public MetadataObjectBaseCore(IMetadata builtFrom,
				IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) {
			this.metadataSet = new List<IMetadataSetBase>();
			this.builtFrom = builtFrom;
			/* foreach */
			foreach (IMetadataSet currentMS  in  builtFrom.MetadataSet) {
				metadataSet.Add(new MetadataSetBaseCore(currentMS,
									retrievalManager));
			}
		}
		public ReferenceValueObjectBaseCore(IReferenceValue builtFrom,
				IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) {
			this.builtFrom = builtFrom;
			if (builtFrom.IdentifiableReference != null) {
				identifiableReference = retrievalManager.GetIdentifiableObject(builtFrom.GetIdentifiableReference());
			}
			if (builtFrom.ContentConstraintReference != null) {
				contentConstraintReference = retrievalManager.GetIdentifiableObject<IContentConstraintObject>(
						builtFrom.ContentConstraintReference,
						typeof(IContentConstraintObject));
			}
		}
		public MetadataReportBaseCore(IReportStructure rs, IMetadataReport builtFrom, IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) {
                    this.reportedAttributes = new List<IReportedAttributeBase>();
			this.builtFrom = builtFrom;
			this.target = new TargetObjectBaseCore(builtFrom.Target, retrievalManager);
			/* foreach */
			foreach (IReportedAttribute reportedAttribute  in  builtFrom
					.ReportedAttributes) {
				IMetadataAttribute Ima = GetMetadataAttributeForRepotedAttribtue(
						reportedAttribute, rs.MetadataAttributes);
				reportedAttributes.Add(new ReportedAttributeObjectBaseCore(Ima, reportedAttribute, retrievalManager));
			}
		}
        public MetadataSetBaseCore(IMetadataSet builtFrom, IIdentifiableRetrievalManager retrievalManager)
            : base(builtFrom)
        {
            this.reports = new List<IMetadataReportBase>();
			this.builtFrom = builtFrom;
			this.metadataStructure = retrievalManager.GetIdentifiableObject<IMetadataStructureDefinitionObject>(
					builtFrom.MsdReference,
					typeof(IMetadataStructureDefinitionObject));
			if (builtFrom.DataProviderReference != null) {
                this.dataProvider = retrievalManager.GetIdentifiableObject<IDataProvider>(
						builtFrom.DataProviderReference,
						typeof(IDataProvider));
			}
			if (builtFrom.Reports != null) {
				/* foreach */
				foreach (IMetadataReport metadataReport  in  builtFrom.Reports) {
					IReportStructure rs = GetReportStructure(metadataReport,
							metadataStructure.ReportStructures);
					this.reports.Add(new MetadataReportBaseCore(rs, metadataReport, retrievalManager));
				}
			}
		}
		public ReportedAttributeObjectBaseCore(
				IMetadataAttribute correspondingMA,
				IReportedAttribute builtFrom,
				IIdentifiableRetrievalManager retrievalManager) : base(builtFrom) {
                    this.reportedAttributes = new List<IReportedAttributeBase>();
			this.builtFrom = builtFrom;
			concept = retrievalManager.GetIdentifiableObject<IConceptObject>(
					correspondingMA.ConceptRef, typeof(IConceptObject));
			if (correspondingMA.HasCodedRepresentation()) {
                this.codelist = retrievalManager.GetIdentifiableObject<ICodelistObject>(
						correspondingMA.Representation.RepresentationRef,
						typeof(ICodelistObject));
			}
			if (builtFrom.ReportedAttributes != null) {
				/* foreach */
				foreach (IReportedAttribute reportedAttribute  in  builtFrom
						.ReportedAttributes) {
					IMetadataAttribute metadataAttribute = GetMetadataAttributeForRepotedAttribtue(
							reportedAttribute, correspondingMA.MetadataAttributes);
					reportedAttributes.Add(new ReportedAttributeObjectBaseCore(metadataAttribute, reportedAttribute, retrievalManager));
				}
			}
		}
        /// <summary>
        ///   Returns a set of IdentifiableBeans that the IMaintainableObject cross references
        /// </summary>
        /// <param name="bean"> The bean. </param>
        /// <param name="resolveAgencies"> - if true will also resolve the agencies </param>
        /// <param name="numberLevelsDeep"> references, an argument of 0 (zero) implies there is no limit, and the resolver engine will continue re-cursing until it has found every directly and indirectly referenced artifact. Note that there is no risk of infinite recursion in calling this. </param>
        /// <param name="retrievalManager"> - Used to resolve the structure references. Can be null, if supplied this is used to resolve any references that do not exist in the supplied sdmxObjects </param>
        /// <exception cref="CrossReferenceException">- if any of the references could not be resolved</exception>
        /// <returns> a set of IdentifiableBeans that the IMaintainableObject cross references </returns>
        public virtual ISet<IIdentifiableObject> ResolveReferences(
            IMaintainableObject bean,
            bool resolveAgencies,
            int numberLevelsDeep,
            IIdentifiableRetrievalManager retrievalManager)
        {
            this.ResetMaps();
            ISdmxObjects beans = new SdmxObjectsImpl();
            beans.AddIdentifiable(bean);
            IDictionary<IIdentifiableObject, ISet<IIdentifiableObject>> references = this.ResolveReferences(
                beans, resolveAgencies, numberLevelsDeep, retrievalManager);

            ISet<IIdentifiableObject> returnSet = new HashSet<IIdentifiableObject>();

            /* foreach */
            foreach (KeyValuePair<IIdentifiableObject, ISet<IIdentifiableObject>> key in references)
            {
                returnSet.AddAll(key.Value);
            }

            return returnSet;
        }
 /// <summary>
 /// </summary>
 /// <param name="structures"> The structures</param>
 /// <param name="resolveAgencies"> Flag indicating resolve agencies .</param>
 /// <param name="resolutionDepth"> The resolution depth. </param>
 /// <param name="retrievalManager"> The retrieval manager </param>
 /// <returns> The references </returns>
 public IDictionary<IIdentifiableObject, ISet<IIdentifiableObject>> ResolveReferences(
     ISdmxObjects structures,
     bool resolveAgencies,
     int resolutionDepth,
     IIdentifiableRetrievalManager retrievalManager)
 {
     ICrossReferenceResolverEngine crossReferenceResolver = new CrossReferenceResolverEngineCore();
     return crossReferenceResolver.ResolveReferences(
         structures, resolveAgencies, resolutionDepth, retrievalManager);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="StructureWorkspace"/> class.
        ///     Creates a workspace, gets all cross referenced objects using the retrieval manager (if it is not null)
        /// </summary>
        /// <param name="sdmxObjects">
        /// - the sdmxObjects to populate the workspace with
        /// </param>
        /// <param name="retrievalManager">
        /// - this will be used to retrieve all the cross references if it is not null
        /// </param>
        /// <param name="retrieveCrossReferences">
        /// The retrieve Cross References.
        /// </param>
        /// <param name="retrieveAgencies">
        /// - this will also retrieve all the agencies if true
        /// </param>
        /// <param name="resolutionDepth4">
        /// The resolution Depth.
        /// </param>
        public StructureWorkspace(
            ISdmxObjects sdmxObjects,
            IIdentifiableRetrievalManager retrievalManager,
            bool retrieveCrossReferences,
            bool retrieveAgencies,
            int resolutionDepth4)
        {
            if (sdmxObjects == null)
                throw new ArgumentException("Cannot instantiate a StructureWorkspace with beans as a null reference.");

            this._sdmxObjects = sdmxObjects;
            this._retrievalManager = retrievalManager;
            this._retrieveCrossRefefences = retrieveCrossReferences;
            this._retrieveAgencies = retrieveAgencies;
            this._resolutionDepth = resolutionDepth4;
            this.Init();
        }
 /// <summary>
 ///   Initializes a new instance of the <see cref="CrossReferenceResolverEngineCore" /> class.
 /// </summary>
 /// <param name="structureRetrievalManager"> The structure retrieval manager. </param>
 public CrossReferenceResolverEngineCore(IIdentifiableRetrievalManager structureRetrievalManager, IMaintainableCrossReferenceRetrieverEngine maintainableCrossReferenceRetrieverEngine)
 {
     this._maintainableCrossReferenceRetrieverEngine = maintainableCrossReferenceRetrieverEngine;
     this._crossReferences = new DictionaryOfSets<IIdentifiableObject, IIdentifiableObject>();
     this._agencies = new Dictionary<string, IAgency>(StringComparer.Ordinal);
     this._allIdentifiables = new Dictionary<Uri, IIdentifiableObject>();
 }
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////
        //////////////////AGENCY REFERENCES                                            ///////////////////////////////
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        ///   The resolve agency.
        /// </summary>
        /// <param name="maintainable"> The maintainable. </param>
        /// <param name="sdmxObjectRetrievalManager"> </param>
        private void ResolveAgency(IMaintainableObject maintainable, IIdentifiableRetrievalManager sdmxObjectRetrievalManager)
        {
            if (!this._resolveAgencies)
            {
                return;
            }

            if (maintainable.AgencyId.Equals(AgencyScheme.DefaultScheme))
            {
                return;
            }

            IAgency agency = this.ResolveAgency(maintainable.AgencyId, sdmxObjectRetrievalManager);
            this._agencies.Add(agency.Id, agency);
            this.StoreRef(maintainable, agency);
        }
        /// <summary>
        ///   The resolve agency.
        /// </summary>
        /// <param name="agencyId"> The agency id. </param>
        /// <returns> The <see cref="IAgency" /> . </returns>
        /// <exception cref="SdmxReferenceException">
        ///   <see cref="ExceptionCode.ReferenceErrorUnresolvable" />
        /// </exception>
        private IAgency ResolveAgency(string agencyId, IIdentifiableRetrievalManager identifiableRetrievalManager)
        {
            IAgency agency;
            if (this._agencies.TryGetValue(agencyId, out agency))
            {
                return agency;
            }

            if (identifiableRetrievalManager != null)
            {
                string[] split = agencyId.Split(new[] { "\\." }, StringSplitOptions.RemoveEmptyEntries);
                string parentAgencyId = AgencyScheme.DefaultScheme;
                string targetAgencyId = agencyId;
                if (split.Length > 1)
                {
                    targetAgencyId = split[split.Length - 1];
                    split[split.Length - 1] = null;
                    string concat = "";
                    parentAgencyId = "";
                    foreach (string currentSplit in split)
                    {
                        if (currentSplit != null)
                            parentAgencyId += concat + currentSplit;

                        concat = ".";
                    }
                }
                IStructureReference agencyRef = new StructureReferenceImpl(parentAgencyId, AgencyScheme.FixedId, AgencyScheme.FixedVersion, SdmxStructureEnumType.Agency, targetAgencyId);
                agency = identifiableRetrievalManager.GetIdentifiableObject<IAgency>(agencyRef);
            }

            if (agency == null)
            {
                throw new SdmxReferenceException(AgencyRef(agencyId));
            }

            return agency;
        }
        /// <summary>
        ///   The resolve references.
        /// </summary>
        /// <param name="beans"> The sdmxObjects. </param>
        /// <param name="resolveAgencies"> The resolve agencies 0. </param>
        /// <param name="numberLevelsDeep"> The number levels deep. </param>
        /// <param name="retrievalManager"> The retrieval manager. </param>
        /// <param name="populateMap"> The populate map. </param>
        /// <returns> The <see cref="IDictionary{TKey,TValue}" /> . </returns>
        private IDictionaryOfSets<IIdentifiableObject, IIdentifiableObject> ResolveReferences(
            ISdmxObjects beans,
            bool resolveAgencies,
            int numberLevelsDeep,
            IIdentifiableRetrievalManager retrievalManager,
            IDictionary<IIdentifiableObject, ISet<ICrossReference>> populateMap)
        {
            _log.Info("Resolve References, bean retrieval manager: " + retrievalManager);

            this.ResetMaps();
            this._resolveAgencies = resolveAgencies;
            IDictionaryOfSets<IIdentifiableObject, IIdentifiableObject> returnMap;
            int numberBeansLast = 0;
            int numberReferencesLast = 0;

            int numberBeansCurrent = -1;
            int numberReferencesCurrent = -1;

            ISdmxObjects allBeans = beans;

            int currentLevel = 1;
            do
            {
                _log.Debug("numberBeansLast= " + numberBeansLast);
                _log.Debug("numberReferencesLast= " + numberReferencesLast);

                numberBeansLast = numberBeansCurrent;
                numberReferencesLast = numberReferencesCurrent;
                returnMap = this.ResolveReferencesInternal(allBeans, retrievalManager, populateMap);
                numberBeansCurrent = returnMap.Count;
                numberReferencesCurrent = CountValues(returnMap);

                allBeans = new SdmxObjectsImpl(beans);

                foreach (ISet<IIdentifiableObject> currentBeanSet in returnMap.Values)
                {
                    foreach (IIdentifiableObject currentBean in currentBeanSet)
                    {
                        allBeans.AddIdentifiable(currentBean);
                    }
                }

                _log.Debug("numberBeansLast= " + numberBeansLast);
                _log.Debug("numberReferencesLast= " + numberReferencesLast);
                _log.Debug("numberBeansCurrent= " + numberBeansCurrent);
                _log.Debug("numberReferencesCurrent= " + numberReferencesCurrent);
                _log.Debug("currentLevel= " + currentLevel);
                _log.Debug("numberLevelsDeep= " + numberLevelsDeep);

                if (currentLevel == numberLevelsDeep)
                {
                    break;
                }

                currentLevel++;
            }
            while (numberBeansCurrent != numberBeansLast || numberReferencesCurrent != numberReferencesLast);

            return returnMap;
        }
        /// <summary>
        ///   The resolve references internal.
        /// </summary>
        /// <param name="sdmxObjects"> The sdmxObjects. </param>
        /// <param name="retrievalManager"> The retrieval manager. </param>
        /// <param name="populateMissingMap"> The populate missing map. </param>
        /// <returns> The <see cref="IIdentifiableObject" /> dictionary. </returns>
        /// <exception cref="CrossReferenceException">Reference error</exception>
        private IDictionaryOfSets<IIdentifiableObject, IIdentifiableObject> ResolveReferencesInternal(
            ISdmxObjects sdmxObjects,
            IIdentifiableRetrievalManager retrievalManager,
            IDictionary<IIdentifiableObject, ISet<ICrossReference>> populateMissingMap)
        {
            _log.Info("Resolve References, bean retrieval manager: " + retrievalManager);

            /* foreach */
            foreach (IAgency currentAgency in sdmxObjects.Agencies)
            {
                this._agencies.Add(currentAgency.FullId, currentAgency);
            }

            // Add all the top level sdmxObjects to the maintainables list
            this.AddObjectsToMap(sdmxObjects);

            // LOOP THROUGH ALL THE BEANS AND RESOLVE ALL THE REFERENCES
            if (this._resolveAgencies)
            {
                /* foreach */
                foreach (IMaintainableObject currentBean in sdmxObjects.GetAllMaintainables())
                {
                    try
                    {
                        this.ResolveAgency(currentBean, retrievalManager);
                    }
                    catch (CrossReferenceException e)
                    {
                        throw new SdmxReferenceException(e,
                            AgencyRef(currentBean.AgencyId));
                    }
                }
            }

            ISet<IMaintainableObject> loopSet = new HashSet<IMaintainableObject>();
            loopSet.AddAll(sdmxObjects.GetAllMaintainables());
            ISdmxObjectRetrievalManager retMan = new InMemoryRetrievalManager(sdmxObjects);

            /* foreach */
            foreach (IMaintainableObject currentMaintainable in loopSet)
            {
                this._log.Debug("Resolving References For : " + currentMaintainable.Urn);
                ISet<ICrossReference> crossReferences0;
                if (_maintainableCrossReferenceRetrieverEngine != null)
                {
                    crossReferences0 = _maintainableCrossReferenceRetrieverEngine.GetCrossReferences(retMan, currentMaintainable);
                }
                else
                {
                    crossReferences0 = currentMaintainable.CrossReferences;
                }
                this._log.Debug("Number of References : " + crossReferences0.Count);
                int i = 0;

                /* foreach */
                foreach (ICrossReference crossReference in crossReferences0)
                {
                    i++;
                    if (this._log.IsDebugEnabled)
                    {
                        this._log.Debug(
                            "Resolving Reference " + i + ": " + crossReference + " - referenced from -"
                            + crossReference.ReferencedFrom.StructureType);
                    }

                    try
                    {
                        this.StoreRef(
                            crossReference.ReferencedFrom, this.ResolveCrossReference(crossReference, retrievalManager));
                    }
                    catch (CrossReferenceException e)
                    {
                        if (populateMissingMap == null)
                        {
                            throw;
                        }
                        
                        HandleMissingReference(e, populateMissingMap);
                        //throw new ReferenceException(e, "Reference from structure '" + currentMaintainable.Urn + "' can not be resolved");
                    }
                }
            }

            return this._crossReferences;
        }
        /// <summary>
        ///   For the included <paramref name="sdmxObjects" />, returns a map of agency URN to maintainable Bean that references the agency
        /// </summary>
        /// <param name="sdmxObjects"> The included <c>SDMX</c> objects </param>
        /// <param name="retrievalManager"> The <see cref="ISdmxObjectRetrievalManager" /> </param>
        /// <returns> The included <paramref name="sdmxObjects" /> , returns a map of agency URN to maintainable Bean that references the agency </returns>
        public virtual IDictionary<string, ISet<IMaintainableObject>> GetMissingAgencies(ISdmxObjects sdmxObjects,
                                    IIdentifiableRetrievalManager identifiableRetrievalManager)
        {
            ISet<string> agencyIds = new HashSet<string>();

            /* foreach */
            ISet<IAgency> agencies = sdmxObjects.Agencies;
            foreach (IAgency acy in agencies)
            {
                agencyIds.Add(acy.FullId);
            }

            IDictionary<string, ISet<IMaintainableObject>> returnMap =
                new Dictionary<string, ISet<IMaintainableObject>>();

            /* foreach */
            ISet<IMaintainableObject> maintainableObjects = sdmxObjects.GetAllMaintainables();
            foreach (IMaintainableObject currentMaint in maintainableObjects)
            {
                string referencedAgencyId = currentMaint.AgencyId;
                if (!agencyIds.Contains(referencedAgencyId))
                {
                    if (identifiableRetrievalManager != null)
                    {
                        try
                        {
                            IAgency acy0 = ResolveAgency(referencedAgencyId, identifiableRetrievalManager);
                            if (acy0 != null)
                            {
                                agencyIds.Add(acy0.FullId);
                                continue;
                            }
                        }
                        catch (Exception th)
                        {
                            Console.Error.WriteLine(th.StackTrace);
                        }
                    }

                    ISet<IMaintainableObject> maintainables;
                    if (!returnMap.TryGetValue(referencedAgencyId, out maintainables))
                    {
                        maintainables = new HashSet<IMaintainableObject>();
                        returnMap.Add(referencedAgencyId, maintainables);
                    }

                    maintainables.Add(currentMaint);
                }
            }

            return returnMap;
        }
 /// <summary>
 ///   Resolves all references and returns a Map containing all the input sdmxObjects and the objects that are cross referenced,
 ///   the Map's key set contains the Identifiable that is the referencing object and the Map's value collection contains the referenced artifacts.
 /// </summary>
 /// <param name="beans"> - the <see cref="ISdmxObjects" /> container, containing all the sdmxObjects to check references for </param>
 /// <param name="resolveAgencies"> - if true the resolver engine will also attempt to resolve referenced agencies </param>
 /// <param name="numberLevelsDeep"> references, an argument of 0 (zero) implies there is no limit, and the resolver engine will continue re-cursing until it has found every directly and indirectly referenced artifact. Note that there is no risk of infinite recursion in calling this. </param>
 /// <param name="retrievalManager"> - Used to resolve the structure references. Can be null, if supplied this is used to resolve any references that do not exist in the supplied sdmxObjects </param>
 /// <returns> Map of referencing versus references </returns>
 /// <exception cref="CrossReferenceException">- if any of the references could not be resolved</exception>
 public virtual IDictionaryOfSets<IIdentifiableObject, IIdentifiableObject> ResolveReferences(
     ISdmxObjects beans, bool resolveAgencies, int numberLevelsDeep, IIdentifiableRetrievalManager retrievalManager)
 {
     return this.ResolveReferences(beans, resolveAgencies, numberLevelsDeep, retrievalManager, null);
 }
        /// <summary>
        ///   Returns a set of structures that are directly referenced from this provision
        /// </summary>
        /// <param name="provision"> - the provision to resolve the references for </param>
        /// <param name="structRetrievalManager"> - must not be null as this will be used to resolve the references </param>
        /// <returns> a set of structures that are directly referenced from this provision </returns>
        public virtual ISet<IIdentifiableObject> ResolveReferences(
            IProvisionAgreementObject provision, IIdentifiableRetrievalManager structRetrievalManager)
        {
            if (structRetrievalManager == null)
            {
                throw new ArgumentNullException("structRetrievalManager", "StructureRetrievalManager can not be null");
            }

            ISet<IIdentifiableObject> returnSet = new HashSet<IIdentifiableObject>();
            if (provision.StructureUseage != null)
            {
                IIdentifiableObject structureUseage =
                    structRetrievalManager.GetIdentifiableObject(provision.StructureUseage);

                if (structureUseage == null)
                {
                    throw new CrossReferenceException(
                        provision.StructureUseage);
                }

                returnSet.Add(structureUseage);
            }

            if (provision.DataproviderRef != null)
            {
                IIdentifiableObject dataProvider = structRetrievalManager.GetIdentifiableObject(provision.DataproviderRef);
                if (dataProvider == null)
                    throw new CrossReferenceException(provision.DataproviderRef);

                returnSet.Add(dataProvider);
            }

            return returnSet;
        }
        /// <summary>
        ///   Resolves a reference from <paramref name="crossReference" />
        /// </summary>
        /// <param name="crossReference"> The cross reference instance </param>
        /// <param name="structRetrievalManager"> The structure Retrieval Manager. </param>
        /// <returns> a reference from <paramref name="crossReference" /> </returns>
        public virtual IIdentifiableObject ResolveCrossReference(
            ICrossReference crossReference, IIdentifiableRetrievalManager structRetrievalManager)
        {
            if (crossReference.TargetReference.EnumType == SdmxStructureEnumType.Agency)
            {
                return this.ResolveAgency(crossReference.ChildReference.Id, structRetrievalManager);
            }

            IIdentifiableObject resolvedIdentifiable = ResolveMaintainableFromLocalMaps(crossReference);
            if (resolvedIdentifiable != null)
            {
                return resolvedIdentifiable;
            }

            IIdentifiableObject identifiableBean = null;

            if (structRetrievalManager != null)
            {
                _log.Info("IdentifiableBean '" + crossReference + "' not found locally, check IdentifiableRetrievalManager");
                identifiableBean = structRetrievalManager.GetIdentifiableObject(crossReference);
            }

            if (identifiableBean == null)
            {
                throw new CrossReferenceException(crossReference);
            }

            AddMaintainableToMap(identifiableBean.MaintainableParent);
            return identifiableBean;
        }
 /// <summary>
 ///   Gets a Dictionary of <see cref="IIdentifiableObject" /> alongside any cross references they declare that could not be found in the set of
 ///   <paramref name="beans" />
 ///   provided, and the <paramref name="retrievalManager" /> (if given).
 ///   <p />
 ///   <b>NOTE :</b>An empty Map is returned if all cross references are present.
 /// </summary>
 /// <param name="beans"> - the objects to return the Map of missing references for </param>
 /// <param name="numberLevelsDeep"> references, an argument of 0 (zero) implies there is no limit, and the resolver engine will continue re-cursing until it has found every directly and indirectly referenced </param>
 /// <param name="retrievalManager"> - Used to resolve the structure references. Can be null, if supplied this is used to resolve any references that do not exist in the supplied sdmxObjects </param>
 /// <returns> Map of IIdentifiableObject with a Set of CrossReferences that could not be resolved for the IIdentifiableObject - an empty Map is returned if all cross references are present </returns>
 public virtual IDictionary<IIdentifiableObject, ISet<ICrossReference>> GetMissingCrossReferences(
     ISdmxObjects beans, int numberLevelsDeep, IIdentifiableRetrievalManager retrievalManager)
 {
     IDictionary<IIdentifiableObject, ISet<ICrossReference>> returnMap =
         new Dictionary<IIdentifiableObject, ISet<ICrossReference>>();
     this.ResolveReferences(beans, false, numberLevelsDeep, retrievalManager, returnMap);
     return returnMap;
 }