1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.bitrepository.service.contributor.handler;
23
24 import org.bitrepository.bitrepositoryelements.StatusCode;
25 import org.bitrepository.bitrepositoryelements.StatusInfo;
26 import org.bitrepository.bitrepositorymessages.GetStatusFinalResponse;
27 import org.bitrepository.bitrepositorymessages.IdentifyContributorsForGetStatusRequest;
28 import org.bitrepository.bitrepositorymessages.IdentifyContributorsForGetStatusResponse;
29 import org.bitrepository.bitrepositorymessages.MessageResponse;
30 import org.bitrepository.common.utils.ResponseInfoUtils;
31 import org.bitrepository.service.contributor.ContributorContext;
32
33
34
35
36 public class IdentifyContributorsForGetStatusRequestHandler
37 extends AbstractRequestHandler<IdentifyContributorsForGetStatusRequest> {
38
39
40
41
42
43 public IdentifyContributorsForGetStatusRequestHandler(ContributorContext context) {
44 super(context);
45 }
46
47 @Override
48 public Class<IdentifyContributorsForGetStatusRequest> getRequestClass() {
49 return IdentifyContributorsForGetStatusRequest.class;
50 }
51
52 @Override
53 public void processRequest(IdentifyContributorsForGetStatusRequest request) {
54 IdentifyContributorsForGetStatusResponse response = new IdentifyContributorsForGetStatusResponse();
55 response.setContributor(getContext().getSettings().getComponentID());
56 response.setResponseInfo(ResponseInfoUtils.getPositiveIdentification());
57 getContext().getResponseDispatcher().dispatchResponse(response, request);
58 }
59
60 @Override
61 public MessageResponse generateFailedResponse(IdentifyContributorsForGetStatusRequest request) {
62 GetStatusFinalResponse response = new GetStatusFinalResponse();
63 return response;
64 }
65
66
67
68
69
70 protected StatusInfo getStatus() {
71 StatusInfo status = new StatusInfo();
72 status.setStatusCode(StatusCode.OK);
73 status.setStatusText("Ok");
74 return status;
75 }
76 }