class DataPositionSourceResource extends AbstractDataResource {

  @GET
  @Path("portfolios/{portfolioId}")
  public Response getPortfolio(
      @PathParam("portfolioId") String idStr,
      @QueryParam("version") String version,
      @QueryParam("versionAsOf") String versionAsOf,
      @QueryParam("correctedTo") String correctedTo) {
    final ObjectId objectId = ObjectId.parse(idStr);
    final VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo);
    if (version != null) {
      final Portfolio result = getPositionSource().getPortfolio(objectId.atVersion(version), vc);
      return responseOkObject(result);
    } else {
      final Portfolio result = getPositionSource().getPortfolio(objectId, vc);
      return responseOkObject(result);
    }
  }

  public  DataPositionSourceResource(final PositionSource positionSource);

}