Apache.NMS.ActiveMQ.Commands.ActiveMQDestination.GetClientId C# (CSharp) Method

GetClientId() public static method

From a temporary destination find the clientId of the Connection that created it
public static GetClientId ( ActiveMQDestination destination ) : String
destination ActiveMQDestination
return String
        public static String GetClientId(ActiveMQDestination destination)
        {
            String answer = null;
            if(destination != null && destination.IsTemporary)
            {
                String name = destination.PhysicalName;
                int start = name.IndexOf(TEMP_PREFIX);
                if(start >= 0)
                {
                    start += TEMP_PREFIX.Length;
                    int stop = name.LastIndexOf(TEMP_POSTFIX);
                    if(stop > start && stop < name.Length)
                    {
                        answer = name.Substring(start, stop);
                    }
                }
            }
            return answer;
        }