Examples of fudgeMsgToObject()


Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance());
    FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    List<DBObject> objects = new ArrayList<DBObject>();
    for (PersistentSubscription sub : newState) {
      FudgeMsg msg = LiveDataSpecificationFudgeBuilder.toFudgeMsg(serializer, sub.getFullyQualifiedSpec());
      DBObject fieldData = deserializer.fudgeMsgToObject(DBObject.class, msg);
      BasicDBObject mainObject = new BasicDBObject();
      mainObject.append("fieldData", fieldData);
      objects.add(mainObject);
    }
    _mongoCollection.insert(objects);
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

  @Path("htsSearches/bulk")
  public Response searchBulk(FudgeMsgEnvelope request) {
    // non-ideal variant using POST
    FudgeMsg msg = request.getMessage();
    FudgeDeserializer deserializationContext = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    Set<ExternalIdBundle> identifierSet = deserializationContext.fudgeMsgToObject(Set.class, msg.getMessage("id"));
    String dataSource = msg.getString("dataSource");
    String dataProvider = msg.getString("dataProvider");
    String dataField = msg.getString("dataField");
    LocalDate start = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("start"));
    boolean inclusiveStart = msg.getBoolean("includeStart");
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    try {
      final FudgeContext context = getFudgeContext();
      final FudgeSerializer fsc = new FudgeSerializer(context);
      final FudgeDeserializer fdc = new FudgeDeserializer(context);
      final FudgeMsg response = accessRemote(uri).post(FudgeMsg.class, FudgeSerializer.addClassHeader(fsc.objectToFudgeMsg(target), target.getClass(), TempTarget.class));
      return fdc.fudgeMsgToObject(UniqueId.class, response);
    } catch (final UniformInterfaceException404NotFound e) {
      return null;
    }
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

  public TempTarget get(final UniqueId identifier) {
    final URI uri = DataTempTargetSourceResource.uriGet(getBaseUri(), identifier);
    try {
      final FudgeDeserializer fdc = new FudgeDeserializer(getFudgeContext());
      final FudgeMsg response = accessRemote(uri).get(FudgeMsg.class);
      return fdc.fudgeMsgToObject(TempTarget.class, response);
    } catch (final UniformInterfaceException404NotFound e) {
      return null;
    }
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

  @Override
  public void messageReceived(FudgeContext fudgeContext, FudgeMsgEnvelope msgEnvelope) {
    final FudgeMsg msg = msgEnvelope.getMessage();
    s_logger.debug("Received change message {}", msg);
    final FudgeDeserializer deserializer = new FudgeDeserializer(fudgeContext);
    final ChangeEvent event = deserializer.fudgeMsgToObject(ChangeEvent.class, msg);
    fireEntityChanged(event);
  }

  //-------------------------------------------------------------------------
  /**
 
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    return s_fudgeContext.toByteArray(msg);
  }

  private static TempTarget fromByteArray(final byte[] data) {
    final FudgeDeserializer deserializer = new FudgeDeserializer(s_fudgeContext);
    return deserializer.fudgeMsgToObject(TempTarget.class, s_fudgeContext.deserialize(data).getMessage());
  }

  protected Generation getOrCreateNewGeneration() {
    if (_new == null) {
      synchronized (this) {
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    FudgeMsg message = fudgeSerializationContext.objectToFudgeMsg(WriteReplaceHelper.writeReplace(object));
    assertNotNull(message);
    s_logger.info("message {}", message);
    message = cycleMessage(message);
    s_logger.info("message {}", message);
    final Object newObject = fudgeDeserializationContext.fudgeMsgToObject(message);
    assertNotNull(newObject);
    s_logger.info("object {}", newObject);
    assertTrue(clazz.isAssignableFrom(newObject.getClass()));
    assertEquals(object.getClass(), newObject.getClass());
    return (T) newObject;
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    FudgeMsg configsMessage = fudgeMsgReader.nextMessage();
    if (configsMessage == null) {
      s_logger.error("Error reading first message from XML stream");
      return;
    }
    Object object = deserializer.fudgeMsgToObject(FlexiBean.class, configsMessage);
    if (!(object instanceof FlexiBean)) {
      s_logger.error("XML Stream deserialised to object of type " + object.getClass() + ": " + object.toString());
      return;
    }
    FlexiBean wrapper = (FlexiBean) object;
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

      FudgeObjectReader objReader = s_fudgeContext.createObjectReader(new ByteArrayInputStream(bytes));
      FudgeMsg fudgeMsg = objReader.getMessageReader().nextMessage();
      try {

        FudgeDeserializer deserializer = new FudgeDeserializer(s_fudgeContext);
        Object configObj = deserializer.fudgeMsgToObject(reifiedType, fudgeMsg);
        ConfigItem<?> item = ConfigItem.of(configObj);
        item.setName(name);
        item.setType(reifiedType);
        ConfigDocument doc = new ConfigDocument(item);
        UniqueId uniqueId = createUniqueId(docOid, docId);
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer.fudgeMsgToObject()

    FudgeMsg message = context.createMessageReader(new ByteArrayInputStream(msg)).nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(context);
    return deser.fudgeMsgToObject(type, message);
  }

  //-------------------------------------------------------------------------
  /**
   * Encode an object to query parameters.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.