Examples of PayloadType


Examples of com.indeed.proctor.common.PayloadType

        assertEquals(7, names.size());

        for (String s : new String[]{"doubleValue", "doubleArray",
                                     "longValue", "longArray",
                                     "stringValue", "stringArray","map"}) {
            PayloadType p = PayloadType.payloadTypeForName(s);
            assertEquals(s, p.payloadTypeName);
        }
        // Verify that trying to get the PayloadType for a nonsense
        // name throws an exception.
        try {
            PayloadType p = PayloadType.payloadTypeForName("gruntleBuggy");
            assertFalse("should have thrown IllegalArgumentException on \"gruntleBuggy\"", true);
        } catch (IllegalArgumentException e) {
            // expected.
        }
    }
View Full Code Here

Examples of com.indeed.proctor.common.PayloadType

            final List<Map<String, String>> nestedPayloadsList = new ArrayList<Map<String,String>>();
            // Only define testDef.payloadJavaClass if the API user has
            // claimed she expects a payload.
            if (testSpecification.getPayload() != null) {
                final String specifiedPayloadTypeName = testSpecification.getPayload().getType();
                final PayloadType specifiedPayloadType = PayloadType.payloadTypeForName(specifiedPayloadTypeName);
                if(specifiedPayloadType == PayloadType.MAP) {
                    testDef.put("isMap","true");
                    for(Map.Entry<String,String> entry : testSpecification.getPayload().getSchema().entrySet()) {
                        final Map<String,String> nestedPayloadsMap = Maps.newHashMap();
                        nestedPayloadsMap.put("key",entry.getKey());
                        final PayloadType payloadTypeForValue = PayloadType.payloadTypeForName(entry.getValue());
                        if(payloadTypeForValue != PayloadType.MAP) {
                            nestedPayloadsMap.put("value", payloadTypeForValue.javaClassName);
                            nestedPayloadsMap.put("valueWithoutArray",
                                    payloadTypeForValue.javaClassName.substring(0, payloadTypeForValue.javaClassName.length() - 2));
                            if (PayloadType.STRING_ARRAY == payloadTypeForValue) {
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.media.PayloadType

         *
         * @throws XMPPException
         */
        public Jingle eventAccept(Jingle jin) throws XMPPException {

            PayloadType acceptedPayloadType = null;
            TransportCandidate acceptedLocalCandidate = null;

            // We process the "accepted" if we have finished the
            // sub-negotiators. Maybe this is not needed (ie, the other endpoint
            // can take the first valid transport candidate), but otherwise we
            // must cancel the negotiators...
            //
            if (isFullyEstablished()) {
                acceptedPayloadType = getAcceptedAudioPayloadType(jin);
                acceptedLocalCandidate = getAcceptedLocalCandidate(jin);

                if (acceptedPayloadType != null && acceptedLocalCandidate != null) {
                    if (acceptedPayloadType.equals(getMediaNeg().getBestCommonAudioPt())
                            && acceptedLocalCandidate.equals(getTransportNeg()
                            .getAcceptedLocalCandidate())) {
                        setState(active);
                    }
                }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.media.PayloadType

        /**
         * The other endpoint has accepted the session.
         */
        public Jingle eventAccept(Jingle jin) throws XMPPException {

            PayloadType acceptedPayloadType = null;
            TransportCandidate acceptedLocalCandidate = null;

            // We process the "accepted" if we have finished the
            // sub-negotiators. Maybe this is not needed (ie, the other endpoint
            // can take the first valid transport candidate), but otherwise we
            // must cancel the negotiators...
            //
            if (isFullyEstablished()) {
                acceptedPayloadType = getAcceptedAudioPayloadType(jin);
                acceptedLocalCandidate = getAcceptedLocalCandidate(jin);

                if (acceptedPayloadType != null && acceptedLocalCandidate != null) {
                    if (acceptedPayloadType.equals(getMediaNeg().getBestCommonAudioPt())
                            && acceptedLocalCandidate.equals(getTransportNeg()
                            .getAcceptedLocalCandidate())) {
                        setState(active);
                    }
                }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.media.PayloadType

                super(audio);
            }

            protected String getChildAttributes() {
                StringBuilder buf = new StringBuilder();
                PayloadType pt = getPayloadType();
                if (pt instanceof PayloadType.Audio) {
          PayloadType.Audio pta = (PayloadType.Audio) pt;

          buf.append(" clockrate=\"").append(pta.getClockRate()).append("\" ");
        }
View Full Code Here

Examples of nu.fw.jeti.plugins.jingle.jingle.media.PayloadType

        try {
            ptChannels = Integer.parseInt(attr.getValue("channels"));
        } catch (NumberFormatException e) {
        }

        return new JinglePayloadType(new PayloadType(ptId, ptName, ptChannels));
    }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.media.PayloadType

        try {
            ptChannels = Integer.parseInt(parser.getAttributeValue("", "channels"));
        } catch (Exception e) {
        }

        return new JinglePayloadType(new PayloadType(ptId, ptName, ptChannels));
    }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.media.PayloadType

                super(audio);
            }

            protected String getChildAttributes() {
                StringBuilder buf = new StringBuilder();
                PayloadType pt = getPayloadType();
                if (pt instanceof PayloadType.Audio) {
          PayloadType.Audio pta = (PayloadType.Audio) pt;

          buf.append(" clockrate=\"").append(pta.getClockRate()).append("\" ");
        }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.media.PayloadType

        try {
            ptChannels = Integer.parseInt(parser.getAttributeValue("", "channels"));
        } catch (Exception e) {
        }

        return new PayloadType(ptId, ptName, ptChannels);
    }
View Full Code Here

Examples of org.jivesoftware.smackx.jingle.media.PayloadType

        /**
         * Parse an audio payload type.
         */
        public PayloadType parsePayload(final XmlPullParser parser) throws Exception {
            PayloadType pte = super.parsePayload(parser);
            PayloadType.Audio pt = new PayloadType.Audio(pte);
            int ptClockRate = 0;

            try {
                ptClockRate = Integer.parseInt(parser.getAttributeValue("", "clockrate"));
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.