class AgiReplyImpl {
public int getStatus()
{
if (status != null)
{
return status;
}
if (firstLine == null)
{
return -1;
}
final Matcher matcher = STATUS_PATTERN.matcher(firstLine);
if (matcher.find())
{
status = Integer.parseInt(matcher.group(1));
return status;
}
return -1;
}
}
class AgiReplyImpl {
protected Map<String, String> getAttributes()
{
if (attributes != null)
{
return attributes;
}
attributes = new HashMap<String, String>();
final Matcher matcher = ADDITIONAL_ATTRIBUTES_PATTERN.matcher(firstLine);
if (matcher.find())
{
attributes.putAll(parseAttributes(matcher.group(2)));
}
return attributes;
}
}
class AgiReplyImpl {
public String getSynopsis()
{
if (getStatus() != SC_INVALID_COMMAND_SYNTAX)
{
return null;
}
if (synopsis == null && lines.size() > 1)
{
final String secondLine;
final Matcher synopsisMatcher;
secondLine = lines.get(1);
synopsisMatcher = SYNOPSIS_PATTERN.matcher(secondLine);
if (synopsisMatcher.find())
{
synopsis = synopsisMatcher.group(1);
}
}
return synopsis;
}
}
|