/*
 *  Copyright (C) 2006  Takashi Kasuya <kasuya@sfc.keio.ac.jp>
 *
 * This library is free software; you can redistribute it and/or
 *　modify it under the terms of the GNU Lesser General Public
 *　License as published by the Free Software Foundation; either
 *　version 2.1 of the License, or (at your option) any later version.
 *　This library is distributed in the hope that it will be useful,
 *　but WITHOUT ANY WARRANTY; without even the implied warranty of
 *　MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *　Lesser General Public License for more details.
 *
 *　You should have received a copy of the GNU Lesser General Public
 *　License along with this library; if not, write to the Free Software
 *　Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

package jp.ac.naka.ec.entity;

import javax.sip.address.URI;

import jp.ac.naka.ec.Location;
import jp.ac.naka.ec.TreeNode;

/**
 * 
 * @author Takashi Kasuya
 *
 */
public interface Entity extends TreeNode, EntityListener {

	/**
	 * SDPを指定してセッションのリクエスト
	 * 
	 * @param sdp
	 * @param target
	 * @return
	 */
	public boolean sendOffer(net.sourceforge.jsdp.SessionDescription sdp,
			Entity target);

	/**
	 * SDPを指定せずにリクエスト、相手のSDPによるフォーマットの指定に従う。
	 * 
	 * @param target
	 * @return
	 */
	public boolean sendOffer(Entity target);

	/**
	 * メッセージを全てのリスナに対して配信
	 * 
	 * @param msg
	 */
	public void sendMessage(String msg) ;

	/**
	 * ターゲットを指定してメッセージの送信
	 * 
	 * @param msg
	 * @param targetName
	 */
	public void sendMessage(String msg, String targetName);
			

	/**
	 * ターゲットを指定してメッセージの送信
	 * 
	 * @param msg
	 * @param targetName
	 */
	public void sendMessage(String msg, EntityListener target);

	

	/**
	 * BYEメッセージの送信
	 * 
	 * @param target
	 * @return
	 */
	public boolean sendBye(EntityListener target) ;

	

	/**
	 * EntityTypeの取得
	 * 
	 * @return
	 */
	public EntityType getEntityType();

	/**
	 * 
	 * @param type
	 */
	public void setEntityType(EntityType type);

	/**
	 * 所属するEntityContainerの取得
	 * 
	 * @return
	 */
	public EntityContainer getContainer();

	/**
	 * 
	 * @param uri
	 */
	public void setURI(URI uri);

	/**
	 * 
	 * @return
	 */
	public URI getURI();

	/**
	 * 
	 * @param id
	 */
	public void setTupleId(String id);

	/**
	 * 
	 * @return
	 */
	public String getTupleId();

	/**
	 * 
	 * @param priority
	 */
	public void setPriority(float priority);

	/**
	 * 
	 * @return
	 */
	public float getPriority();

	/**
	 * 
	 * @return
	 */
	public String getDescription();

	/**
	 * ローカルにあるEntityかどうか。
	 * 
	 * @return
	 */
	public boolean isLocal();

	/**
	 * 
	 * @param a
	 */
	public void setLocal(boolean a);

	/**
	 * 
	 * @return
	 */
	public Location getLocation();

	/**
	 * 
	 * @param location
	 */
	public void setLocation(Location location);

}
