Example #1
0
 /// <summary>
 /// Compose the topic name from namespace + topic.
 /// </summary>
 /// <param name="domain"> </param>
 /// <param name="topic">
 /// @return </param>
 internal string GetTopicName(TopicDomain domain, string topic)
 {
     try
     {
         Condition.CheckNotNull(domain);
         NamedEntity.CheckName(topic);
         return($"{domain.ToString()}://{_namespace}/{topic}");
     }
     catch (NullReferenceException e)
     {
         throw new ArgumentException("Null pointer is invalid as domain for topic.", e);
     }
 }
Example #2
0
 public static void ValidateNamespaceName(string tenant, string @namespace)
 {
     try
     {
         Condition.CheckNotNull(tenant);
         Condition.CheckNotNull(@namespace);
         if (tenant.Length == 0 || @namespace.Length == 0)
         {
             throw new ArgumentException($"Invalid namespace format. namespace: {tenant}/{@namespace}");
         }
         NamedEntity.CheckName(tenant);
         NamedEntity.CheckName(@namespace);
     }
     catch (NullReferenceException e)
     {
         throw new ArgumentException($"Invalid namespace format. namespace: {tenant}/{@namespace}", e);
     }
 }