Loading src/main/java/org/etsi/osl/tmf/gsm674/reposervices/GeographicSiteManagementService.java +26 −2 Original line number Original line Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class GeographicSiteManagementService { private GeographicSite updateFields(GeographicSite newSite, GeographicSite existingSite){ private GeographicSite updateFields(GeographicSite newSite, GeographicSite existingSite){ if(newSite.getName()!=null) existingSite.setCalendar(newSite.getCalendar()); if(newSite.getName()!=null) existingSite.setName(newSite.getName()); if(newSite.getDescription()!=null) existingSite.setDescription(newSite.getDescription()); if(newSite.getDescription()!=null) existingSite.setDescription(newSite.getDescription()); if(newSite.getCode()!=null) existingSite.setCode(newSite.getCode()); if(newSite.getCode()!=null) existingSite.setCode(newSite.getCode()); if (newSite.getStatus()!=null) existingSite.setStatus(newSite.getStatus()); if (newSite.getStatus()!=null) existingSite.setStatus(newSite.getStatus()); Loading @@ -67,6 +67,14 @@ public class GeographicSiteManagementService { for(GeographicSiteRelationship n : newSite.getGeographicSiteRelationship()){ for(GeographicSiteRelationship n : newSite.getGeographicSiteRelationship()){ if(n.getUuid()==null){ if(n.getUuid()==null){ existingSite.addGeographicSiteRelationship(n); existingSite.addGeographicSiteRelationship(n); }else { for (GeographicSiteRelationship oldGeographicRelationship : existingSite.getGeographicSiteRelationship()){ if (n.getUuid().equals(oldGeographicRelationship.getUuid())){ if (n.getRole() !=null) oldGeographicRelationship.setRole(n.getRole()); if (n.getRelationshipType() !=null) oldGeographicRelationship.setRelationshipType(n.getRelationshipType()); if (n.getValidFor() !=null) oldGeographicRelationship.setValidFor(n.getValidFor()); } } } } } } } } Loading @@ -75,6 +83,15 @@ public class GeographicSiteManagementService { for(CalendarPeriod c: newSite.getCalendar()){ for(CalendarPeriod c: newSite.getCalendar()){ if(c.getUuid()==null){ if(c.getUuid()==null){ existingSite.addCalendarPeriod(c); existingSite.addCalendarPeriod(c); } else { for (CalendarPeriod oldCalendarPeriod: existingSite.getCalendar()){ if (c.getUuid().equals(oldCalendarPeriod.getUuid())){ if( c.getDay() !=null) oldCalendarPeriod.setDay(c.getDay()); if( c.getStatus() !=null) oldCalendarPeriod.setStatus(c.getStatus()); if( c.getTimeZone() !=null) oldCalendarPeriod.setTimeZone(c.getTimeZone()); if( c.getHourPeriod() !=null) oldCalendarPeriod.setHourPeriod(c.getHourPeriod()); } } } } } } } } Loading @@ -91,6 +108,13 @@ public class GeographicSiteManagementService { for(RelatedParty party: newSite.getRelatedParties()){ for(RelatedParty party: newSite.getRelatedParties()){ if(party.getUuid()==null){ if(party.getUuid()==null){ existingSite.addRelatedParty(party); existingSite.addRelatedParty(party); } else { for (RelatedParty rp: existingSite.getRelatedParties()){ if(party.getUuid().equals(rp.getUuid())){ if (party.getRole() !=null) rp.setRole(party.getRole()); if (party.getName() !=null) rp.setName(party.getName()); } } } } } } } } Loading Loading
src/main/java/org/etsi/osl/tmf/gsm674/reposervices/GeographicSiteManagementService.java +26 −2 Original line number Original line Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class GeographicSiteManagementService { private GeographicSite updateFields(GeographicSite newSite, GeographicSite existingSite){ private GeographicSite updateFields(GeographicSite newSite, GeographicSite existingSite){ if(newSite.getName()!=null) existingSite.setCalendar(newSite.getCalendar()); if(newSite.getName()!=null) existingSite.setName(newSite.getName()); if(newSite.getDescription()!=null) existingSite.setDescription(newSite.getDescription()); if(newSite.getDescription()!=null) existingSite.setDescription(newSite.getDescription()); if(newSite.getCode()!=null) existingSite.setCode(newSite.getCode()); if(newSite.getCode()!=null) existingSite.setCode(newSite.getCode()); if (newSite.getStatus()!=null) existingSite.setStatus(newSite.getStatus()); if (newSite.getStatus()!=null) existingSite.setStatus(newSite.getStatus()); Loading @@ -67,6 +67,14 @@ public class GeographicSiteManagementService { for(GeographicSiteRelationship n : newSite.getGeographicSiteRelationship()){ for(GeographicSiteRelationship n : newSite.getGeographicSiteRelationship()){ if(n.getUuid()==null){ if(n.getUuid()==null){ existingSite.addGeographicSiteRelationship(n); existingSite.addGeographicSiteRelationship(n); }else { for (GeographicSiteRelationship oldGeographicRelationship : existingSite.getGeographicSiteRelationship()){ if (n.getUuid().equals(oldGeographicRelationship.getUuid())){ if (n.getRole() !=null) oldGeographicRelationship.setRole(n.getRole()); if (n.getRelationshipType() !=null) oldGeographicRelationship.setRelationshipType(n.getRelationshipType()); if (n.getValidFor() !=null) oldGeographicRelationship.setValidFor(n.getValidFor()); } } } } } } } } Loading @@ -75,6 +83,15 @@ public class GeographicSiteManagementService { for(CalendarPeriod c: newSite.getCalendar()){ for(CalendarPeriod c: newSite.getCalendar()){ if(c.getUuid()==null){ if(c.getUuid()==null){ existingSite.addCalendarPeriod(c); existingSite.addCalendarPeriod(c); } else { for (CalendarPeriod oldCalendarPeriod: existingSite.getCalendar()){ if (c.getUuid().equals(oldCalendarPeriod.getUuid())){ if( c.getDay() !=null) oldCalendarPeriod.setDay(c.getDay()); if( c.getStatus() !=null) oldCalendarPeriod.setStatus(c.getStatus()); if( c.getTimeZone() !=null) oldCalendarPeriod.setTimeZone(c.getTimeZone()); if( c.getHourPeriod() !=null) oldCalendarPeriod.setHourPeriod(c.getHourPeriod()); } } } } } } } } Loading @@ -91,6 +108,13 @@ public class GeographicSiteManagementService { for(RelatedParty party: newSite.getRelatedParties()){ for(RelatedParty party: newSite.getRelatedParties()){ if(party.getUuid()==null){ if(party.getUuid()==null){ existingSite.addRelatedParty(party); existingSite.addRelatedParty(party); } else { for (RelatedParty rp: existingSite.getRelatedParties()){ if(party.getUuid().equals(rp.getUuid())){ if (party.getRole() !=null) rp.setRole(party.getRole()); if (party.getName() !=null) rp.setName(party.getName()); } } } } } } } } Loading