@Test public void testLiveActivityGroupCopyCache() { LiveActivityGroup srcLiveActivityGroup = new SimpleLiveActivityGroup(); LiveActivityGroup clonedLiveActivityGroup1 = cloner.cloneLiveActivityGroup(srcLiveActivityGroup); LiveActivityGroup clonedLiveActivityGroup2 = cloner.cloneLiveActivityGroup(srcLiveActivityGroup); assertEquals(clonedLiveActivityGroup1, clonedLiveActivityGroup2); }
@Override public LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src) { String id = src.getId(); LiveActivityGroup clone = liveActivityGroupClones.get(id); if (clone != null) { return clone; } clone = activityRepository.newLiveActivityGroup(); liveActivityGroupClones.put(id, clone); clone.setName(namePrefix + " " + src.getName()); clone.setDescription(src.getDescription()); clone.setMetadata(src.getMetadata()); for (GroupLiveActivity activity : src.getLiveActivities()) { LiveActivity activityClone = cloneLiveActivity(activity.getActivity()); clone.addLiveActivity(activityClone, activity.getDependency()); } return clone; }
StandardInteractiveSpacesDomainCloner implements InteractiveSpacesDomainCloner { @Override public LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src) { String id = src.getId(); LiveActivityGroup clone = liveActivityGroupClones.get(id); if (clone != null) { return clone; } clone = activityRepository.newLiveActivityGroup(); liveActivityGroupClones.put(id, clone); clone.setName(namePrefix + " " + src.getName()); clone.setDescription(src.getDescription()); clone.setMetadata(src.getMetadata()); for (GroupLiveActivity activity : src.getLiveActivities()) { LiveActivity activityClone = cloneLiveActivity(activity.getActivity()); clone.addLiveActivity(activityClone, activity.getDependency()); } return clone; } }
StandardInteractiveSpacesDomainCloner implements InteractiveSpacesDomainCloner { @Override public LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src) { String id = src.getId(); LiveActivityGroup clone = liveActivityGroupClones.get(id); if (clone != null) { return clone; } clone = activityRepository.newLiveActivityGroup(); liveActivityGroupClones.put(id, clone); clone.setName(namePrefix + " " + src.getName()); clone.setDescription(src.getDescription()); clone.setMetadata(src.getMetadata()); for (GroupLiveActivity activity : src.getLiveActivities()) { LiveActivity activityClone = cloneLiveActivity(activity.getActivity()); clone.addLiveActivity(activityClone, activity.getDependency()); } return clone; } StandardInteractiveSpacesDomainCloner(ActivityRepository activityRepository); }
StandardInteractiveSpacesDomainCloner implements InteractiveSpacesDomainCloner { @Override public LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src) { String id = src.getId(); LiveActivityGroup clone = liveActivityGroupClones.get(id); if (clone != null) { return clone; } clone = activityRepository.newLiveActivityGroup(); liveActivityGroupClones.put(id, clone); clone.setName(namePrefix + " " + src.getName()); clone.setDescription(src.getDescription()); clone.setMetadata(src.getMetadata()); for (GroupLiveActivity activity : src.getLiveActivities()) { LiveActivity activityClone = cloneLiveActivity(activity.getActivity()); clone.addLiveActivity(activityClone, activity.getDependency()); } return clone; } StandardInteractiveSpacesDomainCloner(ActivityRepository activityRepository); @Override void setNamePrefix(String namePrefix); @Override void setControllerMap(Map<SpaceController, SpaceController> controllerMap); @Override void saveClones(); @Override LiveActivity cloneLiveActivity(LiveActivity src); @Override LiveActivity getClonedLiveActivity(String srcId); @Override ActivityConfiguration cloneConfiguration(ActivityConfiguration src); @Override LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src); @Override LiveActivityGroup getClonedLiveActivityGroup(String srcId); @Override Space cloneSpace(Space src); @Override Space getClonedSpace(String srcId); }
StandardInteractiveSpacesDomainCloner implements InteractiveSpacesDomainCloner { @Override public LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src) { String id = src.getId(); LiveActivityGroup clone = liveActivityGroupClones.get(id); if (clone != null) { return clone; } clone = activityRepository.newLiveActivityGroup(); liveActivityGroupClones.put(id, clone); clone.setName(namePrefix + " " + src.getName()); clone.setDescription(src.getDescription()); clone.setMetadata(src.getMetadata()); for (GroupLiveActivity activity : src.getLiveActivities()) { LiveActivity activityClone = cloneLiveActivity(activity.getActivity()); clone.addLiveActivity(activityClone, activity.getDependency()); } return clone; } StandardInteractiveSpacesDomainCloner(ActivityRepository activityRepository); @Override void setNamePrefix(String namePrefix); @Override void setControllerMap(Map<SpaceController, SpaceController> controllerMap); @Override void saveClones(); @Override LiveActivity cloneLiveActivity(LiveActivity src); @Override LiveActivity getClonedLiveActivity(String srcId); @Override ActivityConfiguration cloneConfiguration(ActivityConfiguration src); @Override LiveActivityGroup cloneLiveActivityGroup(LiveActivityGroup src); @Override LiveActivityGroup getClonedLiveActivityGroup(String srcId); @Override Space cloneSpace(Space src); @Override Space getClonedSpace(String srcId);  }