001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.network.util;
016    
017    import com.liferay.portal.kernel.webcache.WebCacheItem;
018    import com.liferay.portal.kernel.webcache.WebCachePoolUtil;
019    import com.liferay.portlet.network.model.DNSLookup;
020    import com.liferay.portlet.network.model.Whois;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class NetworkUtil {
026    
027            public static DNSLookup getDNSLookup(String domain) {
028                    WebCacheItem wci = new DNSLookupWebCacheItem(domain);
029    
030                    return (DNSLookup)WebCachePoolUtil.get(
031                            NetworkUtil.class.getName() + ".dnslookup." + domain, wci);
032            }
033    
034            public static Whois getWhois(String domain) {
035                    WebCacheItem wci = new WhoisWebCacheItem(domain);
036    
037                    return (Whois)WebCachePoolUtil.get(
038                            NetworkUtil.class.getName() + ".whois." + domain, wci);
039            }
040    
041    }