Beispiel #1
0
 public static void ParseStreamStatus(SamReply reply)
 {
     if (reply == null)
     {
         throw new ArgumentNullException("reply");
     }
     if (!reply.Check("STREAM", "STATUS"))
     {
         throw new SamReplyMismatchException(reply);
     }
     if (reply.ResultString != SamBridgeErrorMessage.OK)
     {
         throw new SamBridgeErrorException(reply);
     }
 }
Beispiel #2
0
        public static string ParseSessionStatus(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("SESSION", "STATUS"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string destination = reply.UniqueValue("DESTINATION").Value;

            return(destination);
        }
Beispiel #3
0
        public static string ParseHelloReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("HELLO", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string version = reply.UniqueValue("VERSION").Value;

            return(version);
        }
Beispiel #4
0
        public static SamDestination ParseDestReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("DEST", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string pubBase64  = reply.UniqueValue("PUB").Value;
            string privBase64 = reply.UniqueValue("PRIV").Value;

            return(new SamDestination(pubBase64, privBase64));
        }
Beispiel #5
0
        public static SamLookupResult ParseNamingReply(SamReply reply)
        {
            if (reply == null)
            {
                throw new ArgumentNullException("reply");
            }
            if (!reply.Check("NAMING", "REPLY"))
            {
                throw new SamReplyMismatchException(reply);
            }
            if (reply.ResultString != SamBridgeErrorMessage.OK)
            {
                throw new SamBridgeErrorException(reply);
            }

            string nameInReply = reply.UniqueValue("NAME").Value;
            string valueBase64 = reply.UniqueValue("VALUE").Value;

            return(new SamLookupResult(nameInReply, valueBase64));
        }
Beispiel #6
0
        public static SamReply ParseReply(string input, string major, string minor)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }
            if (major == null)
            {
                throw new ArgumentNullException("major");
            }
            if (minor == null)
            {
                throw new ArgumentNullException("minor");
            }

            SamReply reply = Parse(input);

            if (!reply.Check(major, minor))
            {
                throw new SamReplyMismatchException(reply);
            }
            return(reply);
        }
Beispiel #7
0
 public static void ParseStreamStatus(SamReply reply)
 {
     if (reply == null)
         throw new ArgumentNullException("reply");
     if (!reply.Check("STREAM", "STATUS"))
         throw new SamReplyMismatchException(reply);
     if (reply.ResultString != SamBridgeErrorMessage.OK)
         throw new SamBridgeErrorException(reply);
 }
Beispiel #8
0
        public static string ParseSessionStatus(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("SESSION", "STATUS"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string destination = reply.UniqueValue("DESTINATION").Value;
            return destination;
        }
Beispiel #9
0
        public static SamLookupResult ParseNamingReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("NAMING", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string nameInReply = reply.UniqueValue("NAME").Value;
            string valueBase64 = reply.UniqueValue("VALUE").Value;
            return new SamLookupResult(nameInReply, valueBase64);
        }
Beispiel #10
0
        public static string ParseHelloReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("HELLO", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string version = reply.UniqueValue("VERSION").Value;
            return version;
        }
Beispiel #11
0
        public static SamDestination ParseDestReply(SamReply reply)
        {
            if (reply == null)
                throw new ArgumentNullException("reply");
            if (!reply.Check("DEST", "REPLY"))
                throw new SamReplyMismatchException(reply);
            if (reply.ResultString != SamBridgeErrorMessage.OK)
                throw new SamBridgeErrorException(reply);

            string pubBase64 = reply.UniqueValue("PUB").Value;
            string privBase64 = reply.UniqueValue("PRIV").Value;
            return new SamDestination(pubBase64, privBase64);
        }