コード例 #1
0
 @Override
 public void execute(
     OperationRequest operation, OperationContext context, ParticipantId participant)
     throws InvalidRequestException {
   FetchProfilesRequest request =
       OperationUtil.getRequiredParameter(operation, ParamsProperty.FETCH_PROFILES_REQUEST);
   List<String> requestAddresses = request.getParticipantIds();
   List<ParticipantProfile> profiles = Lists.newArrayListWithCapacity(requestAddresses.size());
   for (String address : requestAddresses) {
     ParticipantProfile participantProfile = profilesFetcher.fetchProfile(address);
     profiles.add(participantProfile);
   }
   FetchProfilesResult result = new FetchProfilesResult(profiles);
   Map<ParamsProperty, Object> data =
       ImmutableMap.<ParamsProperty, Object>of(ParamsProperty.FETCH_PROFILES_RESULT, result);
   context.constructResponse(operation, data);
 }
コード例 #2
0
 @Override
 public void execute(
     OperationRequest operation, OperationContext context, ParticipantId participant) {
   context.constructResponse(operation, Maps.<ParamsProperty, Object>newHashMap());
 }