Skip to content

Commit ab02aec

Browse files
committed
[AJ-109] Finished Javadoc
1 parent bd4e819 commit ab02aec

8 files changed

+60
-19
lines changed

ANNOUNCEMENT

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ANNOUNCEMENT: Asterisk-Java 0.3.1 released
22

3-
Asterisk-Java 0.3.1, a free Java library for Asterisk PBX integration,
3+
Asterisk-Java 0.3.1, the free Java library for Asterisk PBX integration,
44
has been released.
55

66
The Asterisk-Java package consists of a set of Java classes that allow
@@ -16,7 +16,7 @@ following issues:
1616
* [AJ-68] - Support for Bridge Action
1717
* [AJ-74] - Support Strategy property in QueueParamsEvent
1818

19-
Asterisk-Java takes advantage of the features of Java 5.0 and therfore
19+
Asterisk-Java takes advantage of the features of Java 5.0 and therefore
2020
requires a Java Virtual Machine of at least version 1.5.0.
2121

2222
Asterisk-Java is used in several commercial environments and by

src/main/java/org/asteriskjava/AsteriskVersion.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class AsteriskVersion implements Comparable<AsteriskVersion>, Serializabl
5757
/**
5858
* Serial version identifier.
5959
*/
60-
private static final long serialVersionUID = -5696160640576385797L;
60+
private static final long serialVersionUID = 1L;
6161

6262
private AsteriskVersion(int version, String versionString)
6363
{

src/main/java/org/asteriskjava/manager/event/AgiExecEvent.java

+43-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* AgiExecEvents are triggered when an AGI command is executed. For each command two events are triggered:
55
* one before excution ("Start") and one after execution ("End").
6-
* <p>
6+
* <p/>
77
* The following sub events are reported:
88
* <ul>
99
* <li>Start: Execution of an AGI command has started.</li>
@@ -39,6 +39,7 @@ public class AgiExecEvent extends ManagerEvent
3939
private String commandId;
4040
private String command;
4141
private Integer resultCode;
42+
private String result;
4243

4344
/**
4445
* Creates a new AgiExecEvent.
@@ -74,6 +75,8 @@ public void setChannel(String channel)
7475
* Returns the sub event type. This is either "Start" or "End".
7576
*
7677
* @return the sub event type.
78+
* @see #SUB_EVENT_START
79+
* @see #SUB_EVENT_END
7780
*/
7881
public String getSubEvent()
7982
{
@@ -131,16 +134,55 @@ public void setCommand(String command)
131134
this.command = command;
132135
}
133136

137+
/**
138+
* Returns the result code.
139+
*
140+
* @return the result code.
141+
*/
134142
public Integer getResultCode()
135143
{
136144
return resultCode;
137145
}
138146

147+
/**
148+
* Sets the result code.
149+
*
150+
* @param resultCode the result code.
151+
*/
139152
public void setResultCode(Integer resultCode)
140153
{
141154
this.resultCode = resultCode;
142155
}
143156

157+
/**
158+
* Returns the result as a string.<p>
159+
* They correspond to the numeric values returned by {@link #getResultCode()}. Usually you will want to
160+
* stick with the numeric values.<p>
161+
* Possible values are:
162+
* <ul>
163+
* <li>Failure (corresponds to result code -1)</li>
164+
* <li>Success (corresponds to result code 200)</li>
165+
* <li>KeepAlive (corresponds to result code 210)</li>
166+
* <li>Command not permitted on a dead channel (corresponds to result code 511)</li>
167+
* <li>Usage (corresponds to result code 520)</li>
168+
* </ul>
169+
*
170+
* @return a string respresentation of the result.
171+
*/
172+
public String getResult()
173+
{
174+
return result;
175+
}
176+
177+
/**
178+
* Sets the string respresentation of the result.
179+
*
180+
* @param result a string respresentation of the result.
181+
*/
182+
public void setResult(String result)
183+
{
184+
this.result = result;
185+
}
144186

145187
/**
146188
* Checks is this a start sub event.

src/main/java/org/asteriskjava/manager/event/AsyncAgiEvent.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void setCommandId(String commandId)
122122
* 200%20result%3d0
123123
* </pre>
124124
*
125-
* @return the result.
125+
* @return the URL encoded result.
126126
*/
127127
public String getResult()
128128
{
@@ -155,7 +155,7 @@ public String decodeResult()
155155
/**
156156
* Sets the raw result.
157157
*
158-
* @param result the result.
158+
* @param result the URL encoded result.
159159
*/
160160
public void setResult(String result)
161161
{
@@ -178,7 +178,7 @@ public void setResult(String result)
178178
* ...
179179
* </pre>
180180
*
181-
* @return the AGI environment.
181+
* @return the URL encoded AGI environment.
182182
*/
183183
public String getEnv()
184184
{
@@ -227,7 +227,7 @@ public Map<String, String> decodeEnv()
227227
/**
228228
* Sets the AGI environment.
229229
*
230-
* @param env the AGI environment.
230+
* @param env the URL encoded AGI environment.
231231
*/
232232
public void setEnv(String env)
233233
{
@@ -268,5 +268,4 @@ protected boolean isSubEvent(String subEvent)
268268
{
269269
return this.subEvent != null && this.subEvent.equalsIgnoreCase(subEvent);
270270
}
271-
272271
}

src/main/java/org/asteriskjava/util/DaemonThreadFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.util.concurrent.atomic.AtomicInteger;
66

77
/**
8-
* A ThreadFactory that creates daemon threads for use with an {@link Executor}
8+
* A ThreadFactory that creates daemon threads for use with an {@link Executor}.
99
*
1010
* @author srt
1111
* @version $Id$

src/main/java/org/asteriskjava/util/LogFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static Log getLog(Class clazz)
7171
log4jLoggingAvailable = Boolean.FALSE;
7272
}
7373
}
74-
if (log4jLoggingAvailable.booleanValue())
74+
if (log4jLoggingAvailable)
7575
{
7676
return new Log4JLogger(clazz);
7777
}
@@ -89,7 +89,7 @@ public static Log getLog(Class clazz)
8989
javaLoggingAvailable = Boolean.FALSE;
9090
}
9191
}
92-
if (javaLoggingAvailable.booleanValue())
92+
if (javaLoggingAvailable)
9393
{
9494
return new JavaLoggingLog(clazz);
9595
}

src/main/java/org/asteriskjava/util/ReflectionUtil.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ public static Map<String, Method> getGetters(final Class clazz)
5050
final Map<String, Method> accessors = new HashMap<String, Method>();
5151
final Method[] methods = clazz.getMethods();
5252

53-
for (int i = 0; i < methods.length; i++)
53+
for (Method method : methods)
5454
{
5555
String name;
5656
String methodName;
57-
final Method method = methods[i];
5857

5958
methodName = method.getName();
6059
if (!methodName.startsWith("get"))
@@ -97,11 +96,10 @@ public static Map<String, Method> getSetters(Class clazz)
9796
final Map<String, Method> accessors = new HashMap<String, Method>();
9897
final Method[] methods = clazz.getMethods();
9998

100-
for (int i = 0; i < methods.length; i++)
99+
for (Method method : methods)
101100
{
102101
String name;
103102
String methodName;
104-
Method method = methods[i];
105103

106104
methodName = method.getName();
107105
if (!methodName.startsWith("set"))

src/main/java/org/asteriskjava/util/SocketConnectionFacade.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ public interface SocketConnectionFacade
3333
/**
3434
* Reads a line of text from the socket connection. The current thread is
3535
* blocked until either the next line is received or an IOException
36-
* encounters.
36+
* encounters.<p>
37+
* Depending on the implementation different newline delimiters are used
38+
* ("\r\n" for the Manager API and "\n" for AGI).
3739
*
38-
* @return the line of text received excluding any newline character
40+
* @return the line of text received excluding the newline delimiter.
3941
* @throws IOException if the connection has been closed.
4042
*/
4143
String readLine() throws IOException;
@@ -50,7 +52,7 @@ public interface SocketConnectionFacade
5052
void write(String s) throws IOException;
5153

5254
/**
53-
* Flushes the socket connection, that is sends any buffered but yet unsent
55+
* Flushes the socket connection by sending any buffered but yet unsent
5456
* data.
5557
*
5658
* @throws IOException if the connection cannot be flushed.

0 commit comments

Comments
 (0)