Package javax.management.openmbean

Examples of javax.management.openmbean.TabularData.values()


        Mockito.when(bundle.getBundleId()).thenReturn(Long.valueOf(4));
        Mockito.when(impBundle.getBundleId()).thenReturn(Long.valueOf(5));
        Mockito.when(admin.getExportedPackages(bundle)).thenReturn(new ExportedPackage[]{exported});
        TabularData table = mbean.listPackages();
        Assert.assertEquals(PackageStateMBean.PACKAGES_TYPE,table.getTabularType());
        Collection values = table.values();
        Assert.assertEquals(1, values.size());
        CompositeData data = (CompositeData) values.iterator().next();
        Long[] exportingBundles = (Long[])data.get(PackageStateMBean.EXPORTING_BUNDLES);
        Assert.assertArrayEquals(new Long[]{Long.valueOf(4)}, exportingBundles);
        String name = (String) data.get(PackageStateMBean.NAME);
View Full Code Here


        assertArrayEquals(interfaces, (String[]) compositeData.get(OBJECT_CLASS));

        TabularData propertiesTable = (TabularData) compositeData.get(PROPERTIES);

        @SuppressWarnings("unchecked")
        Collection<CompositeData> propertyData = (Collection<CompositeData>) propertiesTable.values();

        assertEquals(4, propertyData.size());
        for (CompositeData propertyRow: propertyData) {
            String key = (String) propertyRow.get(KEY);
            if (key.equals("x.vendor")) {
View Full Code Here

        ConfigurationAdmin mbean = new ConfigurationAdmin(admin);
       
        TabularData properties = mbean.getPropertiesForLocation(pid, null);
        assertNotNull(properties);
        assertEquals(PROPERTIES_TYPE, properties.getTabularType());
        assertEquals(2, properties.values().size());
        PropertyData<? extends Object> oneData = PropertyData.from(properties.get(new Object[]{ "one"}));
        assertEquals("value", oneData.getValue());
        PropertyData<? extends Object> twoData = PropertyData.from(properties.get(new Object[]{ "two"}));
        assertEquals(2, twoData.getValue());
        assertEquals("2", twoData.getEncodedValue());
View Full Code Here

        CompositeData compositeData = b.toCompositeData();

        assertEquals("test", compositeData.get(SYMBOLIC_NAME));
        assertEquals("0.0.0", compositeData.get(VERSION));
        TabularData headerTable = (TabularData) compositeData.get(HEADERS);
        assertEquals(4, headerTable.values().size());
        CompositeData header = headerTable.get(new Object[]{Constants.BUNDLE_SYMBOLICNAME});
        assertNotNull(header);
        String value = (String) header.get(VALUE);
        assertEquals("test", value);
        String key = (String)header.get(KEY);
View Full Code Here

        serviceData.serviceId = (Long) compositeData.get(IDENTIFIER);
        serviceData.bundleId = (Long) compositeData.get(BUNDLE_IDENTIFIER);
        serviceData.serviceInterfaces = (String[]) compositeData.get(OBJECT_CLASS);
        serviceData.usingBundles = toPrimitive((Long[]) compositeData.get(USING_BUNDLES));
        TabularData propertiesTable = (TabularData) compositeData.get(PROPERTIES);
        Collection<CompositeData> propertyData = (Collection<CompositeData>) propertiesTable.values();
        for (CompositeData propertyRow: propertyData) {
            serviceData.properties.add(PropertyData.from(propertyRow));
        }
        return serviceData;
    }
View Full Code Here

        bundleData.bundleStartLevel = (Integer) compositeData.get(START_LEVEL);
        bundleData.state = (String) compositeData.get(STATE);
        bundleData.symbolicName = (String) compositeData.get(SYMBOLIC_NAME);
        bundleData.version = (String) compositeData.get(VERSION);
        TabularData headerTable = (TabularData) compositeData.get(HEADERS);
        Collection<CompositeData> headerData = (Collection<CompositeData>) headerTable.values();
        for (CompositeData headerRow : headerData) {
            bundleData.headers.add(Header.from(headerRow));
        }
        return bundleData;
    }
View Full Code Here

        when(provService.getInformation()).thenReturn(info);
       
        TabularData provData = mbean.listInformation();
        assertNotNull(provData);
        assertEquals(PROPERTIES_TYPE, provData.getTabularType());
        assertEquals(5, provData.values().size());
        PropertyData<byte[]> agentConfig = PropertyData.from(provData.get(new Object[]{ PROVISIONING_AGENT_CONFIG }));
        assertArrayEquals(new byte[] { 20, 30, 40 }, agentConfig.getValue());
        PropertyData<String> spid = PropertyData.from(provData.get(new Object[] { PROVISIONING_SPID }));
        assertEquals("x.test", spid.getValue());
        PropertyData<String> ref = PropertyData.from(provData.get(new Object[] { PROVISIONING_REFERENCE }));
View Full Code Here

    public Collection<JobFacade> getScheduledJobs() throws Exception {
        JobSchedulerViewMBean jobScheduler = getJobScheduler();
        List<JobFacade> result = new ArrayList<JobFacade>();
        TabularData table = jobScheduler.getAllJobs();
        for (Object object : table.values()) {
            CompositeData cd = (CompositeData) object;
            JobFacade jf = new JobFacade(cd);
            result.add(jf);
        }
        return result;
View Full Code Here

        TabularData td = (TabularData) pValue;

        if (!pExtraArgs.isEmpty()) {
            String index = pExtraArgs.pop();
            int idx = Integer.valueOf(index).intValue();
            CompositeData cd = getRow(idx, td.values().iterator());
            return pConverter.extractObject(cd,pExtraArgs,jsonify);
        } else {
            if (jsonify) {
                JSONArray ret = new JSONArray();
                for (CompositeData cd : (Collection <CompositeData>) td.values()) {
View Full Code Here

            CompositeData cd = getRow(idx, td.values().iterator());
            return pConverter.extractObject(cd,pExtraArgs,jsonify);
        } else {
            if (jsonify) {
                JSONArray ret = new JSONArray();
                for (CompositeData cd : (Collection <CompositeData>) td.values()) {
                    ret.add(pConverter.extractObject(cd,pExtraArgs,jsonify));
                }
                return ret;
            } else {
                return td;
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.