Examples of RuntimeDelegate


Examples of javax.ws.rs.ext.RuntimeDelegate

    public static MultivaluedMap<String, String> asStringHeaders(final MultivaluedMap<String, Object> headers) {
        if (headers == null) {
            return null;
        }

        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        return new AbstractMultivaluedMap<String, String>(
                Maps.transformValues(headers, new Function<List<Object>, List<String>>() {
                    @Override
                    public List<String> apply(List<Object> input) {
                        return HeaderUtils.asStringList(input, rd);
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

    public static Map<String, String> asStringHeadersSingleValue(final MultivaluedMap<String, Object> headers) {
        if (headers == null) {
            return null;
        }

        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        ImmutableMap.Builder<String, String> immutableMapBuilder = new ImmutableMap.Builder<String, String>();
        for (Map.Entry<? extends String, ? extends List<Object>> entry : headers.entrySet()) {
            immutableMapBuilder.put(entry.getKey(), asHeaderString(entry.getValue(), rd));
        }
        return immutableMapBuilder.build();
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

     */
    public static void checkHeaderChanges(final Map<String, String> headersSnapshot,
                                          final MultivaluedMap<String, Object> currentHeaders,
                                          final String connectorName) {
        if (HeaderUtils.LOGGER.isLoggable(Level.WARNING)) {
            final RuntimeDelegate rd = RuntimeDelegate.getInstance();
            Set<String> changedHeaderNames = new HashSet<String>();
            for (Map.Entry<? extends String, ? extends List<Object>> entry : currentHeaders.entrySet()) {
                if (!headersSnapshot.containsKey(entry.getKey())) {
                    changedHeaderNames.add(entry.getKey());
                } else {
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        if (values == null || values.size() == 0) {
            return Collections.unmodifiableList(new ArrayList<MediaType>(MediaTypes.GENERAL_ACCEPT_MEDIA_TYPE_LIST));
        }
        final List<MediaType> result = new ArrayList<MediaType>(values.size());
        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        boolean conversionApplied = false;
        for (final Object value : values) {
            if (value instanceof MediaType) {
                result.add((MediaType) value);
            } else {
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        if (values == null || values.size() == 0) {
            return Collections.singletonList(new AcceptableLanguageTag("*", null).getAsLocale());
        }

        final List<Locale> result = new ArrayList<Locale>(values.size());
        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        boolean conversionApplied = false;
        for (final Object value : values) {
            if (value instanceof Locale) {
                result.add((Locale) value);
            } else {
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        if (values == null || values.isEmpty()) {
            return Collections.emptySet();
        }

        final Set<Link> result = new HashSet<Link>(values.size());
        final RuntimeDelegate rd = RuntimeDelegate.getInstance();
        boolean conversionApplied = false;
        for (final Object value : values) {
            if (value instanceof Link) {
                result.add((Link) value);
            } else {
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

public class EntityTagHeaderDelegateTest {

    @Test
    public void testParseEtag() {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<EntityTag> entityTagHeaderDelegate =
            rd.createHeaderDelegate(EntityTag.class);
        if (entityTagHeaderDelegate == null) {
            fail("EntityTag header delegate is not regestered in RuntimeDelegateImpl");
        }

        String expectedEntityTagString = "12321-\"12321-\t123123";
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

        }
    }

    @Test
    public void testSerializeEtag() {
        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<EntityTag> entityTagHeaderDelegate =
            rd.createHeaderDelegate(EntityTag.class);
        if (entityTagHeaderDelegate == null) {
            fail("EntityTag header delegate is not regestered in RuntimeDelegateImpl");
        }

        String entityTagString = "12321-\"12321-123123";
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

    private static final String ANSI_C_ASCTIME_DATE         = "Sun Nov 6 08:49:37 1994";

    @Test
    public void testParseHeaderDelegate() throws ParseException {

        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<Date> dateHeaderDelegate = rd.createHeaderDelegate(Date.class);
        if (dateHeaderDelegate == null) {
            fail("Date header delegate is not regestered in RuntimeDelegateImpl");
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat(RFC1123_DATE_FORMAT_PATTERN, Locale.US);
View Full Code Here

Examples of javax.ws.rs.ext.RuntimeDelegate

    }

    @Test
    public void testSerializeHeaderDelegate() throws ParseException {

        RuntimeDelegate rd = RuntimeDelegate.getInstance();
        HeaderDelegate<Date> dateHeaderDelegate = rd.createHeaderDelegate(Date.class);
        if (dateHeaderDelegate == null) {
            fail("Date header delegate is not regestered in RuntimeDelegateImpl");
        }

        // HTTP1.1 clients and servers MUST only generate the RFC 1123 format
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.