Examples of Price


Examples of org.exoplatform.services.rest.generated.Price

      writer.writeTo(book, Book.class, Book.class, null, mediaType, null, new ByteArrayOutputStream());
   }

   private static Price createPrice(String currency, Float value)
   {
      Price price = new Price();
      price.setCurrency(currency);
      price.setValue(new BigDecimal(value));
      return price;
   }
View Full Code Here

Examples of org.jayasoft.woj.portal.model.Price

        Order o = new Order();
        o.setTotalCost(50.0d);
        Invoice i = new Invoice();
        PaymentInfo pi = new PaymentInfo();
        License l = new License();
        Price p = new Price();
        p.setPriceByYear(50);
        l.setPrice(p);
        pi.setLicenses(Collections.singleton(l));
        o.setPayments(Collections.singleton(pi));
        o.setInvoice(i);
        Purchaser pur = getPurchaser();
View Full Code Here

Examples of org.jclouds.ibm.smartcloud.domain.Price

               "SYSTEM",
               "SUSE Linux Enterprise Server/11",
               Image.Architecture.I386,
               new Date(1216944000000l),
               "41",
               ImmutableSet.<InstanceType> of(new InstanceType("Bronze 32 bit", new Price(0.17, "UHR  ", "897", null,
                        "USD", 1), "BRZ32.1/2048/175"), new InstanceType("Gold 32 bit", new Price(0.41, "UHR  ", "897",
                        null, "USD", 1), "GLD32.4/4096/350"), new InstanceType("Silver 32 bit", new Price(0.265,
                        "UHR  ", "897", null, "USD", 1), "SLV32.2/4096/350")),
               ImmutableSet.<String> of("ifeE7VOzRG6SGvoDlRPTQw"),
               HttpUtils
                        .createUri("https://www-147.ibm.com/cloud/enterprise/ram.ws/RAMSecure/artifact/{F006D027-02CC-9D08-D389-6C729D939D44}/1.0/GettingStarted.html"),
               "20001150", "SUSE Linux Enterprise Server 11 for x86 Base OS 32-bit with pay for use licensing");
View Full Code Here

Examples of org.nightlabs.jfire.accounting.Price

                " created " + recurredArticles.size() + " recurred articles for " + articles.size() +
                " template/recurring articles");

          for (Map.Entry<Article, Article> articleEntry : recurredArticles.entrySet()) {
            //  Compare Prices to check if they the Differ
            Price recurringPrice = articleEntry.getValue().getPrice();
            Price recurredPrice = articleEntry.getKey().getPrice();
            // if amount or currency differs
            if (recurredPrice.getAmount() != recurringPrice.getAmount() || !recurredPrice.getCurrency().equals(recurringPrice.getCurrency()))
              priceDiffer = true;

            if (logger.isDebugEnabled()) {
              if (!articleEntry.getValue().isAllocated()) {
                logger.debug("    An Article was created which was NOT allocated: " + JDOHelper.getObjectId(articleEntry.getValue()));
View Full Code Here

Examples of pojo.Price

  }

  // get infor of a price by id
  public Price getInfoPrice(int id) {
    logger.debug("getInfoPrice start");
    Price sp = null;
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
      sp = (Price) session.get(Price.class, id);
      logger.debug("getInfoPrice success");
    } catch (HibernateException ex) {
View Full Code Here

Examples of pojo.Price

  // del a price by id
  public boolean delPrice(int id) {
    logger.debug("delPrice start");
    Session session = HibernateUtil.getSessionFactory().openSession();
    Price u = (Price) session.get(Price.class, id);

    Transaction transaction = null;
    try {
      transaction = session.beginTransaction();
      session.delete(u);
View Full Code Here

Examples of quickfix.field.Price

        try {
            validateOrder(order);

            OrderQty orderQty = order.getOrderQty();

            Price price = getPrice(order);

            quickfix.fix40.ExecutionReport accept = new quickfix.fix40.ExecutionReport(genOrderID(), genExecID(),
                    new ExecTransType(ExecTransType.NEW), new OrdStatus(OrdStatus.NEW), order.getSymbol(), order.getSide(),
                    orderQty, new LastShares(0), new LastPx(0), new CumQty(0), new AvgPx(0));

            accept.set(order.getClOrdID());
            sendMessage(sessionID, accept);

            if (isOrderExecutable(order, price)) {
                quickfix.fix40.ExecutionReport fill = new quickfix.fix40.ExecutionReport(genOrderID(), genExecID(),
                        new ExecTransType(ExecTransType.NEW), new OrdStatus(OrdStatus.FILLED), order.getSymbol(), order
                                .getSide(), orderQty, new LastShares(orderQty.getValue()), new LastPx(price.getValue()),
                        new CumQty(orderQty.getValue()), new AvgPx(price.getValue()));

                fill.set(order.getClOrdID());

                sendMessage(sessionID, fill);
            }
View Full Code Here

Examples of quickfix.field.Price

        }
        return true;
    }

    private Price getPrice(Message message) throws FieldNotFound {
        Price price;
        if (message.getChar(OrdType.FIELD) == OrdType.LIMIT && alwaysFillLimitOrders) {
            price = new Price(message.getDouble(Price.FIELD));
        } else {
            if (marketQuoteProvider == null) {
                throw new RuntimeException("No market data provider specified for market order");
            }
            char side = message.getChar(Side.FIELD);
            if (side == Side.BUY) {
                price = new Price(marketQuoteProvider.getAsk(message.getString(Symbol.FIELD)));
            } else if (side == Side.SELL || side == Side.SELL_SHORT) {
                price = new Price(marketQuoteProvider.getBid(message.getString(Symbol.FIELD)));
            } else {
                throw new RuntimeException("Invalid order side: " + side);
            }
        }
        return price;
View Full Code Here

Examples of quickfix.field.Price

    private void onMessage(quickfix.fix41.NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {
        try {
            validateOrder(order);
   
            OrderQty orderQty = order.getOrderQty();
            Price price = getPrice(order);
   
            quickfix.fix41.ExecutionReport accept = new quickfix.fix41.ExecutionReport(genOrderID(), genExecID(),
                    new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.NEW), new OrdStatus(OrdStatus.NEW), order
                            .getSymbol(), order.getSide(), orderQty, new LastShares(0), new LastPx(0), new LeavesQty(0),
                    new CumQty(0), new AvgPx(0));
   
            accept.set(order.getClOrdID());
            sendMessage(sessionID, accept);
   
            if (isOrderExecutable(order, price)) {
                quickfix.fix41.ExecutionReport executionReport = new quickfix.fix41.ExecutionReport(genOrderID(),
                        genExecID(), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.FILL), new OrdStatus(
                                OrdStatus.FILLED), order.getSymbol(), order.getSide(), orderQty, new LastShares(orderQty
                                .getValue()), new LastPx(price.getValue()), new LeavesQty(0), new CumQty(orderQty
                                .getValue()), new AvgPx(price.getValue()));
   
                executionReport.set(order.getClOrdID());
   
                sendMessage(sessionID, executionReport);
            }
View Full Code Here

Examples of quickfix.field.Price

    private void onMessage(quickfix.fix42.NewOrderSingle order, SessionID sessionID) throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {
        try {
            validateOrder(order);
   
            OrderQty orderQty = order.getOrderQty();
            Price price = getPrice(order);
   
            quickfix.fix42.ExecutionReport accept = new quickfix.fix42.ExecutionReport(genOrderID(), genExecID(),
                    new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.NEW), new OrdStatus(OrdStatus.NEW), order
                            .getSymbol(), order.getSide(), new LeavesQty(0), new CumQty(0), new AvgPx(0));
   
            accept.set(order.getClOrdID());
            sendMessage(sessionID, accept);
   
            if (isOrderExecutable(order, price)) {
                quickfix.fix42.ExecutionReport executionReport = new quickfix.fix42.ExecutionReport(genOrderID(),
                    genExecID(), new ExecTransType(ExecTransType.NEW), new ExecType(ExecType.FILL),
                    new OrdStatus(OrdStatus.FILLED), order.getSymbol(), order.getSide(), new LeavesQty(0),
                    new CumQty(orderQty.getValue()), new AvgPx(price.getValue()));
   
                executionReport.set(order.getClOrdID());
                executionReport.set(orderQty);
                executionReport.set(new LastShares(orderQty.getValue()));
                executionReport.set(new LastPx(price.getValue()));
   
                sendMessage(sessionID, executionReport);
            }
        } catch (RuntimeException e) {
            LogUtil.logThrowable(sessionID, e.getMessage(), e);
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.