Package com.volantis.devrep.device.api.xml.identification

Examples of com.volantis.devrep.device.api.xml.identification.Identification


    private ResourceJiBXTester tester = new ResourceJiBXTester(
            PolicyTestCase.class);

    public void testUnmarshall() throws JiBXException, IOException {
       
        Identification identification =  (Identification) tester.unmarshall(
                Identification.class, "IdentificationTest.xml");

        StringBuffer output = new StringBuffer();
        dumpIdentification(identification, output);
        String actual = output.toString();
View Full Code Here


    private DeviceIdentificationAnalyserResult testDevicePatterns(
                final String fileName, final String deviceName)
            throws RepositoryException, DeviceRepositoryException {

        // load the identification object
        final Identification identification = loadIdentification(fileName);

        if (identification == null) {
            throw new RepositoryException(EXCEPTION_LOCALIZER.format(
                "device-repository-file-missing",
                DeviceRepositoryConstants.IDENTIFICATION_XML));
        }

        // create the repository
        final SimpleDeviceRepositoryFactory factory =
            new SimpleDeviceRepositoryFactory();
        final DeviceRepository repository =
            factory.createDeviceRepository("file://" + fileName, null);

        final Iterator entriesIter;
        if (deviceName == null) {
            // iterate throuogh the identification entries
            entriesIter = identification.entries();
        } else {
            // only check one entry
            final IdentificationEntry entry = identification.find(deviceName);
            entriesIter = Collections.singleton(entry).iterator();
        }
        return testDevicePatterns(repository, entriesIter);
    }
View Full Code Here

    public RepositoryEnumeration enumerateDevicePatterns(
            RepositoryConnection connection) throws RepositoryException {

        final Collection devicePatterns = new ArrayList();
        Identification identification = loadIdentification();
        Iterator iterator = identification.entries();
        while (iterator.hasNext()) {
            IdentificationEntry entry = (IdentificationEntry) iterator.next();
            final String deviceName = entry.getDeviceName();
            iterateGenericPatterns(entry, new GenericPatternIteratee() {
                public void next(String pattern) {
View Full Code Here

            // we had some custom polices, add them too.
            addPolicySetToDevice(customPolicySet, device);
        }

        // Add the device patterns to the device.
        Identification identification = loadIdentification();
        final Map patterns = new HashMap();
        IdentificationEntry idEntry = identification.find(deviceName);
        if (idEntry != null) {
            iterateGenericPatterns(idEntry, new GenericPatternIteratee() {
                public void next(String pattern) {
                    // NOTE: yes this is intentional, why this must be a
                    // map I have no idea - a list would be fine.
View Full Code Here

TOP

Related Classes of com.volantis.devrep.device.api.xml.identification.Identification

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.