Instant Holiday Connection
The Light Development Holiday Client API is a Java class library to seamlessly
integrate arbitrary other applications with the
World Holiday Calendar Service
to make them aware of special observation days around the globe.
One Library Has It All
The Holiday Client API is simply added to the classpath of an application
to connect it to always up to date worldwide holiday information instantly. Nothing
more than the libraries from the Holiday Client API package and a connection to
the internet are necessary.
Encapsulated Communication
The API wraps all parts necessary to communicate with the World Holiday
Calendar Service through HTTP and SSL. Not more than a few
API calls are
necessary once the library is in the classpath.
Simple code example
HolidayClient holidayClient = new HolidayClient();
try {
holidayClient.login(
"https://secure.lightdev.com/sec/apps",
"",
0,
true,
Client.DEFAULT_AUTHORIZER,
"demo",
"demo");
String region_id_germany = "2";
String property_id_all = "9";
GregorianCalendar now = new GregorianCalendar();
int previousYear = now.get(Calendar.YEAR) - 1;
YearEvent[] events = holidayClient.getEventList(
previousYear,
property_id_all,
region_id_germany,
true,
true,
true,
null);
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
for(int i = 0; i < events.length; i++) {
String eventName = events[i].toString();
Integer id = (Integer) events[i].getId();
GregorianCalendar[] dates = events[i].getDates();
System.out.println("occurrences in year " +
previousYear + " for " + id + " " + eventName + ":");
for(int k = 0; k < dates.length; k++) {
GregorianCalendar c = dates[k];
System.out.println(" " + sdf.format(c.getTime()));
}
}
holidayClient.logout(Client.DEFAULT_AUTHORIZER);
}
catch (Throwable e) {
e.printStackTrace();
}
|
Download here
Please use the links in below box to download your copy of the
Holiday Client API.
Installation
Download and extract the ZIP file denoted by link "release package" above. Add all
Java class libraries resulting from extraction to the classpath of an application that
is to use the Holiday Client API.
Instant testing
Once downloaded and added to the classpath you can test the library with own
applications right away. The
World Holiday Calendar Service
allows unlimited access for the entire recent year, i.e. the year that is previous
to the current year.
Simply create a free user account and call method getEventList for
the previous year.
Purchase only what you need
After successful testing you can either
purchase
individual year/region combinations
which can be accessed for unlimited times after the purchase or you can
subscribe to
unlimited access at the self service shop at the
World Holiday Calendar Service.
|