View Javadoc

1   /*
2    * #%L
3    * Bitrepository Access
4    * %%
5    * Copyright (C) 2010 - 2012 The State and University Library, The Royal Library and The State Archives, Denmark
6    * %%
7    * This program is free software: you can redistribute it and/or modify
8    * it under the terms of the GNU Lesser General Public License as 
9    * published by the Free Software Foundation, either version 2.1 of the 
10   * License, or (at your option) any later version.
11   * 
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Lesser Public License for more details.
16   * 
17   * You should have received a copy of the GNU General Lesser Public 
18   * License along with this program.  If not, see
19   * <http://www.gnu.org/licenses/lgpl-2.1.html>.
20   * #L%
21   */
22  package org.bitrepository.access.getchecksums.conversation;
23  
24  import java.net.URL;
25  import java.util.Collection;
26  
27  import org.bitrepository.access.ContributorQuery;
28  import org.bitrepository.bitrepositoryelements.ChecksumSpecTYPE;
29  import org.bitrepository.client.conversation.ConversationContext;
30  import org.bitrepository.client.eventhandler.EventHandler;
31  import org.bitrepository.common.settings.Settings;
32  import org.bitrepository.protocol.OperationType;
33  import org.bitrepository.protocol.messagebus.MessageSender;
34  
35  /**
36   * Encapsulates the context for a GetChecksums operation.
37   */
38  public class GetChecksumsConversationContext extends ConversationContext {
39      private final URL urlForResult;
40      private final ChecksumSpecTYPE checksumSpec;
41      private final ContributorQuery[] contributorQueries;
42  
43      /**
44       * Extends the {@link ConversationContext} constructor with
45       * {@link org.bitrepository.access.getchecksums.GetChecksumsClient} specific parameters.
46       * @param contributorQueries See {@link org.bitrepository.access.getchecksums.GetChecksumsClient} for details.
47       * @param urlForResult See {@link org.bitrepository.access.getchecksums.GetChecksumsClient} for details.
48       * @param checksumSpec See {@link org.bitrepository.access.getchecksums.GetChecksumsClient} for details.
49       */
50      public GetChecksumsConversationContext(
51              String collectionID,
52              ContributorQuery[] contributorQueries,
53              String fileID,
54              ChecksumSpecTYPE checksumSpec,
55              URL urlForResult,
56              Settings settings,
57              MessageSender messageSender,
58              String clientID,
59              Collection<String> contributors,
60              EventHandler eventHandler,
61              String auditTrailInformation) {
62          super(collectionID, OperationType.GET_CHECKSUMS, settings, messageSender, clientID, fileID, contributors,
63                  eventHandler, auditTrailInformation);
64          this.contributorQueries = contributorQueries;
65          this.urlForResult = urlForResult;
66          this.checksumSpec = checksumSpec;
67      }
68  
69      public ContributorQuery[] getContributorQueries() {
70          return contributorQueries;
71      }
72  
73      public URL getUrlForResult() {
74          return urlForResult;
75      }
76  
77      public ChecksumSpecTYPE getChecksumSpec() {
78          return checksumSpec;
79      }
80  }