public IRepositoryInfo GetRepositoryInfo(string repositoryId, IExtensionsData extension) { IRepositoryInfo result = null; bool hasExtension = (extension != null) && (extension.Extensions != null) && (extension.Extensions.Count > 0); RepositoryInfoCache cache = session.GetRepositoryInfoCache(); // if extension is not set, check the cache first if (!hasExtension) { result = cache.Get(repositoryId); if (result != null) { return(result); } } // it was not in the cache -> get the SPI and fetch the repository info ICmisSpi spi = session.GetSpi(); result = spi.GetRepositoryService().GetRepositoryInfo(repositoryId, extension); // put it into the cache if (!hasExtension) { cache.Put(result); } return(result); }
public IList <IRepositoryInfo> GetRepositoryInfos(IExtensionsData extension) { IList <IRepositoryInfo> result = null; bool hasExtension = (extension != null) && (extension.Extensions != null) && (extension.Extensions.Count > 0); // get the SPI and fetch the repository infos ICmisSpi spi = session.GetSpi(); result = spi.GetRepositoryService().GetRepositoryInfos(extension); // put it into the cache if (!hasExtension && (result != null)) { RepositoryInfoCache cache = session.GetRepositoryInfoCache(); foreach (IRepositoryInfo rid in result) { cache.Put(rid); } } return(result); }