public BedSpaceStateLiteVo saveCloseBed(BedSpaceStateLiteVo bedSpaceState, String user, ReasonForBedClosure reason, DateTime estReOpen) throws StaleObjectException { if(bedSpaceState == null) throw new CodingRuntimeException("bedSpaceState is null in method saveCloseBed"); BedSpaceState doBedSpace = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState); doBedSpace.getCurrentBedStatus().setEstReopeningDateTime(estReOpen != null ? estReOpen.getJavaDate() : null); doBedSpace.getCurrentBedStatus().setReasonForClosure(getDomLookup(reason)); doBedSpace.getCurrentBedStatus().getSystemInformation().setCreationUser(user); getDomainFactory().save(doBedSpace); return BedSpaceStateLiteVoAssembler.create(doBedSpace); }