1 26 27 28 package org.objectweb.mobilitools.smi; 29 30 31 import org.omg.CfMAF.*; 32 import java.util.Properties ; 33 34 35 public class FinderEntry 36 { 37 org.objectweb.mobilitools.smi.api.Name name; 38 String location; 39 Object profile; 40 41 42 public FinderEntry(Name name, String location, Object profile) 43 { 44 this(new org.objectweb.mobilitools.smi.api.Name(name), location, profile); 45 } 46 47 48 public FinderEntry(org.objectweb.mobilitools.smi.api.Name name, String location, Object profile) 49 { 50 this.name = name; 51 this.location = location; 52 this.profile = profile; 53 } 54 55 56 public String toString() 57 { 58 return (isAgent() ? "agent " : "agency ") + name.toString(); 59 } 60 61 62 public boolean isAgent() 63 { 64 return profile instanceof AgentProfile; 65 } 66 67 68 public org.objectweb.mobilitools.smi.api.Name getName() 69 { 70 return name; 71 } 72 73 74 public String getLocation() 75 { 76 return location; 77 } 78 79 80 public Object getProfile() 81 { 82 return profile; 83 } 84 85 86 public Properties getProperties() 87 { 88 if (isAgent()) 89 { 90 return Misc.any2property(((AgentProfile)profile).properties); 91 } 92 else 93 { 94 return Misc.any2property(((AgentSystemInfo)profile).properties); 95 } 96 } 97 } 98 | Popular Tags |