[Asterisk-java-cvs] CVS: asterisk-java/src/java/net/sf/asterisk/manager AsteriskServer.java,1.1,1.2
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-02-23 21:33:33
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26097/src/java/net/sf/asterisk/manager Modified Files: AsteriskServer.java Channel.java Log Message: Index: AsteriskServer.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/AsteriskServer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AsteriskServer.java 23 Feb 2005 12:45:20 -0000 1.1 +++ AsteriskServer.java 23 Feb 2005 21:33:10 -0000 1.2 @@ -7,56 +7,87 @@ package net.sf.asterisk.manager; import java.io.Serializable; /** - * Represents an asterisk server that is connected via the manager API. - * + * Represents an Asterisk server that is connected via the Manager API. + * * @author PY * @version $Id$ */ public class AsteriskServer implements Serializable { private static final long serialVersionUID = 3257284738393125176L; - private String hostname = "localhost"; - private int port = 5038; + /** + * The hostname to use if none is provided. + */ + private static final String DEFAULT_HOSTNAME = "localhost"; + + /** + * The port to use if none is provided. + */ + private static final int DEFAULT_PORT = 5038; + + /** + * The hostname of the Asterisk server. + */ + private String hostname; + + /** + * The port on the Asterisk server the Asterisk Manager API is listening on. + */ + private int port; + + /** + * Creates a new AsteriskServer with default hostname and default port. + */ public AsteriskServer() { - + this.hostname = DEFAULT_HOSTNAME; + this.port = DEFAULT_PORT; } - public AsteriskServer(String hostname, int port) + /** + * Creates a new Asterisk server with the given hostname and port. + * @param hostname the hostname of the Asterisk server + * @param port the port on the Asterisk server the Asterisk Manager API is listening on + */ + public AsteriskServer(final String hostname, final int port) { this.hostname = hostname; this.port = port; } /** - * @return Returns the hostname. + * Returns the hostname. + * @return the hostname */ - public String getHostname() + public final String getHostname() { return hostname; } /** - * @param hostname The hostname to set. + * Sets the hostname. + * @param hostname the hostname to set */ - public void setHostname(String hostname) + public final void setHostname(final String hostname) { this.hostname = hostname; } /** - * @return Returns the port. + * Returns the port. + * @return the port */ - public int getPort() + public final int getPort() { return port; } /** - * @param port The port to set. + * Sets the port. + * @param port the port to set. */ - public void setPort(int port) + public final void setPort(final int port) { this.port = port; } Index: Channel.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/Channel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- Channel.java 23 Feb 2005 12:45:20 -0000 1.1 +++ Channel.java 23 Feb 2005 21:33:10 -0000 1.2 @@ -20,31 +20,66 @@ public class Channel implements Serializ private static final long serialVersionUID = -6919877370396385380L; private AsteriskServer asteriskServer; + + /** + * Unique id of this channel. + */ private String id; + + /** + * Name of this channel. + */ private String name; + + /** + * Caller ID of this channel. + */ private String callerId; + + /** + * State of this channel. + */ private ChannelStateEnum state; + + /** + * Account code used to bill this channel. + */ private String account; private String context; private String extension; private Integer priority; private String application; private String appData; + + /** + * Date this channel has been created. + */ private Date dateOfCreation; + + /** + * If this channel is bridged to another channel, the linkedChannel contains the channel this + * channel is bridged with. + */ private Channel linkedChannel; /** - * Creates a new channel. - * @param name name of this channel, for example "SIP/1310-20da" - * @param id unique id of this channel, for example "1099015093.165" + * Creates a new Channel. + * @param name name of this channel, for example "SIP/1310-20da". + * @param id unique id of this channel, for example "1099015093.165". */ - public Channel(String name, String id) + public Channel(final String name, final String id) { this.name = name; this.id = id; } - public Channel(String name, String id, AsteriskServer server) + /** + * Creates a new Channel on the given server. + * @param name name of this channel, for example "SIP/1310-20da". + * @param id unique id of this channel, for example "1099015093.165". + * @param server the Asterisk server this channel exists on. + */ + public Channel(final String name, final String id, final AsteriskServer server) { this.name = name; this.id = id; @@ -52,153 +87,187 @@ public class Channel implements Serializ } /** - * @return Returns the asteriskServer. + * Returns the Asterisk server. + * @return the Asterisk server. */ - public AsteriskServer getAsteriskServer() + public final AsteriskServer getAsteriskServer() { return asteriskServer; } /** - * @param asteriskServer The asteriskServer to set. + * Sets the Asterisk server. + * @param asteriskServer the Asterisk server to set. */ - public void setAsteriskServer(AsteriskServer asteriskServer) + public final void setAsteriskServer(final AsteriskServer asteriskServer) { this.asteriskServer = asteriskServer; } /** * Returns the unique id of this channel, for example "1099015093.165". + * @return the unique id of this channel. */ - public String getId() + public final String getId() { return id; } /** * Returns the name of this channel, for example "SIP/1310-20da". + * @return the name of this channel. */ - public String getName() + public final String getName() { return name; } /** * Sets the name of this channel. + * @param name the name of this channel. */ - public void setName(String name) + public final void setName(final String name) { this.name = name; } /** * Returns the caller id of this channel. + * @return the caller id of this channel. */ - public String getCallerId() + public final String getCallerId() { return callerId; } /** * Sets the caller id of this channel. + * @param callerId the calleid id of this channel. */ - public void setCallerId(String callerId) + public final void setCallerId(final String callerId) { this.callerId = callerId; } /** * Returns the state of this channel. + * @return the state of this channel. */ - public ChannelStateEnum getState() + public final ChannelStateEnum getState() { return state; } /** * Sets the state of this channel. + * @param state the state of this channel. */ - public void setState(ChannelStateEnum state) + public final void setState(final ChannelStateEnum state) { this.state = state; } - public String getAccount() + /** + * Returns the account code used to bill this channel. + * @return the account code used to bill this channel. + */ + public final String getAccount() { return account; } - public void setAccount(String account) + /** + * Sets the account code used to bill this channel. + * @param account the account code used to bill this channel. + */ + public final void setAccount(final String account) { this.account = account; } - public String getContext() + public final String getContext() { return context; } - public void setContext(String context) + public final void setContext(final String context) { this.context = context; } - public String getExtension() + public final String getExtension() { return extension; } - public void setExtension(String extension) + public final void setExtension(final String extension) { this.extension = extension; } - public Integer getPriority() + public final Integer getPriority() { return priority; } - public void setPriority(Integer priority) + public final void setPriority(final Integer priority) { this.priority = priority; } - public String getApplication() + public final String getApplication() { return application; } - public void setApplication(String application) + public final void setApplication(final String application) { this.application = application; } - public String getAppData() + public final String getAppData() { return appData; } - public void setAppData(String appData) + public final void setAppData(final String appData) { this.appData = appData; } - public Date getDateOfCreation() + /** + * Returns the date this channel has been created. + * @return the date this channel has been created. + */ + public final Date getDateOfCreation() { return dateOfCreation; } - public void setDateOfCreation(Date dateOfCreation) + /** + * Sets the date this channel has been created. + * @param dateOfCreation the date this channel has been created. + */ + public final void setDateOfCreation(final Date dateOfCreation) { this.dateOfCreation = dateOfCreation; } - public Channel getLinkedChannel() + /** + * Returns the channel this channel is bridged with, if any. + * @return the channel this channel is bridged with, or <code>null</code> if this channel is + * currently not bridged to another channel. + */ + public final Channel getLinkedChannel() { return linkedChannel; } - public void setLinkedChannel(Channel linkedChannel) + /** + * Sets the channel this channel is bridged with. + * @param linkedChannel the channel this channel is bridged with. + */ + public final void setLinkedChannel(final Channel linkedChannel) { this.linkedChannel = linkedChannel; } @@ -222,5 +291,4 @@ public class Channel implements Serializ { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } - } |