fi.hut.tml.xsmiles.mlfc.comm
Interface COMMInterface

All Known Implementing Classes:
JXTACOMMImpl

public interface COMMInterface

A MLFC for establishing a communication channel for intercommunication of XML languages.

Author:
juha

Field Summary
static int JOIN_ERROR
           
static int JOIN_GROUPCREATED
           
static int JOIN_GROUPJOINED
           
 
Method Summary
 void addDataListener(DataListener dl)
          Receive data
 void destroy()
          Do cleanup
 boolean getFile(java.net.URL location, java.lang.String name)
           
 java.lang.String getLocalPeerName()
          Get local Peer name.
 java.lang.String getPeerGroupName()
          Get PeerGroup name.
 int join(java.lang.String name, java.lang.String params)
           
 void leave(java.lang.String name)
           
 boolean send(java.lang.String target, java.lang.String data)
          Send data to target
 boolean sendFile(java.lang.String target, java.net.URL data)
           
 boolean sendMime(java.lang.String target, byte[] data, java.lang.String mimetype)
          Send data to target
 

Field Detail

JOIN_ERROR

public static final int JOIN_ERROR
See Also:
Constant Field Values

JOIN_GROUPJOINED

public static final int JOIN_GROUPJOINED
See Also:
Constant Field Values

JOIN_GROUPCREATED

public static final int JOIN_GROUPCREATED
See Also:
Constant Field Values
Method Detail

send

public boolean send(java.lang.String target,
                    java.lang.String data)
Send data to target

Returns:
True if successful false if not

sendMime

public boolean sendMime(java.lang.String target,
                        byte[] data,
                        java.lang.String mimetype)
Send data to target

Returns:
True if successful false if not

addDataListener

public void addDataListener(DataListener dl)
Receive data


sendFile

public boolean sendFile(java.lang.String target,
                        java.net.URL data)
Parameters:
target - Send a file to a target
data - The URL where file is located  @return true if successful

getFile

public boolean getFile(java.net.URL location,
                       java.lang.String name)
Parameters:
location - Where to save the file
name - The filename to get  @return true if successful

join

public int join(java.lang.String name,
                java.lang.String params)
Parameters:
params - The parameters that might be needed
name - The group to join  @return JOIN_ERROR, JOIN_GROUPCREATED or JOIN_GROUPJOINED

leave

public void leave(java.lang.String name)
Parameters:
name - Leave a group

destroy

public void destroy()
Do cleanup


getLocalPeerName

public java.lang.String getLocalPeerName()
Get local Peer name.

Returns:
Local peer name

getPeerGroupName

public java.lang.String getPeerGroupName()
Get PeerGroup name.

Returns:
Local peer name


X-Smiles 1.2