if ( submittedService.link().action() == FilterEntryActions.UPDATE) cacheService.link().action(FilterEntryActions.UPDATE); for(int submittedIndex = 0; submittedIndex < submittedService.link().linkList().size(); submittedIndex++) submittedLink = submittedService.link().linkList().get(submittedIndex); boolean foundLink = false; for(int cacheIndex = 0; cacheIndex < cacheService.link().linkList().size(); cacheIndex++) cacheLink = cacheService.link().linkList().get(cacheIndex); cacheService.link().linkList().add(cacheLink); retCode = submittedService.link().update(cacheService.link());
ServiceImpl() { info = new ServiceInfo(); state = new ServiceState(); groupStateList = new ArrayList<Service.ServiceGroup>(); load = new ServiceLoad(); data = new Service.ServiceData(); link = new ServiceLinkInfo(); seqMcast = new ServiceSeqMcastInfo(); action = MapEntryActions.ADD; }
/** * Performs a deep copy of {@link ServiceLinkInfo} object. * * @param destServiceLinkInfo ServiceLinkInfo object to copy this object into. It cannot be null. * * @return UPA return value indicating success or failure of copy operation. */ public int copy(ServiceLinkInfo destServiceLinkInfo) { assert (destServiceLinkInfo != null) : "destServiceLinkInfo can not be null"; destServiceLinkInfo.clear(); destServiceLinkInfo.action(action()); int ret = CodecReturnCodes.SUCCESS; for (ServiceLink serviceLink : linkList()) { ServiceLink serviceLink2 = new ServiceLink(); ret = serviceLink.copy(serviceLink2); if (ret != CodecReturnCodes.SUCCESS) return ret; destServiceLinkInfo.linkList().add(serviceLink2); } return ret; }
respService.link().action(FilterEntryActions.SET);
ret = link().copy(destService.link()); if (ret != CodecReturnCodes.SUCCESS) return ret;
Service.ServiceLinkInfo linkList = new Service.ServiceLinkInfo(); Service.ServiceLinkInfo linkListDec = new Service.ServiceLinkInfo(); linkList.clear(); linkListDec.clear(); int flags = flagsList[i]; rdmServiceLink.flags(flags); linkList.action(FilterEntryActions.SET); linkList.linkList().add(rdmServiceLink); encIter.setBufferAndRWFVersion(buffer, Codec.majorVersion(), Codec.minorVersion()); int ret = linkList.encode(encIter); assertEquals(CodecReturnCodes.SUCCESS, ret); dIter.clear(); dIter.setBufferAndRWFVersion(buffer, Codec.majorVersion(), Codec.minorVersion()); ret = linkListDec.decode(dIter); assertEquals(0, linkListDec.linkList().size());
destServiceLinkInfo.action(action()); for (int i = 0; i < linkList().size(); ++i) switch (linkList().get(i).action()) for (int j = 0; j < destServiceLinkInfo.linkList().size(); ++j) if (destServiceLinkInfo.linkList().get(j).name().equals(linkList().get(i).name())) ret = linkList().get(i).copy(destServiceLinkInfo.linkList().get(j)); foundService = true; break; destServiceLinkInfo.linkList().add(serviceLink); ret = linkList().get(i).copy(serviceLink); if (ret != CodecReturnCodes.SUCCESS) return ret; for (int j = 0; j < destServiceLinkInfo.linkList().size(); ++j) if (destServiceLinkInfo.linkList().get(j).name().equals(linkList().get(i).name())) destServiceLinkInfo.linkList().remove(j); break;
ret = link().update(destService.link()); if (ret != CodecReturnCodes.SUCCESS) return ret;
Service.ServiceLinkInfo linkList1 = new Service.ServiceLinkInfo(); Service.ServiceLinkInfo linkList2 = new Service.ServiceLinkInfo(); long linkCode = 1; long linkState = 1; linkList1.clear(); linkList2.clear(); int flags = flagsList[i]; rdmServiceLink.flags(flags); linkList1.action(FilterEntryActions.SET); linkList1.linkList().add(rdmServiceLink); int ret = linkList1.copy(linkList2); assertEquals(linkList1.action(), linkList2.action()); assertEquals(linkList1.linkList().size(), linkList2.linkList().size()); rdmServiceLink2 = linkList2.linkList().get(0); assertEquals(rdmServiceLink.flags(), rdmServiceLink2.flags()); assertEquals(rdmServiceLink.linkState(), rdmServiceLink2.linkState());
return ret; for (ServiceLink serviceLink : linkList())
if (rdmService.checkHasLink() && rdmService.link().action() != FilterEntryActions.CLEAR)
private void buildRDMServiceLink(Service.ServiceLinkInfo serviceLinkInfo, int action) { int flags = Service.ServiceLinkFlags.HAS_CODE | Service.ServiceLinkFlags.HAS_TEXT | Service.ServiceLinkFlags.HAS_TYPE; long linkCode = 1; long linkState = 1; long type = DataTypes.ASCII_STRING; Service.ServiceLink serviceLink = new Service.ServiceLink(); serviceLinkInfo.linkList().add(serviceLink); serviceLinkInfo.action(action); serviceLink.clear(); serviceLink.action(MapEntryActions.ADD); serviceLink.flags(flags); serviceLink.name().data("name"); serviceLink.linkState(linkState); if (serviceLink.checkHasCode()) { serviceLink.linkCode(linkCode); } if (serviceLink.checkHasText()) { serviceLink.text().data("text"); } if (serviceLink.checkHasType()) { serviceLink.type(type); } }
/** * Performs a deep copy of {@link ServiceLinkInfo} object. * * @param destServiceLinkInfo ServiceLinkInfo object to copy this object into. It cannot be null. * * @return UPA return value indicating success or failure of copy operation. */ public int copy(ServiceLinkInfo destServiceLinkInfo) { assert (destServiceLinkInfo != null) : "destServiceLinkInfo can not be null"; destServiceLinkInfo.clear(); destServiceLinkInfo.action(action()); int ret = CodecReturnCodes.SUCCESS; for (ServiceLink serviceLink : linkList()) { ServiceLink serviceLink2 = new ServiceLink(); ret = serviceLink.copy(serviceLink2); if (ret != CodecReturnCodes.SUCCESS) return ret; destServiceLinkInfo.linkList().add(serviceLink2); } return ret; }
/** * Sets link information elements -List of entries with information * about upstream sources. * * @param linkList the link list */ public void linkList(List<ServiceLink> linkList) { assert (linkList != null) : "linkList can not be null"; linkList().clear(); for (ServiceLink serviceLink : linkList) { linkList().add(serviceLink); } }