Package com.opengamma.master.holiday

Examples of com.opengamma.master.holiday.HolidaySearchRequest


                                 EHCachingSearchCache.extractUniqueIds(result.getDocuments()));
      }
    });
   
    // Prime search cache
    HolidaySearchRequest defaultSearch = new HolidaySearchRequest();
    defaultSearch.setSortOrder(HolidaySearchSortOrder.NAME_ASC);
    _documentSearchCache.prefetch(defaultSearch, PagingRequest.FIRST_PAGE);
  }
View Full Code Here


  }

  //-------------------------------------------------------------------------
  @Override
  public boolean isHoliday(final LocalDate dateToCheck, final Currency currency) {
    HolidaySearchRequest request = new HolidaySearchRequest(currency);
    request.setVersionCorrection(getVersionCorrection());
    return isHoliday(request, dateToCheck);
  }
View Full Code Here

    return isHoliday(request, dateToCheck);
  }

  @Override
  public boolean isHoliday(final LocalDate dateToCheck, final HolidayType holidayType, final ExternalIdBundle regionOrExchangeIds) {
    HolidaySearchRequest request = getSearchRequest(holidayType, regionOrExchangeIds);
    return isHoliday(request, dateToCheck);
  }
View Full Code Here

    HolidaySearchRequest request = getSearchRequest(holidayType, regionOrExchangeIds);
    return isHoliday(request, dateToCheck);
  }

  protected HolidaySearchRequest getSearchRequest(final HolidayType holidayType, final ExternalIdBundle regionOrExchangeIds) {
    HolidaySearchRequest request = new HolidaySearchRequest(holidayType, regionOrExchangeIds);
    request.setVersionCorrection(getVersionCorrection());
    return request;
  }
View Full Code Here

    return request;
  }

  @Override
  public boolean isHoliday(final LocalDate dateToCheck, final HolidayType holidayType, final ExternalId regionOrExchangeId) {
    HolidaySearchRequest request = new HolidaySearchRequest(holidayType, ExternalIdBundle.of(regionOrExchangeId));
    request.setVersionCorrection(getVersionCorrection());
    return isHoliday(request, dateToCheck);
  }
View Full Code Here

   
  }
 
  private List<HolidayDocument> runPagedSearch(PagingRequest pr, List<HolidayDocument> m1Result, int m1Total, List<HolidayDocument> m2Result, int m2Total) {
    HolidaySearchResult result = new HolidaySearchResult();
    HolidaySearchRequest searchRequest = new HolidaySearchRequest();
    searchRequest.setPagingRequest(pr);
    HolidaySearchResult m1SearchResult = new HolidaySearchResult();
    m1SearchResult.setDocuments(m1Result);
    m1SearchResult.setPaging(Paging.of(PagingRequest.ofIndex(0, m1Result.size()), m1Total));
    HolidaySearchResult m2SearchResult = new HolidaySearchResult();
    m2SearchResult.setPaging(Paging.of(PagingRequest.ofIndex(0, m2Result.size()), m2Total));
View Full Code Here

  }

  //-------------------------------------------------------------------------
  public void test_isHoliday_LocalDateCurrency_holiday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(GBP);
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    ManageableHoliday holiday = new ManageableHoliday(GBP, Collections.singletonList(DATE_MONDAY));
    HolidaySearchResult result = new HolidaySearchResult();
    result.getDocuments().add(new HolidayDocument(holiday));
   
    when(mock.search(request)).thenReturn(result);
View Full Code Here

    assertEquals(true, testResult);
  }

  public void test_isHoliday_LocalDateCurrency_workday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(GBP);
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    HolidaySearchResult result = new HolidaySearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_MONDAY, GBP);
View Full Code Here

    assertEquals(false, testResult);
  }

  public void test_isHoliday_LocalDateCurrency_sunday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(GBP);
    request.setDateToCheck(DATE_SUNDAY);
    request.setVersionCorrection(VC);
    HolidaySearchResult result = new HolidaySearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterHolidaySource test = new MasterHolidaySource(mock, VC);
    boolean testResult = test.isHoliday(DATE_SUNDAY, GBP);
View Full Code Here

  }

  //-------------------------------------------------------------------------
  public void test_isHoliday_LocalDateTypeExternalId_holiday() throws Exception {
    HolidayMaster mock = mock(HolidayMaster.class);
    HolidaySearchRequest request = new HolidaySearchRequest(HolidayType.BANK, ExternalIdBundle.of(ID));
    request.setDateToCheck(DATE_MONDAY);
    request.setVersionCorrection(VC);
    ManageableHoliday holiday = new ManageableHoliday(GBP, Collections.singletonList(DATE_MONDAY));
    HolidaySearchResult result = new HolidaySearchResult();
    result.getDocuments().add(new HolidayDocument(holiday));
   
    when(mock.search(request)).thenReturn(result);
View Full Code Here

TOP

Related Classes of com.opengamma.master.holiday.HolidaySearchRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.