public abstract class SomCommand extends java.lang.Object implements SomResponseProcessor
Modifier and Type | Field and Description |
---|---|
protected SomCommandListener |
opListener |
protected SomSession |
opSession |
Constructor and Description |
---|
SomCommand(SomSession sess)
Create a new SomCommand object.
|
SomCommand(SomSession sess,
SomHandler handler)
Create a new SomCommand object.
|
SomCommand(SomSession sess,
SomHandler handler,
SomCommandListener listener)
Create a new SomCommand object.
|
Modifier and Type | Method and Description |
---|---|
void |
dispatch()
Send off a command once constructed.
|
protected java.lang.String |
getCommandString() |
protected SomSession |
getSession()
Obtain the SomSession object with which a command is associated.
|
void |
notifyListener(int status)
Tell the command listener about an event.
|
void |
notifyListener(int status,
java.lang.String detail)
Tell the command listener about an event which includes a detail string
|
void |
notifyListener(int status,
java.lang.String[] pairs)
Tell the listener about an event which includes an array of data pairs
|
void |
processResponse(java.lang.String commandData,
byte[] data,
int status)
Process response to command.
|
protected SomSession opSession
protected SomCommandListener opListener
public SomCommand(SomSession sess)
sess
- SomSession to use for commandpublic SomCommand(SomSession sess, SomHandler handler)
sess
- SomSession to use for command which must not be nullhandler
- SomHandler which will be used during session establishment which must not be nullpublic SomCommand(SomSession sess, SomHandler handler, SomCommandListener listener)
sess
- SomSession to use for commandhandler
- SomHandler which be will used during session establishment which must not be nulllistener
- SomCommandListener which will handle results and error info which may be nullpublic void dispatch() throws SomException
SomException
- Indicating a problem with the commandprotected SomSession getSession()
public void processResponse(java.lang.String commandData, byte[] data, int status)
processResponse
in interface SomResponseProcessor
protected java.lang.String getCommandString() throws SomException
SomException
- Indicating a problem with the commandpublic void notifyListener(int status)
status
- the status codepublic void notifyListener(int status, java.lang.String detail)
status
- the status codedetail
- which must not be nullpublic void notifyListener(int status, java.lang.String[] pairs)
status
- the status codepairs
- which must not be nullVersion: 18.0v6-0
Copyright (c) 2017-2020 Isode