View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.teamcomm.server;
2   
3   import cz.cuni.amis.pogamut.base.agent.IAgentId;
4   import cz.cuni.amis.pogamut.base.agent.params.IAgentParameters;
5   import cz.cuni.amis.pogamut.base.communication.connection.IWorldConnectionAddress;
6   import cz.cuni.amis.pogamut.ut2004.agent.params.UT2004AgentParameters;
7   
8   public class UT2004TCServerParams extends UT2004AgentParameters {
9   	
10  	private String bindHost = null;
11  	private Integer bindPort = null;
12  	
13  	public UT2004TCServerParams() {
14  		super();
15  	}
16  	
17  	@Override
18  	public UT2004TCServerParams setAgentId(IAgentId agentId) {
19  		super.setAgentId(agentId);
20  		return this;
21  	}
22  	
23  	@Override
24  	public UT2004TCServerParams setWorldAddress(IWorldConnectionAddress address) {
25  		super.setWorldAddress(address);
26  		return this;
27  	}
28  
29  	public String getBindHost() {
30  		return bindHost;
31  	}
32  
33  	public void setBindHost(String bindHost) {
34  		this.bindHost = bindHost;
35  	}
36  
37  	public int getBindPort() {
38  		return bindPort;
39  	}
40  
41  	public void setBindPort(int bindPort) {
42  		this.bindPort = bindPort;
43  	}
44  	
45  	@Override
46  	public void assignDefaults(IAgentParameters defaults) {
47  		super.assignDefaults(defaults);
48  		if (defaults instanceof UT2004TCServerParams) {
49  			if (bindHost == null) bindHost = ((UT2004TCServerParams)defaults).getBindHost();
50  			if (bindPort == null) bindPort = ((UT2004TCServerParams)defaults).getBindPort();			
51  		}
52  	}
53  	
54  }