/*
 * @(#)ReceiverResource.java
 *
 * Copyright (C) 2005 Infocity Inc. All Rights Reserved.
 */
package info.dragonlady.sso;

import info.dragonlady.sso.util.ResourceParseException;
import info.dragonlady.sso.util.ResourceUtils;


/**
 * 目的サイトホスト名とレシーバURLのマッピングリソースアクセスクラス
 * 
 * @author Hiroshi.Ebata(INFOCITY)
 * @version $Revision: 1.1 $ $Date: 2005/11/11 14:08:42 $
 */
public class ReceiverResource {

	/**
	 * リソースパス
	 */
	private static final String resourcePath = "resources/receiver.xml";

	/**
	 * ホスト名とパスからレシーバのURLを取得
	 * 
	 * @param host ホスト名
	 * @param context コンテキスト名
	 * @return String レシーバURL
	 * @throws ResourceParseException
	 */
	public static final String getReceiver(String host, String context) throws ResourceParseException {
		String expression = "receiver-list/receiver[@host=\"" + host + "\" and @context=\"" + context + "\"]/@url";
		return ResourceUtils.getString(ReceiverResource.resourcePath, expression);
	}

}
