diff --git a/dotnet/Razorvine.Pyrolite/NamingExample/TestNaming.cs b/dotnet/Razorvine.Pyrolite/NamingExample/TestNaming.cs index d2ee784..524b2c6 100644 --- a/dotnet/Razorvine.Pyrolite/NamingExample/TestNaming.cs +++ b/dotnet/Razorvine.Pyrolite/NamingExample/TestNaming.cs @@ -45,14 +45,8 @@ private static void Test() { ns.set_metadata("Pyro.NameServer", metadata); - Console.WriteLine("\nobjects registered in the name server:"); - var objects = ns.list(null, null); - foreach(string key in objects.Keys) { - Console.WriteLine(key + " --> " + objects[key]); - } - Console.WriteLine("\nobjects registered in the name server, with metadata:"); - var objectsm = ns.list_with_meta(null, null); + var objectsm = ns.list(null, null); foreach(string key in objectsm.Keys) { var registration = objectsm[key]; Console.WriteLine(key + " --> " + registration.Item1); @@ -60,18 +54,16 @@ private static void Test() { } Console.WriteLine("\nobjects registered having all metadata:"); - objects = ns.list(null, null, new []{"blahblah", "class:Pyro5.naming.NameServer"}, null); + var objects = ns.yplookup(new []{"blahblah", "class:Pyro5.nameserver.NameServer"}, null); foreach(string name in objects.Keys) { - Console.WriteLine(name + " --> " + objects[name]); + var entry = objectsm[name]; + Console.WriteLine(name + " --> " + entry.Item1); + Console.WriteLine(" metadata: " + string.Join(", ", entry.Item2)); } + Console.WriteLine("\nobjects registered having any metadata:"); - objects = ns.list(null, null, null, new []{"blahblah", "class:Pyro5.naming.NameServer"}); + objects = ns.yplookup(null, new []{"blahblah", "class:Pyro5.nameserver.NameServer"}); foreach(string name in objects.Keys) { - Console.WriteLine(name + " --> " + objects[name]); - } - Console.WriteLine("\nobjects registered having any metadata (showing it too):"); - objectsm = ns.list_with_meta(null, null, null, new []{"blahblah", "class:Pyro5.naming.NameServer"}); - foreach(string name in objectsm.Keys) { var entry = objectsm[name]; Console.WriteLine(name + " --> " + entry.Item1); Console.WriteLine(" metadata: " + string.Join(", ", entry.Item2)); diff --git a/dotnet/Razorvine.Pyrolite/Pyrolite/Pyro/NameServerProxy.cs b/dotnet/Razorvine.Pyrolite/Pyrolite/Pyro/NameServerProxy.cs index f50f8d0..c7c9598 100644 --- a/dotnet/Razorvine.Pyrolite/Pyrolite/Pyro/NameServerProxy.cs +++ b/dotnet/Razorvine.Pyrolite/Pyrolite/Pyro/NameServerProxy.cs @@ -56,26 +56,8 @@ public void set_metadata(string name, ISet metadata) { call("set_metadata", name, metadata); } - public IDictionary list(string prefix, string regex) { - IDictionary hash = (IDictionary) call("list", prefix, regex); - IDictionary typed=new Dictionary(hash.Count); - foreach(object name in hash.Keys) { - typed[(string)name]=(string)hash[name]; - } - return typed; - } - - public IDictionary list(string prefix, string regex, IEnumerable metadata_all, IEnumerable metadata_any) { - IDictionary hash = (IDictionary) call("list", prefix, regex, metadata_all, metadata_any); - IDictionary typed=new Dictionary(hash.Count); - foreach(object name in hash.Keys) { - typed[(string)name]=(string)hash[name]; - } - return typed; - } - - public IDictionary>> list_with_meta(string prefix, string regex) { - IDictionary hash = (IDictionary) call("list", prefix, regex, null, null, true); + public IDictionary>> list(string prefix, string regex) { + IDictionary hash = (IDictionary) call("list", prefix, regex, true); IDictionary>> typed=new Dictionary>>(hash.Count); foreach(object name in hash.Keys) { var o = (object[]) hash[name]; @@ -86,8 +68,8 @@ public IDictionary>> list_with_meta(string pr return typed; } - public IDictionary>> list_with_meta(string prefix, string regex, IEnumerable metadata_all, IEnumerable metadata_any) { - IDictionary hash = (IDictionary) call("list", prefix, regex, metadata_all, metadata_any, true); + public IDictionary>> yplookup(IEnumerable meta_all, IEnumerable meta_any) { + IDictionary hash = (IDictionary) call("yplookup", meta_all, meta_any, true); IDictionary>> typed=new Dictionary>>(hash.Count); foreach(object name in hash.Keys) { var o = (object[]) hash[name];