Examples of InventoryItem


Examples of com.streamreduce.core.model.InventoryItem

                if (entry == null) {
                    continue;
                }

                String profileId = entry.getString("id");
                InventoryItem inventoryItem = inventoryItemMap.get(profileId);

                if (inventoryItem == null) {
                    continue;
                }

                JSONArray metrics = entry.getJSONArray("metrics");
                for (Object obj : metrics) {
                    JSONObject metric = (JSONObject) obj;

                    Map<String, Object> eventContext = new HashMap<>();
                    eventContext.put("activityTitle", String.format("%s on %s is at %s", metric.getString("metric"), inventoryItem.getAlias(), metric.get("data")));
                    JSONArray jsonHashtags = metric.getJSONArray("hashtags");
                    Set<String> hashtags = new HashSet<String>(jsonHashtags);
                    eventContext.put("activityHashtags", hashtags);
                    eventContext.put("activityPayload", metric); /* need to fix this */

 
View Full Code Here

Examples of com.streamreduce.core.model.InventoryItem

                    // Move on to the next activity entry
                    continue;
                }

                InventoryItem inventoryItem = inventoryItemMap.get(projectKey);

                // This can happen if the activity is from a project, or Jira Studio product, not associated with a
                // project in our inventory system.  (A good example of this is wiki changes.  Each Jira Studio project
                // gets its own wiki but you can create new wiki spaces that are not associated with a Jira Studio
                // project and will end up without an inventory item in our system.)
View Full Code Here

Examples of com.streamreduce.core.model.InventoryItem

        try {
            List<JSONObject> jsonInventoryList = client.checks();

            for (Iterator<JSONObject> i = jsonInventoryList.iterator(); i.hasNext();) {
                JSONObject jsonInventory = i.next();
                InventoryItem inventoryItem = inventoryItemMap.get(jsonInventory.getString("id"));

                if (inventoryItem == null) {
                    continue;
                }

                // the connection may not have been tested yet from Pingdom
                if (!jsonInventory.containsKey("lasttesttime")) {
                    continue;
                }

                Date lastTestTime = new DateTime().withMillis(0).plusSeconds(jsonInventory.getInt("lasttesttime")).toDate();
                if (lastActivityPoll != null && lastActivityPoll.after(lastTestTime)) {
                    continue;
                }

                lastActivityPoll = lastTestTime.after(lastActivityPoll) ? lastTestTime : lastActivityPoll;

                Map<String, Object> eventContext = new HashMap<>();

                eventContext.put("activityPubDate", lastTestTime);
                eventContext.put("activityTitle", String.format("Service check %s (%s) has a response time of %dms.",
                        jsonInventory.getString("name"),
                        jsonInventory.getString("type").toUpperCase(),
                        jsonInventory.getInt("lastresponsetime")));
                eventContext.put("payload", jsonInventory);

                if (jsonInventory.containsKey("lastresponsetime")) {
                    eventContext.put("lastResponseTime", jsonInventory.getInt("lastresponsetime"));
                }

                Event event = eventService.createEvent(EventId.ACTIVITY,
                                                       inventoryItem,
                                                       eventContext);

                PingdomEntryDetails details = new PingdomEntryDetails.Builder()
                        .lastErrorTime(jsonInventory.containsKey("lasterrortime") ? jsonInventory.getInt("lasterrortime") : 0)
                        .lastResponseTime(jsonInventory.containsKey("lastresponsetime") ? jsonInventory.getInt("lastresponsetime") : 0)
                        .lastTestTime(jsonInventory.getInt("lasttesttime"))
                        .checkCreated(jsonInventory.getInt("created"))
                        .resolution(jsonInventory.getInt("resolution"))
                        .status(jsonInventory.getString("status"))
                        .build();

                // Create a new message to be delivered to inboxes
                messageService.sendAccountMessage(event,
                        inventoryItem,
                        connection,
                        lastTestTime.getTime(),
                        MessageType.ACTIVITY,
                        inventoryItem.getHashtags(),
                        details);
            }

            // Update the connection's last polling time
            connection.setLastActivityPollDate(new Date(lastActivityPoll.getTime() + 1));
View Full Code Here

Examples of org.richfaces.demo.tables.model.cars.InventoryItem

                });
                Iterator<InventoryItem> iterator = inventoryItems.iterator();
                InventoryVendorList vendorList = new InventoryVendorList();
                vendorList.setVendor(inventoryItems.get(0).getVendor());
                while (iterator.hasNext()) {
                    InventoryItem item = iterator.next();
                    InventoryVendorItem newItem = new InventoryVendorItem();
                    itemToVendorItem(item, newItem);
                    if (!item.getVendor().equals(vendorList.getVendor())) {
                        inventoryVendorLists.add(vendorList);
                        vendorList = new InventoryVendorList();
                        vendorList.setVendor(item.getVendor());
                    }
                    vendorList.getVendorItems().add(newItem);
                }
                inventoryVendorLists.add(vendorList);
            }
View Full Code Here

Examples of org.richfaces.demo.tables.model.cars.InventoryItem

        try {
            int arrayCount = count;
            InventoryItem[] demoInventoryItemArrays = new InventoryItem[arrayCount];

            for (int j = 0; j < demoInventoryItemArrays.length; j++) {
                InventoryItem ii = new InventoryItem();

                ii.setVendor(vendor);
                ii.setModel(model);
                ii.setStock(RandomHelper.randomstring(6, 7));
                ii.setVin(RandomHelper.randomstring(17, 17));
                ii.setMileage(new BigDecimal(RandomHelper.rand(5000, 80000)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setMileageMarket(new BigDecimal(RandomHelper.rand(25000, 45000)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setPrice(new Integer(RandomHelper.rand(15000, 55000)));
                ii.setPriceMarket(new BigDecimal(RandomHelper.rand(15000, 55000)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setDaysLive(RandomHelper.rand(1, 90));
                ii.setChangeSearches(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setChangePrice(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setExposure(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setActivity(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setPrinted(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                ii.setInquiries(new BigDecimal(RandomHelper.rand(0, 5)).setScale(DECIMALS, ROUNDING_MODE));
                demoInventoryItemArrays[j] = ii;
            }

            iiList = new ArrayList<InventoryItem>(Arrays.asList(demoInventoryItemArrays));
        } catch (Exception 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.