Package com.opengamma.financial.convention

Examples of com.opengamma.financial.convention.ConventionDocument


    }

    @Override
    public ConventionDocument buildObject(final FudgeDeserializer deserializer, final FudgeMsg message) {
      final Convention convention = (Convention) deserializer.fieldValueToObject(message.getByName(CONVENTION_FIELD));
      return new ConventionDocument(convention);
    }
View Full Code Here


  //-------------------------------------------------------------------------
  @GET
  public Response get(@QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo) {
    VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo);
    ConventionDocument result = getConventionMaster().get(getUrlConventionId(), vc);
    return responseOkFudge(result);
  }
View Full Code Here

  @POST
  public Response update(@Context UriInfo uriInfo, ConventionDocument request) {
    if (getUrlConventionId().equals(request.getUniqueId().getObjectId()) == false) {
      throw new IllegalArgumentException("Document objectId does not match URI");
    }
    ConventionDocument result = getConventionMaster().update(request);
    URI uri = uriVersion(uriInfo.getBaseUri(), result.getUniqueId());
    return responseCreatedFudge(uri, result);
  }
View Full Code Here

  @GET
  @Path("versions/{versionId}")
  public Response getVersioned(@PathParam("versionId") String versionId) {
    UniqueId uniqueId = getUrlConventionId().atVersion(versionId);
    ConventionDocument result = getConventionMaster().get(uniqueId);
    return responseOkFudge(result);
  }
View Full Code Here

  public Response correct(@Context UriInfo uriInfo, @PathParam("versionId") String versionId, ConventionDocument document) {
    UniqueId uniqueId = getUrlConventionId().atVersion(versionId);
    if (!uniqueId.equals(document.getUniqueId())) {
      throw new IllegalArgumentException("Document uniqueId does not match URI");
    }
    ConventionDocument result = getConventionMaster().correct(document);
    URI uri = uriVersion(uriInfo.getBaseUri(), result.getUniqueId());
    return responseCreatedFudge(uri, result);
  }
View Full Code Here

  }

  @POST
  @Path("conventions")
  public Response add(@Context UriInfo uriInfo, ConventionDocument convention) {
    ConventionDocument result = getConventionMaster().add(convention);
    URI createdUri = DataConfigResource.uriVersion(uriInfo.getBaseUri(), result.getUniqueId());
    return responseCreatedFudge(createdUri, result);
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Override
  public UniqueId add(final Convention convention) {
    return add(new ConventionDocument(convention)).getUniqueId();
  }
View Full Code Here

TOP

Related Classes of com.opengamma.financial.convention.ConventionDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.