package org.openslx.dozmod.util; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.LectureSummary; import org.openslx.dozmod.thrift.cache.LectureCache; import org.openslx.thrifthelper.TConst; import java.util.List; /** * Class with some temporally Helper Functions. */ public class ContainerUtils { /** * Checks ImageBaseId of image if already linked with existing Lectures in LectureCache. * * @param image The image to check. * @return true if the images imageBaseId is already linked with a lecture. */ public static boolean isContainerImageLinked(ImageSummaryRead image) { if (image != null && image.getVirtId().equals(TConst.VIRT_DOCKER)) { List lectureSummaries = LectureCache.get(true); for (LectureSummary lecture : lectureSummaries) { if (lecture.imageBaseId.equals(image.imageBaseId)) { return true; } } } return false; } }