|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.discotools.io.AbstractProtocol<T>
org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
org.discotools.io.aprs.is.AprsIsProtocol
public final class AprsIsProtocol
This class implements the client side of the APRS-IS protocol.
Field Summary | |
---|---|
static String |
A_CLOSE
AbstractConnection.close() action: The connection has been closed, which forces
the protocol to S_IDLE state. |
static String |
A_FILTER
APRS-IS packet filter parameter name. |
static String |
A_IDENTIFY
APRS-IS identify request action name. |
static String |
A_OPEN
SocketConnection#open(org.discotools.io.IProtocol) action:
The connection has been open, which forces
the protocol to S_OPEN state. |
static String |
A_RESPONSE
APRS-IS response action: All APRS-IS server responses starts with the character '#'. |
static String |
A_UNVERIFIED
APRS-IS user unverified action: All APRS-IS server unverified login responses should match the regexp '^#. |
static String |
A_VERIFIED
APRS-IS user verified action: All APRS-IS server verified login responses should match the regexp '^#. |
static String |
A_VERSION
APRS-IS software version parameter name. |
static String |
C_FILTER
APRS-IS filter command: 'filter <filter>' |
static String |
C_IDENTIFY
APRS-IS identify command: 'user <username> pass <passcode> [<command>]' |
static String |
C_VERSION
APRS-IS software version command: 'vers <name> <version>' |
static String |
L_IDENTIFY
APRS-IS identify request action label. |
static String |
L_RESPONSE
A_RESPONSE action label. |
static Pattern |
P_FILTER
Regexp Pattern for parsing C_FILTER command. |
static Pattern |
P_IDENTIFY
Regexp Pattern for matching A_IDENTIFY action. |
static Pattern |
P_RESPONSE
Regexp Pattern for matching A_RESPONSE actions. |
static Pattern |
P_UNVERIFIED
Regexp Pattern for matching A_UNVERIFIED actions. |
static Pattern |
P_VERIFIED
Regexp Pattern for matching A_VERIFIED actions. |
static Pattern |
P_VERSION
Regexp Pattern for parsing C_VERSION command. |
static String |
S_IDLE
APRS-IS idle state: SocketConnection is closed. |
static String |
S_OPEN
APRS-IS idle state: SocketConnection is open. |
static String |
S_UNVERIFIED
APRS-IS unverified state: User has identified itself with a passcode not verified by the APRS-IS server (typical: -1). |
static String |
S_VERIFIED
APRS-IS verified state: User has identified itself with a passcode verified by the APRS-IS server (typical: -1). |
static String |
S_WAITING
APRS-IS waiting state: User has issued a command and is waiting for APRS-IS server response. |
Fields inherited from class org.discotools.io.fsm.FsmProtocol |
---|
common, parser, S_COMMON |
Fields inherited from class org.discotools.io.AbstractProtocol |
---|
DEFAULT_SIZE, head, isOpen, rb, size, tail, tb |
Constructor Summary | |
---|---|
AprsIsProtocol()
Default constructor |
|
AprsIsProtocol(AprsCache cache)
Cache constructor |
Method Summary | |
---|---|
void |
addListener(AprsCacheListener listener)
|
boolean |
addListener(org.discotools.fsm.event.FsmListener listener)
Add FsmListener to APRS-IS Finite State Machine instance
|
protected org.discotools.fsm.Fsm |
createFsm(org.discotools.io.fsm.FsmProtocolState idle)
Create APRS-IS FSM instance. |
protected org.discotools.io.fsm.FsmProtocolState |
createState(String name,
boolean isParseable)
|
AprsCache |
getCache()
|
AprsIsParams |
getParams()
Get copy of current AprsIsParams instance. |
protected boolean |
handle(org.discotools.io.Connection<AprsPacket> connection,
String tokens,
boolean inbound,
Object... params)
|
protected void |
internalClose(org.discotools.io.Connection<AprsPacket> connection)
|
protected boolean |
internalOpen(org.discotools.io.Connection<AprsPacket> connection,
Map<String,? extends Object> options)
|
void |
removeListener(AprsCacheListener listener)
|
boolean |
removeListener(org.discotools.fsm.event.FsmListener listener)
Remove FsmListener from APRS-IS Finite State Machine instance
|
AprsIsParams |
setParams(AprsIsParams params)
Replace current AprsIsParams instance. |
Methods inherited from class org.discotools.io.fsm.FsmProtocol |
---|
getCurrentState, getFsm, getParser, internalParse, merge, setFsm, toState |
Methods inherited from class org.discotools.io.AbstractProtocol |
---|
addListener, assertClose, assertOpen, close, fireOnReceive, fireOnTransmit, getListeners, internalReceive, internalTransmit, isHead, isOpen, isTail, open, open, receive, receive, receive, receive, receive, removeListener, toBytes, toBytes, toString, transmit, transmit, transmit, transmit, transmit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String S_IDLE
SocketConnection
is closed.
public static final String A_CLOSE
AbstractConnection.close()
action: The connection has been closed, which forces
the protocol to S_IDLE
state.
public static final String S_OPEN
SocketConnection
is open.
public static final String A_OPEN
SocketConnection#open(org.discotools.io.IProtocol)
action:
The connection has been open, which forces
the protocol to S_OPEN
state.
public static final String S_WAITING
public static final String S_UNVERIFIED
In this state, the APRS-IS server does not allow the protocol to transmit anything to the APRS-IS network. Only verified users are allowed to transmit data.
public static final String S_VERIFIED
In this state, the APRS-IS server allow the protocol to transmit data to the APRS-IS network.
If the protocol is part of an IGate implementation, the IGate is only able to pass packets from RF to APRS-IS in in verified state.
public static final String A_IDENTIFY
public static final String L_IDENTIFY
public static final String C_IDENTIFY
'user <username> pass <passcode> [<command>]'
public static final Pattern P_IDENTIFY
Pattern
for matching A_IDENTIFY
action.
public static final String A_VERSION
public static final String C_VERSION
'vers <name> <version>'
public static final Pattern P_VERSION
Pattern
for parsing C_VERSION
command.
public static final String A_FILTER
public static final String C_FILTER
'filter <filter>'
public static final Pattern P_FILTER
Pattern
for parsing C_FILTER
command.
public static final String A_RESPONSE
public static final Pattern P_RESPONSE
Pattern
for matching A_RESPONSE
actions.
public static final String L_RESPONSE
A_RESPONSE
action label.
public static final String A_VERIFIED
public static final Pattern P_VERIFIED
Pattern
for matching A_VERIFIED
actions.
public static final String A_UNVERIFIED
public static final Pattern P_UNVERIFIED
Pattern
for matching A_UNVERIFIED
actions.
Constructor Detail |
---|
public AprsIsProtocol()
public AprsIsProtocol(AprsCache cache)
Method Detail |
---|
public AprsCache getCache()
public void addListener(AprsCacheListener listener)
public void removeListener(AprsCacheListener listener)
public AprsIsParams getParams()
AprsIsParams
instance.
NOTE: Change parameters on this instance and apply them
to the protocol using setParams(AprsIsParams)
.
public AprsIsParams setParams(AprsIsParams params)
AprsIsParams
instance.
AprsIsParams
.public boolean addListener(org.discotools.fsm.event.FsmListener listener)
FsmListener
to APRS-IS Finite State Machine
instance
addListener
in class org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
listener
-
true
if added.public boolean removeListener(org.discotools.fsm.event.FsmListener listener)
FsmListener
from APRS-IS Finite State Machine
instance
removeListener
in class org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
listener
-
true
if added.protected boolean handle(org.discotools.io.Connection<AprsPacket> connection, String tokens, boolean inbound, Object... params) throws org.discotools.fsm.FsmException
handle
in class org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
org.discotools.fsm.FsmException
protected org.discotools.io.fsm.FsmProtocolState createState(String name, boolean isParseable)
createState
in class org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
protected org.discotools.fsm.Fsm createFsm(org.discotools.io.fsm.FsmProtocolState idle)
FSM
instance.
NOTE: Following parseable states share receive and transmit buffers.
which enables this protocol to parse payload intoAprsPacket
regardless of protocol state,
except in S_IDLE
.
createFsm
in class org.discotools.io.fsm.FsmProtocol<AprsPacket,AprsIsParser>
protected boolean internalOpen(org.discotools.io.Connection<AprsPacket> connection, Map<String,? extends Object> options) throws IOException
internalOpen
in class org.discotools.io.AbstractProtocol<AprsPacket>
IOException
protected void internalClose(org.discotools.io.Connection<AprsPacket> connection) throws IOException
internalClose
in class org.discotools.io.AbstractProtocol<AprsPacket>
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |