com.smaxe.uv.client
Interface ISharedObject

All Known Implementing Classes:
SharedObject

public interface ISharedObject

ISharedObject - shared object (replica of ActionScript's SharedObject class interface).

Version:
1.5.12
Author:
Andrei Sochirca
See Also:
JUV RTMP Client

Nested Class Summary
static class ISharedObject.Change
          Change - change event item.
static interface ISharedObject.IListener
          IListener - SharedObject listener.
static class ISharedObject.ListenerAdapter
          ListenerAdapter - ISharedObject.IListener adapter.
 
Field Summary
static ObjectEncoding defaultObjectEncoding
          Default object encoding.
 
Method Summary
 void addEventListener(ISharedObject.IListener listener)
          Registers an event listener.
 void clear()
          For local shared objects, purges all of the data and deletes the shared object from the disk.
 java.lang.Object client()
          Returns the object on which callback methods should be invoked.
 void client(java.lang.Object client)
          Sets the object on which callback methods should be invoked.
 void close()
          Closes the connection between a remote shared object and the server.
 void connect(INetConnection connection, java.lang.String params)
          Connects to a remote shared object on the server through the specified connection.
 java.util.Map<java.lang.String,java.lang.Object> data()
          Returns shared object data.
 void flush(int minDiskSpace)
          Immediately writes a locally persistent shared object to a local file.
 int fps()
          Returns fps.
 void fps(int fps)
          Specifies the number of times per second that a client's changes to a shared object are sent to the server.
 java.lang.String getName()
          Returns shared object name.
 boolean isPersistent()
          Checks if shared object is persistent.
 ObjectEncoding objectEncoding()
          Returns object encoding.
 void objectEncoding(ObjectEncoding encoding)
          The object encoding (AMF version).
 void removeEventListener(ISharedObject.IListener listener)
          Removes the listener.
 void send(java.lang.String action, java.lang.Object... args)
          Broadcasts a message to all clients connected to the specified remote shared object, including the client that sent the message.
 void setDirty(java.lang.String propertyName)
          Indicates to the server that the value of a property in the shared object has changed.
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Updates the value of a property in a shared object and indicates to the server that the value of the property has changed.
 int size()
          Returns current size of the shared object, in bytes.
 

Field Detail

defaultObjectEncoding

static final ObjectEncoding defaultObjectEncoding
Default object encoding.

Method Detail

getName

java.lang.String getName()
Returns shared object name.

Returns:
shared object name

isPersistent

boolean isPersistent()
Checks if shared object is persistent.

Returns:
true if shared object is persistent; otherwise false

client

void client(java.lang.Object client)
Sets the object on which callback methods should be invoked.

Parameters:
client - the object on which callback methods should be invoked

client

java.lang.Object client()
Returns the object on which callback methods should be invoked.

Returns:
the object on which callback methods should be invoked

data

java.util.Map<java.lang.String,java.lang.Object> data()
Returns shared object data.

Returns:
collection of attributes assigned to the data property of the object

fps

void fps(int fps)
Specifies the number of times per second that a client's changes to a shared object are sent to the server.

Parameters:
fps - number of updates per second

fps

int fps()
Returns fps.

Returns:
fps

objectEncoding

ObjectEncoding objectEncoding()
Returns object encoding.

Returns:
object encoding

objectEncoding

void objectEncoding(ObjectEncoding encoding)
The object encoding (AMF version).

Parameters:
encoding - encoding to set

size

int size()
Returns current size of the shared object, in bytes.

Returns:
current size of the shared object, in bytes

clear

void clear()
For local shared objects, purges all of the data and deletes the shared object from the disk.


close

void close()
Closes the connection between a remote shared object and the server.


connect

void connect(INetConnection connection,
             java.lang.String params)
Connects to a remote shared object on the server through the specified connection.

Parameters:
connection - connection
params - connection parameters

flush

void flush(int minDiskSpace)
Immediately writes a locally persistent shared object to a local file.

Parameters:
minDiskSpace -

send

void send(java.lang.String action,
          java.lang.Object... args)
Broadcasts a message to all clients connected to the specified remote shared object, including the client that sent the message.

Parameters:
action - action
args - arguments (0 or more)

setDirty

void setDirty(java.lang.String propertyName)
Indicates to the server that the value of a property in the shared object has changed.

Parameters:
propertyName - property name

setProperty

void setProperty(java.lang.String propertyName,
                 java.lang.Object value)
Updates the value of a property in a shared object and indicates to the server that the value of the property has changed.

Parameters:
propertyName - property name
value - value

addEventListener

void addEventListener(ISharedObject.IListener listener)
Registers an event listener.

Parameters:
listener - listener to add

removeEventListener

void removeEventListener(ISharedObject.IListener listener)
Removes the listener.

Parameters:
listener - listener to remove