private Location createLocation() {
    Location location = new Location();

    Policy policy = new Policy();

    policy.setActualAvailabilityStart(new DateTime(2012, 7, 3, 0, 10, 0, DateTimeZone.UTC));
    policy.setAvailabilityStart(new DateTime(2012, 7, 3, 0, 0, 0, DateTimeZone.UTC));
    policy.setAvailabilityEnd(new DateTime(2013, 7, 17, 0, 0, 0, DateTimeZone.UTC));

    location.setPolicy(policy);

    return location;
  }
Esempio n. 2
0
 private Policy policyFor(WsAudioItem audioItem) {
   Policy policy = new Policy();
   for (String date :
       ImmutableList.of(
           audioItem.getAllowDownloadFrom(),
           audioItem.getInputDatetime(),
           audioItem.getLastAmendTimestamp())) {
     DateTime parsed = parse(date);
     if (parsed != null) {
       policy.setAvailabilityStart(parsed);
       break;
     }
   }
   policy.setAvailableCountries(ImmutableSet.of(Countries.ALL));
   policy.setRevenueContract(PRIVATE);
   return policy;
 }