001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.kernel.api.services; 007 008import org.fcrepo.kernel.api.RdfStream; 009import org.fcrepo.kernel.api.exception.UnsupportedAlgorithmException; 010import org.fcrepo.kernel.api.models.Binary; 011 012import java.net.URI; 013import java.util.Collection; 014 015/** 016 * Service which calculates and compares digests for binary objects 017 * 018 * @author peichman 019 */ 020public interface FixityService { 021 /** 022 * Calculate the requested set of digests for the provided binary 023 * @param binary the binary resource to 024 * @param algorithms set of digest algorithms to calculate 025 * @return list of calculated digests 026 * @throws UnsupportedAlgorithmException if unsupported digest algorithms were provided 027 */ 028 Collection<URI> getFixity(Binary binary, Collection<String> algorithms) throws UnsupportedAlgorithmException; 029 030 /** 031 * Digest this binary with the digest algorithms provided 032 * @param binary the binary resource to digest 033 * @return The result of the fixity check. 034 */ 035 RdfStream checkFixity(Binary binary); 036}