Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData


        _loggingManagement.setRuntimeLoggerLevel(logger, "OFF");

        List<String> matches = _monitor.findMatches("Setting level to OFF for logger 'org.apache.qpid'");
        assertEquals(1, matches.size());

        TabularData table = _loggingManagement.viewEffectiveRuntimeLoggerLevels();
        final CompositeData row1 = table.get(new String[] {logger} );
        assertChannelRow(row1, logger, "OFF");
    }
View Full Code Here


        assertEffectiveLoggingLevel(operationalLoggingLogger, "OFF");
    }

    private void assertEffectiveLoggingLevel(String operationalLoggingLogger, String expectedLevel)
    {
        TabularData table = _loggingManagement.viewEffectiveRuntimeLoggerLevels();
        final CompositeData row1 = table.get(new String[] {operationalLoggingLogger} );
        assertChannelRow(row1, operationalLoggingLogger, expectedLevel);
    }
View Full Code Here

        final Message sentMessage = sentMessages.get(0);

        assertEquals("Unexpected queue depth", 1, _managedSourceQueue.getMessageCount().intValue());

        // Check the contents of the message
        final TabularData tab = _managedSourceQueue.viewMessages(1l, 1l);
        assertEquals("Unexpected number of rows in table", 1, tab.size());
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();

        final CompositeData row1 = rowItr.next();
        assertNotNull("Message should have AMQ message id", row1.get(ManagedQueue.MSG_AMQ_ID));
        assertEquals("Unexpected queue position", 1l, row1.get(ManagedQueue.MSG_QUEUE_POS));
        assertEquals("Unexpected redelivered flag", Boolean.FALSE, row1.get(ManagedQueue.MSG_REDELIVERED));
View Full Code Here

    private List<Long> getAMQMessageIdsOn(ManagedQueue managedQueue, long startIndex, long endIndex) throws Exception
    {
        final SortedSet<Long> messageIds = new TreeSet<Long>();

        final TabularData tab = managedQueue.viewMessages(startIndex, endIndex);
        final Iterator<CompositeData> rowItr = (Iterator<CompositeData>) tab.values().iterator();
        while(rowItr.hasNext())
        {
            final CompositeData row = rowItr.next();
            long amqMessageId = (Long)row.get(ManagedQueue.MSG_AMQ_ID);
            messageIds.add(amqMessageId);
View Full Code Here

  CompositeData cdata = new CompositeDataSupport(ctype, data);
  CompositeData[] cdataarr = new CompositeData[] { cdata };
  ArrayType type2 = new ArrayType(1, ctype);
  h.check(type2.isValue(cdataarr), "Composite data check");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  TabularData tdata = new TabularDataSupport(ttype);
  tdata.put(cdata);
  TabularData[] tdataarr = new TabularData[] {tdata};
  ArrayType type3 = new ArrayType(1, ttype);
  h.check(type3.isValue(tdataarr), "Tabular data check");
      }
    catch (OpenDataException e)
View Full Code Here

        ModelNode node = new ModelNode();
        node.get("one").set(1L);
        node.get("two").set(2L);

        TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
        Assert.assertEquals(2, tabularData.size());
        Assert.assertEquals(Long.valueOf(1), tabularData.get(new Object[] {"one"}).get("value"));
        Assert.assertEquals(Long.valueOf(2), tabularData.get(new Object[] {"two"}).get("value"));

        Assert.assertEquals(node, converter.toModelNode(tabularData));

        //Allow plain map as well? Yeah why not!
        Map<String, Long> map = new HashMap<String, Long>();
View Full Code Here

        ModelNode node = new ModelNode();
        node.get("one").set(new byte[] {1,2});
        node.get("two").set(new byte[] {3,4});

        TabularData tabularData = assertCast(TabularData.class, converter.fromModelNode(node));
        Assert.assertEquals(2, tabularData.size());
        Assert.assertTrue(Arrays.equals(new byte[] {1,2}, (byte[])tabularData.get(new Object[] {"one"}).get("value")));
        Assert.assertTrue(Arrays.equals(new byte[] {3,4}, (byte[])tabularData.get(new Object[] {"two"}).get("value")));

        //Allow plain map as well? Yeah why not!
        Map<String, byte[]> map = new HashMap<String, byte[]>();
        map.put("one", new byte[] {1,2});
        map.put("two", new byte[] {3,4});
View Full Code Here

        for (int ctr = 0 ; ctr < list.size() ; ctr++) {
            Assert.assertEquals(list.get(ctr), listValue[ctr]);
        }
        Assert.assertEquals(lng, assertCast(Long.class, connection.getAttribute(name, "long")).longValue());
        Assert.assertEquals(type, ModelType.valueOf(assertCast(String.class, connection.getAttribute(name, "type"))));
        TabularData tabularData = assertCast(TabularData.class, connection.getAttribute(name, "map"));
        Assert.assertEquals(2, tabularData.size());
        Assert.assertEquals(tblValue1, assertCast(Integer.class, tabularData.get(new Object[] {tblKey1}).get("value")).intValue());
        Assert.assertEquals(tblValue2, assertCast(Integer.class, tabularData.get(new Object[] {tblKey2}).get("value")).intValue());
    }
View Full Code Here

        }
    }

    private TabularData createTabularDataFromLevelsMap(Map<String, String> levels)
    {
        TabularData loggerLevelList = new TabularDataSupport(LOGGER_LEVEL_TABULAR_TYE);
        for (Map.Entry<String,String> entry : levels.entrySet())
        {
            String loggerName = entry.getKey();
            String level = entry.getValue();

            CompositeData loggerData = createRow(loggerName, level);
            loggerLevelList.put(loggerData);
        }
        return loggerLevelList;
    }
View Full Code Here

        @Override
        public void execute(NodeProbe probe)
        {
            System.out.println("Compaction History: ");

            TabularData tabularData = probe.getCompactionHistory();
            if (tabularData.isEmpty())
            {
                System.out.printf("There is no compaction history");
                return;
            }

            String format = "%-41s%-19s%-29s%-26s%-15s%-15s%s%n";
            List<String> indexNames = tabularData.getTabularType().getIndexNames();
            System.out.printf(format, toArray(indexNames, Object.class));

            Set<?> values = tabularData.keySet();
            for (Object eachValue : values)
            {
                List<?> value = (List<?>) eachValue;
                System.out.printf(format, toArray(value, Object.class));
            }
View Full Code Here

TOP

Related Classes of javax.management.openmbean.TabularData

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.