Hi Chamila, Topology is structured in Service - > Cluster -> Member way. That is why it has to iterate services in order to get members.
On Sat, Nov 15, 2014 at 11:57 AM, Imesh Gunaratne <im...@apache.org> wrote: > We could introduce a map to handle this. > > On Fri, Nov 14, 2014 at 11:45 PM, Chamila De Alwis <chami...@wso2.com> > wrote: > >> Hi, >> >> Is there a direct way of doing $subject other than iterating through all >> the services from topology.getServices()? >> >> Service memberService = null; >> for (Service service: topology.getServices()){ >> Cluster cluster = service.getCluster(clusterId); >> if (cluster != null) { >> if (cluster.getMember(memberId) != null){ >> memberService = service; >> break; >> } >> }} >> >> >> >> Regards, >> Chamila de Alwis >> Software Engineer | WSO2 | +94772207163 >> Blog: code.chamiladealwis.com >> >> >> > > > -- > Imesh Gunaratne > > Technical Lead, WSO2 > Committer & PMC Member, Apache Stratos > -- Udara Liyanage Software Engineer WSO2, Inc.: http://wso2.com lean. enterprise. middleware web: http://udaraliyanage.wordpress.com phone: +94 71 443 6897