Package com.volantis.mcs.devices

Examples of com.volantis.mcs.devices.Device


    }

    // javadoc inherited
    public Device getDevice(String deviceName)
            throws DeviceRepositoryException {
        Device device = null;

        if (deviceName != null) {
            try {
                RepositoryConnection connection = repository.connect();
                try {
View Full Code Here


    }

    public String getFallbackDeviceName(final String deviceName)
            throws DeviceRepositoryException {

        final Device device = getDevice(deviceName);
        if (device == null) {
            throw new IllegalArgumentException(deviceName +
                " is not a valid device name.");
        }
        return ((DefaultDevice) device).getFallbackDeviceName();
View Full Code Here

                                             String deviceName) {

        // attempt to retrieve the supplied object from the repository.

        try {
            Device device = accessor.retrieveDevice(deviceName);
            return device != null;
        } catch (RepositoryException e) {
            // If there was an exception here, we do not know if the object
            // exists in the repository or not, and if we let the exception
            // go up the stack, then it obscures the original exception which
View Full Code Here

    private void transferDevice(String deviceName,
            DeviceTransferAccessor srcDeviceAccessor,
            DeviceTransferAccessor dstDeviceAccessor) throws RepositoryException {

        Device device;
        try {
            device = srcDeviceAccessor.retrieveDevice(deviceName);

        } catch (RepositoryException e) {
            // Try to report the name of the policy we couldn't read
View Full Code Here

                                         policyTypeFactory.createTextPolicyType());

            // Create the factory
            PolicyValueFactory factory = PolicyValueFactory.createInstance(accessor);

            Device device = context.getDevice().getDevice();
            String charset = selector.getOutputCharset(rHeaders, device);
            if (expected != null) {
                assertEquals("Expected value should match", expected, charset);
            } else {
                assertNull(charset);
View Full Code Here

            if (capabilitiesHandler.isMCSCapabilitiesRequest()) {
                capabilitiesHandler.processMCSCapabilitiesRequest();
            } else {
                // Determine the device for the request.
                Device device;
                try {
                    device = application.getDevice(httpRequest);
                } catch (RepositoryException e) {
                    logger.error("mcs-filter-request-device-error", e);
                    throw new ServletException(exceptionLocalizer.
                            format("mcs-filter-request-device-error"),
                            e);
                }

                final String deviceName = device.getName();
                final boolean excluded = excludedDevices.contains(deviceName);

                if (!excluded) {

                    if (logger.isDebugEnabled()) {
View Full Code Here

    public void testGetDeviceWithMatchingSingleAcceptHeader()
            throws RepositoryException {

        headers.addHeader("accept", "wap.wml");

        Device device = DevicesHelper.getDevice(
            connectionMock, headers, accessor, null).getDevice();

        assertEquals("WAP-Handset", device.getName());

    }
View Full Code Here

    public void testGetDeviceWithNonMatchingSingleAcceptHeader()
            throws RepositoryException {

        headers.addHeader("accept", "text/html");

        Device device = DevicesHelper.getDevice(
            connectionMock, headers, accessor, null).getDevice();

        assertEquals("PC", device.getName());

    }
View Full Code Here

    public void testGetDeviceWithNearMatchingSingleAcceptHeader()
            throws RepositoryException {

        headers.addHeader("accept", "application/vnd.wap.wml");

        Device device = DevicesHelper.getDevice(
            connectionMock, headers, accessor, null).getDevice();

        assertEquals("WAP-Handset", device.getName());

    }
View Full Code Here

            throws RepositoryException {

        headers.addHeader("accept", "wap.wml");
        headers.addHeader("accept", "text/html");

        Device device = DevicesHelper.getDevice(
            connectionMock, headers, accessor, null).getDevice();

        assertEquals("WAP-Handset", device.getName());

    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.devices.Device

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.