Reference of IPublicGWPlugin
Description of IPublicGWPlugin. IPublicGWPlugin is in Plugin V4 and above.
In plug-in, developers can use internal API of publicgw server.
IPTTPlugin4
IVideoPlugin3
IAdminWebPlugin2
ICallback
In plug-in, a developer can use internal API of Public-GW server.
getDBConnection
| Connection getDBConnection() |
| Return | java.sql.Connection |
| Description | Get DB connection from DB connection pool in server. |
| Common library version | 4.0.x |
login
| int login(PTTUser user) |
| user | current seesion's user information. id is mandatory. |
| Description | login by user |
| Common library version | 4.0.x |
logout
| int logout(PTTUser user) |
| user | current seesion's user information. id is mandatory. |
| Description | logout by user |
| Common library version | 4.0.x |
join
| int join(PTTUser user, PTTChannel channel) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| Description | join to a channel |
| Common library version | 4.0.x |
leave
| int leave(PTTUser user, PTTChannel channel) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| Description | leave from a channel |
| Common library version | 4.0.x |
lock
int lock(PTTUser user, PTTChannel channel)
int lock(PTTUser user, PTTChannel channel, float latitude, float longitude) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| Description | lock a channel(index is 0) |
| Common library version | 4.0.x |
unlock
| int unlock(PTTUser user, PTTChannel channel) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| Description | unlock a channel(index is 0) |
| Common library version | 4.0.x |
sendAudioPTT
| int sendAudioPTT(PTTUser user, PTTChannel channel, byte[] waveFrame, int offset, int length320) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| waveFrame | data buffer |
| offset | offset |
| length320 | data length. it must be 320. |
| Description | send an audio frame to a channel(index is 0) |
| Common library version | 4.0.x |
sendMesssage
| int sendMesssage(PTTUser user, PTTChannel channel, String message) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| message | utf8 message |
| Description | send a text message to a channel |
| Common library version | 4.0.x |
sendCustomMesssage
| int sendCustomMesssage(PTTUser user, PTTChannel channel, int messageId, String base64message) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| messageId | message's id. a developer can define it. |
| base64message | base64 encoded message |
| Description | send a custom message(like an image) to a channel |
| Common library version | 4.0.x |
sendSOS
| int sendSOS(PTTUser user, PTTChannel channel, float latitude, float longitude) |
| user | current seesion's user information. id is mandatory. |
| channel | current channel's information. id is mandatory. |
| latitude | user's location |
| longitude | user's location |
| Description | send a SOS event to a channelg |
| Common library version | 4.0.x |
updateLocation
| int updateLocation(PTTUser user, float latitude, float longitude) |
| user | current seesion's user information. id is mandatory. |
| latitude | user's location |
| longitude | user's location |
| Description | update an user's location |
| Common library version | 4.0.x |
writeLog
| void writeLog(String message) |
| message | log message |
| Description | Write log in {ProPTT server dir}/logs/service/Public.service.log |
| Common library version | 4.0.x |
writeErrorLog
| void writeErrorLog(String message) |
| message | log message |
| Description | Write error log in {ProPTT server dir}/logs/service/Public.service.log |
| Common library version | 4.0.x |
OnInitialized
| void OnInitialized() |
| Description | Notify initialized to Public-GW server. |
| Common library version | 4.0.x |
IPublicGWPlugin
getInterfaceVersion
| int getInterfaceVersion() |
| Return | most be retured INTERFACE_VERSION |
| Description | Notify plug-in's INTERFACE version |
| Common library version | 4.0.x |
getType
| int getType() |
| Return | most be retured TYPE_GENERAL_PLUGIN |
| Description | Notify plug-in's type |
| Common library version | 4.0.x |
initialize
| boolean initialize(String arg) |
| Return | result of initialize |
| Description | initialize plug-in |
| Common library version | 4.0.x |
OnLogin
| void OnLogin(PTTUser user) |
| user | current seesion's user information |
| Description | An user loged in |
| Common library version | 4.0.x |
OnLogout
| void OnLogout(PTTUser user, boolean byDuplication) |
| user | current seesion's user information |
| byDuplication | It is true. the user loged in on another device. |
| Description | An user loged out |
| Common library version | 4.0.x |
OnJoined
| void OnJoined(PTTUser user, PTTChannel channel, PTTUser joinedUser) |
| user | current seesion's user information |
| channel | current channel's information |
| joinedUser | joined user |
| Description | An user is joined. |
| Common library version | 4.0.x |
OnLeaved
| void OnLeaved(PTTUser user, PTTChannel channel, PTTUser leavedUser) |
| user | current seesion's user information |
| channel | current channel's information |
| leavedUser | leaved user |
| Description | An user is leaved. |
| Common library version | 4.0.x |
OnLocked
| void OnLocked(PTTUser user, PTTChannel channel, PTTUser lockUser, int lockIndex, int mediaProfileId, String userLocation, String audioCodec, String videoCodec, String jsonParams) |
| user | current seesion's user information |
| channel | current channel's information |
| lockUser | locker |
| lockIndex | 0: normal PTT channel. 1:master's channel |
| mediaProfileId | media information ID |
| userLocation | locker's location |
| audioCodec | audio's codec parameter. not used |
| videoCodec | video's codec parameter. not used |
| jsonParams | extended parameters |
| Description | A channel is locked |
| Common library version | 4.0.x |
OnUnlocked
| void OnUnlocked(PTTUser user, PTTChannel channel, PTTUser unlockUser, int lockIndex) |
| user | current seesion's user information |
| channel | current channel's information |
| unlockUser | locker |
| lockIndex | 0: normal PTT channel. 1:master's channel |
| Description | A channel is unlocked |
| Common library version | 4.0.x |
OnAudioPTTReceived
| void OnAudioPTTReceived(PTTUser user, PTTChannel channel, int lockIndex, int timestamp, byte[] waveFrame, int offset, int length) |
| user | current seesion's user information |
| channel | current channel's information |
| lockIndex | 0: normal PTT channel. 1:master's channel |
| timestamp | frame time |
| waveFrame | wave data |
| offset | offset |
| length | data length |
| Description | An audio frame is received |
| Common library version | 4.0.x |
OnVideoPTTReceived
| void OnVideoPTTReceived(PTTUser user, PTTChannel channel, int lockIndex, int timestamp, byte[] jpegFrame, int offset, int length) |
| user | current seesion's user information |
| channel | current channel's information |
| lockIndex | 0: normal PTT channel. 1:master's channel |
| timestamp | frame time |
| jpegFrame | jpeg data |
| offset | offset |
| length | data length |
| Description | A video frame is received |
| Common library version | 4.0.x |
OnMessageReceived
| void OnMessageReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, String message) |
| user | current seesion's user information |
| channel | current channel's information |
| sentUser | sent user |
| message | utf8 message |
| Description | A text message is received. |
| Common library version | 4.0.x |
OnCustomMessageReceived
| void OnCustomMessageReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, int messageId, String base64Message) |
| user | current seesion's user information |
| channel | current channel's information |
| sentUser | sent user |
| messageId | message's Id |
| base64Message | base64 encoded message |
| Description | A custom message is received. |
| Common library version | 4.0.x |
OnSOSReceived
| void OnSOSReceived(PTTUser user, PTTChannel channel, PTTUser sentUser, String userLocation) |
| user | current seesion's user information |
| channel | current channel's information |
| sentUser | sent user |
| userLocation | user's location |
| Description | A SOS event is fired. |
| Common library version | 4.0.x |
OnVideoShared
| void OnVideoShared(PTTUser user, PTTChannel channel, PTTUser sharedUser, int videoChannelId, String serverIP, int serverPort, boolean useSSL, String token, String jsonParams) |
| user | current seesion's user information |
| channel | current channel's information |
| sharedUser | shared user |
| videoChannelId | video channel's id |
| serverIP | video server's IP |
| serverPort | video server's port |
| useSSL | whether SSL is used |
| token | video server's session token |
| jsonParams | extended parameters |
| Description | A video stream is shared in a channel. |
| Common library version | 4.0.x |
OnVideoUnshared
| void OnVideoUnshared(PTTUser user, PTTChannel channel, PTTUser unsharedUser, int videoChannelId) |
| user | current seesion's user information |
| channel | current channel's information |
| unsharedUser | shared user |
| videoChannelId | video channel's id |
| Description | A video stream is unshared in a channel. |
| Common library version | 4.0.x |
OnFileShared
| void OnFileShared(PTTUser user, PTTChannel channel, PTTUser sharedUser, int fileChannelId, String serverIP, int serverPort, boolean useSSL, String token, String jsonParams) |
| user | current seesion's user information |
| channel | current channel's information |
| sharedUser | shared user |
| fileChannelId | file channel's id |
| serverIP | video server's IP |
| serverPort | video server's port |
| useSSL | whether SSL is used |
| token | video server's session token |
| jsonParams | extended parameters |
| Description | A file is shared in a channel. |
| Common library version | 4.0.x |
OnFileUnshared
| void OnFileUnshared(PTTUser user, PTTChannel channel, PTTUser unsharedUser, int fileChannelId) |
| user | current seesion's user information |
| channel | current channel's information |
| unsharedUser | shared user |
| fileChannelId | A file is unshared in a channel. |
| Description | fired error |
| Common library version | 4.0.x |
OnError
| void OnError(int errCode, String jsonParams) |
| errCode | error code. not defined |
| jsonParams | extended parameters |
| Description | fired error |
| Common library version | 4.0.x |
OnExtenedEvent
| void OnExtenedEvent(String cmdName, String jsonParams) |
| cmdName | commend name. not defined |
| jsonParams | extended parameters |
| Description | Fired an extended event |
| Common library version | 4.0.x |