View Javadoc

1   /**
2    * 
3    */
4   package edu.virginia.lib.ole.akubra;
5   
6   import java.io.IOException;
7   import java.net.URI;
8   import java.util.Map;
9   
10  import javax.transaction.Transaction;
11  
12  import org.akubraproject.BlobStore;
13  import org.akubraproject.BlobStoreConnection;
14  import org.akubraproject.impl.AbstractBlobStore;
15  
16  /**
17   * @author ajs6f
18   * @version 1.0
19   * @see org.akubraproject.BlobStore
20   */
21  public class TwoStore extends AbstractBlobStore {
22  
23  	private BlobStore left, right;
24  
25  	/**
26  	 * @param id {@link URI} identifier for this {@link org.akubraproject.BlobStore}
27  	 */
28  	public TwoStore(URI id) {
29  		super(id);
30  	}
31  	
32  	/**
33  	 * @param id {@link URI} identifier for this {@link org.akubraproject.BlobStore}
34  	 * @param left {@link URI} for the BlobStore on the left side
35  	 * @param right {@link URI} for the BlobStore on the right side
36  	 */
37  	public TwoStore(URI id, BlobStore left, BlobStore right) {
38  		super(id);
39  		this.left = left;
40  		this.right = right;
41  	}
42  
43  	/**
44  	 * @see org.akubraproject.BlobStore#openConnection(javax.transaction.Transaction, java.util.Map)
45  	 */
46  	@Override
47  	public BlobStoreConnection openConnection(Transaction tx,
48  			Map<String, String> hints) throws UnsupportedOperationException,
49  			IOException {
50  		return new TwoStoreConnection(this, hints);
51  	}
52  	
53  	/**
54  	 * @return {@link org.akubraproject.BlobStore} from the left side
55  	 */
56  	public BlobStore getLeft() {
57  		return left;
58  	}
59  
60  	/**
61  	 * @param left  {@link org.akubraproject.BlobStore} for the left side
62  	 */
63  	public void setLeft(BlobStore left) {
64  		this.left = left;
65  	}
66  	
67  	/** 
68  	 * @return {@link org.akubraproject.BlobStore} from the right side
69  	 */
70  	public BlobStore getRight() {
71  		return right;
72  	}
73  
74  	/**
75  	 * @param right  {@link org.akubraproject.BlobStore} for the right side
76  	 */
77  	public void setRight(BlobStore right) {
78  		this.right = right;
79  	}
80  
81  
82  }