osnap.api.model
Interface ModuleInterface


public interface ModuleInterface

Interface to be used by all Modules. Contains basic methods that all Modules are required to have.


Method Summary
 void authenticateWithCore()
          Called when the module needs to authenticate with core.
 java.lang.String getName()
          Called when the module api sends a heartbeat ping to the core.
 void messageFromCore(MessageInterface message)
          Called when the module receives a message from Core
 void sendMessageToNetwork(SocialNetworkMessage message)
          Send a message to the Social Network
 void setCoreSocket(java.net.Socket socket)
          Set the socket used to connect and maintain a connection to Core
 void setMessageReceiver(MessageReceiver messageReceiver)
          Sets a new MessageReceiver
 void updateStatus(java.lang.String status)
          Updates the status on the Social Network
 

Method Detail

sendMessageToNetwork

void sendMessageToNetwork(SocialNetworkMessage message)
Send a message to the Social Network

Parameters:
message - SocialNetworkMessage

updateStatus

void updateStatus(java.lang.String status)
Updates the status on the Social Network

Parameters:
status -

messageFromCore

void messageFromCore(MessageInterface message)
Called when the module receives a message from Core

Parameters:
message - MessageInterface

setMessageReceiver

void setMessageReceiver(MessageReceiver messageReceiver)
Sets a new MessageReceiver

Parameters:
messageReceiver - MessageReceiver

setCoreSocket

void setCoreSocket(java.net.Socket socket)
Set the socket used to connect and maintain a connection to Core

Parameters:
socket - Socket used to connect and maintain a connection to Core

authenticateWithCore

void authenticateWithCore()
Called when the module needs to authenticate with core.


getName

java.lang.String getName()
Called when the module api sends a heartbeat ping to the core.

Returns:
The OSNAP username of the module.