apps.remotecontrol.networkmanager.managers
Class NetworkedContentManager

java.lang.Object
  extended by apps.remotecontrol.networkmanager.managers.NetworkedContentManager

public class NetworkedContentManager
extends java.lang.Object

The Class NetworkedContentManager.


Nested Class Summary
static interface NetworkedContentManager.NetworkListener
          The listener interface for receiving network events.
 
Field Summary
static short ITEM_ADDED
          The item added.
static short ITEM_DELETED
          The item deleted.
 java.util.Map<java.lang.String,ContentItem> onlineItemsList
          The online items list.
 
Constructor Summary
NetworkedContentManager(ContentSystem contentSystem, TableCommsClientService comms, java.util.List<java.lang.Class<?>> receiverClasses)
          Instantiates a new networked content manager.
 
Method Summary
 void addNetworkListener(NetworkedContentManager.NetworkListener l)
          Adds the network listener.
 void allowedToSendmessage(boolean allowedToSendMessage)
          Allowed to sendmessage.
 void connectTable(TableIdentity remoteTableId)
          Connect table.
 void disconnectTable(TableIdentity remoteTableId)
          Disconnect table.
 void fireMessageReceived(java.lang.Object obj)
          Fire message received.
 ContentSystem getContentSystem()
          Gets the content system.
 java.util.Map<java.lang.String,ContentItem> getOnlineItems()
          Gets the online items.
 java.util.List<TableIdentity> getOnlineTables()
          Gets the online tables.
 java.util.List<TableIdentity> getProjectors()
          Gets the projectors.
 java.util.List<java.lang.Class<?>> getReceiverClasses()
          Gets the receiver classes.
 SyncManager getSyncManager()
          Gets the sync manager.
 void handleConnectionRequest(TableIdentity targetTable, boolean isConnect)
          Handle connection request.
 boolean isAllowedToSendMessage()
          Checks if is allowed to send message.
 void postAliveMessage(TableIdentity tableIdentity)
          Post alive message.
 void postItemsToTable(java.util.HashMap<java.lang.String,Location> itemNames, TableIdentity tableId, TableIdentity targetTableId, boolean deleteItems)
          Post items to table.
 void processReceivedItems(PostItemsPortalMessage msg)
          Process received items.
 void processTableMode(boolean locked)
          Process table mode.
 void registerContentItems(java.util.HashMap<ContentItem,Location> contentItems)
          Register content items.
 void registerContentItems(java.util.List<ContentItem> contentItems)
          Register content items.
 void registerProjector(TableIdentity tableId)
          Register projector.
 void removeNetworkListener(NetworkedContentManager.NetworkListener l)
          Removes the network listener.
 void removeNetworkListeners()
          Removes the network listeners.
 void sendMessage(java.lang.Object obj)
          Send message.
 void setRemoteTableMode(TableIdentity tableId, TablePortal.RemoteTableMode mode)
          Sets the remote table mode.
 void syncContent(java.util.Map<java.lang.String,java.util.Map<java.lang.Short,java.lang.Object>> itemSyncDataMap)
          Sync content.
 void transferContentItem(ContentItem item, TableIdentity sourceTableId, TableIdentity targetTableId, Location newLoc)
          Transfer content item.
 void unregisterContentItems(java.util.List<ContentItem> contentItems)
          Unregister content items.
 void update(float tpf)
          Update.
 void updateSyncData()
          Update sync data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEM_ADDED

public static short ITEM_ADDED
The item added.


ITEM_DELETED

public static short ITEM_DELETED
The item deleted.


onlineItemsList

public java.util.Map<java.lang.String,ContentItem> onlineItemsList
The online items list.

Constructor Detail

NetworkedContentManager

public NetworkedContentManager(ContentSystem contentSystem,
                               TableCommsClientService comms,
                               java.util.List<java.lang.Class<?>> receiverClasses)
Instantiates a new networked content manager.

Parameters:
contentSystem - the content system
comms - the comms
receiverClasses - the receiver classes
Method Detail

addNetworkListener

public void addNetworkListener(NetworkedContentManager.NetworkListener l)
Adds the network listener.

Parameters:
l - the l

allowedToSendmessage

public void allowedToSendmessage(boolean allowedToSendMessage)
Allowed to sendmessage.

Parameters:
allowedToSendMessage - the allowed to send message

connectTable

public void connectTable(TableIdentity remoteTableId)
Connect table.

Parameters:
remoteTableId - the remote table id

disconnectTable

public void disconnectTable(TableIdentity remoteTableId)
Disconnect table.

Parameters:
remoteTableId - the remote table id

fireMessageReceived

public void fireMessageReceived(java.lang.Object obj)
Fire message received.

Parameters:
obj - the obj

getContentSystem

public ContentSystem getContentSystem()
Gets the content system.

Returns:
the content system

getOnlineItems

public java.util.Map<java.lang.String,ContentItem> getOnlineItems()
Gets the online items.

Returns:
the online items

getOnlineTables

public java.util.List<TableIdentity> getOnlineTables()
Gets the online tables.

Returns:
the online tables

getProjectors

public java.util.List<TableIdentity> getProjectors()
Gets the projectors.

Returns:
the projectors

getReceiverClasses

public java.util.List<java.lang.Class<?>> getReceiverClasses()
Gets the receiver classes.

Returns:
the receiver classes

getSyncManager

public SyncManager getSyncManager()
Gets the sync manager.

Returns:
the sync manager

handleConnectionRequest

public void handleConnectionRequest(TableIdentity targetTable,
                                    boolean isConnect)
Handle connection request.

Parameters:
targetTable - the target table
isConnect - the is connect

isAllowedToSendMessage

public boolean isAllowedToSendMessage()
Checks if is allowed to send message.

Returns:
true, if is allowed to send message

postAliveMessage

public void postAliveMessage(TableIdentity tableIdentity)
Post alive message.

Parameters:
tableIdentity - the table identity

postItemsToTable

public void postItemsToTable(java.util.HashMap<java.lang.String,Location> itemNames,
                             TableIdentity tableId,
                             TableIdentity targetTableId,
                             boolean deleteItems)
Post items to table.

Parameters:
itemNames - the item names
tableId - the table id
targetTableId - the target table id
deleteItems - the delete items

processReceivedItems

public void processReceivedItems(PostItemsPortalMessage msg)
Process received items.

Parameters:
msg - the msg

processTableMode

public void processTableMode(boolean locked)
Process table mode.

Parameters:
locked - the locked

registerContentItems

public void registerContentItems(java.util.HashMap<ContentItem,Location> contentItems)
Register content items.

Parameters:
contentItems - the content items

registerContentItems

public void registerContentItems(java.util.List<ContentItem> contentItems)
Register content items.

Parameters:
contentItems - the content items

registerProjector

public void registerProjector(TableIdentity tableId)
Register projector.

Parameters:
tableId - the table id

removeNetworkListener

public void removeNetworkListener(NetworkedContentManager.NetworkListener l)
Removes the network listener.

Parameters:
l - the l

removeNetworkListeners

public void removeNetworkListeners()
Removes the network listeners.


sendMessage

public void sendMessage(java.lang.Object obj)
Send message.

Parameters:
obj - the obj

setRemoteTableMode

public void setRemoteTableMode(TableIdentity tableId,
                               TablePortal.RemoteTableMode mode)
Sets the remote table mode.

Parameters:
tableId - the table id
mode - the mode

syncContent

public void syncContent(java.util.Map<java.lang.String,java.util.Map<java.lang.Short,java.lang.Object>> itemSyncDataMap)
Sync content.

Parameters:
itemSyncDataMap - the item sync data map

transferContentItem

public void transferContentItem(ContentItem item,
                                TableIdentity sourceTableId,
                                TableIdentity targetTableId,
                                Location newLoc)
Transfer content item.

Parameters:
item - the item
sourceTableId - the source table id
targetTableId - the target table id
newLoc - the new loc

unregisterContentItems

public void unregisterContentItems(java.util.List<ContentItem> contentItems)
Unregister content items.

Parameters:
contentItems - the content items

update

public void update(float tpf)
Update.

Parameters:
tpf - the tpf

updateSyncData

public void updateSyncData()
Update sync data.