Package org.fudgemsg

Examples of org.fudgemsg.FudgeMsgEnvelope


      final MutableFudgeMsg submsg = serializer.newMessage();
      submsg.add("uniqueId", function.getUniqueId());
      serializer.addToMessageWithClassHeaders(submsg, "defaultParameters", null, function.getDefaultParameters(), FunctionParameters.class);
      msg.add(function.getShortName(), submsg);
    }
    return responseOk(new FudgeMsgEnvelope(msg));
  }
View Full Code Here


  }

  //-------------------------------------------------------------------------
  @Override
  public void messageReceived(byte[] message) {
    FudgeMsgEnvelope heartbeatEnvelope = getFudgeContext().deserialize(message);
    FudgeMsg heartbeatMsg = heartbeatEnvelope.getMessage();
    messageReceived(heartbeatMsg);
  }
View Full Code Here

    addExternalIdBundles();
    _totalConfigs = 6;
  }

  private void addExternalIds() {
    FudgeMsgEnvelope env = s_fudgeContext.toFudgeMsg(ExternalId.of("A", "B"));
    byte[] bytes = s_fudgeContext.toByteArray(env.getMessage());
    String cls = ExternalId.class.getName();
    LobHandler lobHandler = new DefaultLobHandler();
    final JdbcOperations template = _cfgMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        101, 101, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, "TestConfig101", cls,
View Full Code Here

        new SqlParameterValue(Types.BLOB, new SqlLobValue(bytes, lobHandler)));
    _totalExternalIds = 3;
  }
 
  private void addExternalIdBundles() {
    FudgeMsgEnvelope env = s_fudgeContext.toFudgeMsg(ExternalIdBundle.of(ExternalId.of("C", "D"), ExternalId.of("E", "F")));
    byte[] bytes = s_fudgeContext.toByteArray(env.getMessage());
    String cls = ExternalIdBundle.class.getName();
    LobHandler lobHandler = new DefaultLobHandler();
    final JdbcOperations template = _cfgMaster.getDbConnector().getJdbcOperations();
    template.update("INSERT INTO cfg_config VALUES (?,?,?,?,?, ?,?,?,?)",
        301, 301, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, toSqlTimestamp(_version1aInstant), MAX_SQL_TIMESTAMP, "TestConfig301", cls,
View Full Code Here

        ImmutableLocalDateDoubleTimeSeries.of(TIMES, VALUES));
    cycleTimeSeries(simpleHistoricalTimeSeries);
  }

  private void cycleTimeSeries(final SimpleHistoricalTimeSeries original) {
    FudgeMsgEnvelope msgEnvelope = _fudgeContext.toFudgeMsg(original);
    assertNotNull(msgEnvelope);
    SimpleHistoricalTimeSeries fromFudgeMsg = _fudgeContext.fromFudgeMsg(SimpleHistoricalTimeSeries.class, msgEnvelope.getMessage());
    assertTrue(original != fromFudgeMsg);
    assertEquals(original, fromFudgeMsg);
  }
View Full Code Here

  @Path("debugInfo")
  public FudgeMsgEnvelope getDebugInfo() {
    final MutableFudgeMsg message = OpenGammaFudgeContext.getInstance().newMessage();
    message.add("fudgeContext", OpenGammaFudgeContext.getInstance().toString());
    message.add("historicalTimeSeriesSource", getHistoricalTimeSeriesSource().toString());
    return new FudgeMsgEnvelope(message);
  }
View Full Code Here

  }

  @GET
  public FudgeMsgEnvelope getResource() {
    final FudgeSerializer serializer = new FudgeSerializer(getFudgeContext());
    return new FudgeMsgEnvelope(mapToMessage(serializer, getResources()));
  }
View Full Code Here

   *
   * @param event  the event that occurred, not null
   */
  @Override
  protected void handleEntityChanged(final ChangeEvent event) {
    final FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().toFudgeMsg(event);
    s_logger.debug("Sending change message {}", msg);
    final byte[] fudgeMsg = OpenGammaFudgeContext.getInstance().toByteArray(msg.getMessage());
    final JmsByteArrayMessageSender messageSender = new JmsByteArrayMessageSender(getJmsConnector().getTopicName(), getJmsConnector().getJmsTemplateTopic());
    messageSender.send(fudgeMsg);
  }
View Full Code Here

      });
      return ccy;
    } else if (security instanceof RawSecurity) {
      final RawSecurity rawSecurity = (RawSecurity) security;
      if (security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE)) {
        final FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().deserialize(rawSecurity.getRawData());
        final SecurityEntryData securityEntryData = OpenGammaFudgeContext.getInstance().fromFudgeMsg(SecurityEntryData.class, msg.getMessage());
        return securityEntryData.getCurrency();
      }
    }

    return null;
View Full Code Here

      });
      return ccy;
    } else if (security instanceof RawSecurity) {
      final RawSecurity rawSecurity = (RawSecurity) security;
      if (security.getSecurityType().equals(SecurityEntryData.EXTERNAL_SENSITIVITIES_SECURITY_TYPE)) {
        final FudgeMsgEnvelope msg = OpenGammaFudgeContext.getInstance().deserialize(rawSecurity.getRawData());
        final SecurityEntryData securityEntryData = OpenGammaFudgeContext.getInstance().fromFudgeMsg(SecurityEntryData.class, msg.getMessage());
        return Collections.singleton(securityEntryData.getCurrency());
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.fudgemsg.FudgeMsgEnvelope

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.