예제 #1
0
  @RequestMapping(
      value = ROOT_PARTITION_COLLECTION_REQUEST,
      method = {RequestMethod.POST})
  public void rootPartitionCollectionRequest(
      HttpServletRequest request,
      HttpServletResponse response,
      @RequestParam(value = "api", required = false) boolean api)
      throws IOException {

    if (apiRequested(response, api, ROOT_APPLICATION_COLLECTION_FOR_USER_REQUEST)) return;

    com.c9a.buffers.CatalogServiceRequestProtocalBuffer.GetRootPartitionCollectionRequest
        rootPartitionCollectionRequest =
            com.c9a.buffers.CatalogServiceRequestProtocalBuffer.GetRootPartitionCollectionRequest
                .parseFrom(GoogleProtoclBufferRequestContentUtils.getContentForRequest(request));

    List<CatalogCollection> rootPartitionCollection =
        catalogService.getRootCollectionForPartition(
            rootPartitionCollectionRequest.getPartitionId());

    CatalogGPBUtils.generateCatalogCollectionResponseProtoBuf(
            com.c9a.buffers.CatalogServiceResponseProtocalBuffer.ResponseCode.SUCCESS,
            "",
            rootPartitionCollection)
        .build()
        .writeTo(response.getOutputStream());
    return;
  }