Implement DB based version search
[smart-dao.git] / smart-version / smart-version-jgit-impl / src / main / java / com / smartitengineering / version / impl / jgit / JGitDaoExtension.java
blob98f53f3a2fe0f2ee8bafe70e8a84ccfe02f837e8
1 /*
2 * This is a common dao with basic CRUD operations and is not limited to any
3 * persistent layer implementation
4 *
5 * Copyright (C) 2008 Imran M Yousuf (imyousuf@smartitengineering.com)
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 package com.smartitengineering.version.impl.jgit;
21 import java.io.IOException;
22 import java.util.Map;
24 /**
25 * A JGit DAO Extension to support reading blob objects from repository for git
26 * object id.
27 * @author imyousuf
29 public interface JGitDaoExtension {
31 /**
32 * Read blob objects from git repository by their objectId of git (not their
33 * path)
34 * @param objectIds Ids of object to read.
35 * @return Blobs represented by their objectId as key
36 * @throws java.io.IOException If and only if JGit throws it
37 * @throws java.lang.IllegalArgumentException If any object id of the objectIds isn't
38 * a blob's id
40 public Map<String, byte[]> readBlobObjects(String... objectIds)
41 throws IOException,
42 IllegalArgumentException;
44 /**
46 * @param objectId
47 * @return
48 * @throws java.io.IOException If and only if JGit throws it
49 * @throws java.lang.IllegalArgumentException If object id isn't a blob's
50 * id
52 public byte[] readObject(String objectId)
53 throws IOException,
54 IllegalArgumentException;