Examples of FudgeDeserializer


Examples of org.fudgemsg.mapping.FudgeDeserializer

   *
   * @param msg  the message, not null
   * @param subHandle  the subscription handle, not null
   */
  private void dispatchSnapshotResponse(FudgeMsg msg, SubscriptionHandle subHandle) {
    CogdaLiveDataSnapshotResponseMessage responseMessage = CogdaLiveDataSnapshotResponseBuilder.buildObjectStatic(new FudgeDeserializer(getFudgeContext()), msg);
    LiveDataSpecification ldSpec = new LiveDataSpecification(responseMessage.getNormalizationScheme(), responseMessage.getSubscriptionId());
   
    LiveDataSubscriptionResult ldsResult = responseMessage.getGenericResult().toLiveDataSubscriptionResult();
    LiveDataSubscriptionResponse ldsResponse = new LiveDataSubscriptionResponse(subHandle.getRequestedSpecification(), ldsResult);
    ldsResponse.setFullyQualifiedSpecification(ldSpec);
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

   *
   * @param msg  the message, not null
   * @param subHandle  the subscription handle, not null
   */
  private void dispatchSubscriptionResponse(FudgeMsg msg, SubscriptionHandle subHandle) {
    CogdaLiveDataSubscriptionResponseMessage responseMessage = CogdaLiveDataSubscriptionResponseBuilder.buildObjectStatic(new FudgeDeserializer(getFudgeContext()), msg);
    LiveDataSpecification ldSpec = new LiveDataSpecification(responseMessage.getNormalizationScheme(), responseMessage.getSubscriptionId());
   
    LiveDataSubscriptionResult ldsResult = responseMessage.getGenericResult().toLiveDataSubscriptionResult();
    LiveDataSubscriptionResponse ldsResponse = new LiveDataSubscriptionResponse(subHandle.getRequestedSpecification(), ldsResult);
    ldsResponse.setFullyQualifiedSpecification(ldSpec);
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

    requestMessage.setUserName(_user.getUserName());
    _messageSender.send(ConnectionRequestBuilder.buildMessageStatic(new FudgeSerializer(getFudgeContext()), requestMessage));
    // TODO kirk 2012-08-22 -- This needs a timeout.
    FudgeMsgReader reader = getFudgeContext().createMessageReader(is);
    FudgeMsg msg = reader.nextMessage();
    ConnectionResponseMessage response = ConnectionResponseBuilder.buildObjectStatic(new FudgeDeserializer(getFudgeContext()), msg);
    switch(response.getResult()) {
      case NEW_CONNECTION_SUCCESS:
      case EXISTING_CONNECTION_RESTART:
        // We're good to go!
        // TODO kirk 2012-08-15 -- Add logic eventually for connection restart semantics.
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

    FudgeMsg heartbeatMsg = heartbeatEnvelope.getMessage();
    messageReceived(heartbeatMsg);
  }

  public void messageReceived(FudgeMsg msg) {
    Heartbeat heartbeat = Heartbeat.fromFudgeMsg(new FudgeDeserializer(_fudgeContext), msg);
    s_logger.debug("Heartbeat received for: {}", heartbeat.getLiveDataSpecifications());
    getActiveSecurityPublicationManager().extendPublicationTimeout(heartbeat.getLiveDataSpecifications());
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

      @Override
      public void messageReceived(FudgeContext fudgeContext,
          FudgeMsgEnvelope msgEnvelope) {
       
        FudgeMsg msg = msgEnvelope.getMessage();
        EntitlementResponseMsg responseMsg = EntitlementResponseMsg.fromFudgeMsg(new FudgeDeserializer(fudgeContext), msg);
        for (EntitlementResponse response : responseMsg.getResponses()) {
          returnValue.put(response.getLiveDataSpecification(), response.getIsEntitled());
        }
        latch.countDown();
      }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

    assertNull(ObjectIdFudgeBuilder.toFudgeMsg(new FudgeSerializer(OpenGammaFudgeContext.getInstance()), null));
    assertNotNull(ObjectIdFudgeBuilder.toFudgeMsg(new FudgeSerializer(OpenGammaFudgeContext.getInstance()), sample));
  }

  public void test_fromFudgeMsg() {
    assertNull(ObjectIdFudgeBuilder.fromFudgeMsg(new FudgeDeserializer(OpenGammaFudgeContext.getInstance()), null));
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

  }

  @Test(expectedExceptions = RuntimeException.class)
  public void test_fromFudgeMsg_empty() {
    FudgeMsg msg = getFudgeContext().newMessage();
    assertNull(ObjectIdFudgeBuilder.fromFudgeMsg(new FudgeDeserializer(OpenGammaFudgeContext.getInstance()), msg));
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

    assertNull(ExternalIdFudgeBuilder.toFudgeMsg(new FudgeSerializer(OpenGammaFudgeContext.getInstance()), null));
    assertNotNull(ExternalIdFudgeBuilder.toFudgeMsg(new FudgeSerializer(OpenGammaFudgeContext.getInstance()), sample));
  }

  public void test_fromFudgeMsg() {
    assertNull(ExternalIdFudgeBuilder.fromFudgeMsg(new FudgeDeserializer(OpenGammaFudgeContext.getInstance()), null));
  }
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

  @POST
  @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");
    LocalDate end = deserializationContext.fieldValueToObject(LocalDate.class, msg.getByName("end"));
    boolean includeEnd = msg.getBoolean("includeEnd");
   
    Map<ExternalIdBundle, HistoricalTimeSeries> result = getHistoricalTimeSeriesSource().getHistoricalTimeSeries(
        identifierSet, dataSource, dataProvider, dataField, start, inclusiveStart, end, includeEnd);
    return responseOkFudge(FudgeMapWrapper.of(result));
View Full Code Here

Examples of org.fudgemsg.mapping.FudgeDeserializer

    assertEquals(log.getLogLevels(), EnumSet.of(LogLevel.ERROR, LogLevel.INFO, LogLevel.WARN));
    FudgeSerializer serializer = new FudgeSerializer(OpenGammaFudgeContext.getInstance());
    ExecutionLogFudgeBuilder builder = new ExecutionLogFudgeBuilder();
    FudgeMsg msg = builder.buildMessage(serializer, log);

    FudgeDeserializer deserializer = new FudgeDeserializer(OpenGammaFudgeContext.getInstance());
    ExecutionLog executionLog = builder.buildObject(deserializer, msg);
    assertEquals(EnumSet.<LogLevel>of(LogLevel.ERROR, LogLevel.INFO, LogLevel.WARN), executionLog.getLogLevels());
    List<LogEvent> events = executionLog.getEvents();
    assertTrue(events.contains(errorEvent));
    assertTrue(events.contains(infoEvent1));
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.