net.bioclipse.xws.client.adhoc
Interface IFunction

All Superinterfaces:
IXmppItem

public interface IFunction
extends IXmppItem


Method Summary
 void getIoSchemataAsync(IIoSchemataListener listener)
          Retrieves the input/output XML Schemata of the function.
 IoSchemata getIoSchemataSync(long millis)
          Retrieves the input/output XML Schemata of the function.
 java.lang.String getName()
          Returns the function name.
 IService getService()
          Returns the XMPP Service that hosts the function.
 IProcess invokeAsync(org.w3c.dom.Element input, IProcessListener listener)
          Invokes the function.
 IProcess invokeAsync(org.w3c.dom.Element input, ISimpleProcessListener simple_listener)
          Invokes the function.
 IProcess invokeAsync(java.lang.String input_element, IProcessListener listener)
          Invokes the function.
 IProcess invokeAsync(java.lang.String input_element, ISimpleProcessListener simple_listener)
          Invokes the function.
 org.w3c.dom.Element invokeSync(org.w3c.dom.Element input, long millis)
          Invokes the function.
 org.w3c.dom.Element invokeSync(java.lang.String input_element, long millis)
          Invokes the function.
 boolean isCompatibleFunction()
          Returns true if this function is compatible with XEP-0244: IO Data.
 IProcess pickAsync(java.lang.String sessionID, IProcessListener listener)
          Picks the running remote process associated with a session ID.
 
Methods inherited from interface net.bioclipse.xws.client.IXmppItem
discoverAsync, discoverSync, getDescription, getDiscoError, getDiscoStatus, getInfo, getItems, getJid, getNode, toString
 

Method Detail

isCompatibleFunction

boolean isCompatibleFunction()
                             throws XwsException
Returns true if this function is compatible with XEP-0244: IO Data. False otherwise. The IFunction must be discovered. Otherwise a XwsException is thrown.

Returns:
The name of the function.
Throws:
XwsException

getName

java.lang.String getName()
Returns the function name. The function name is the node name of the XMPP item.

Returns:
The name of the function.

getService

IService getService()
Returns the XMPP Service that hosts the function.

Returns:
The XMPP Service that hosts the function.

getIoSchemataAsync

void getIoSchemataAsync(IIoSchemataListener listener)
                        throws XmppException
Retrieves the input/output XML Schemata of the function. The call does not block. The listener will be informed on success or error.

Parameters:
listener - The listener to be informed.
Throws:
XmppException

getIoSchemataSync

IoSchemata getIoSchemataSync(long millis)
                             throws XmppException,
                                    XwsException,
                                    java.lang.InterruptedException
Retrieves the input/output XML Schemata of the function. The call blocks until retrieval succeeds, fails, or the timeout occurs.

Parameters:
millis - The timeout in milliseconds.
Returns:
The IoSchemata of the function.
Throws:
XmppException
XwsException
java.lang.InterruptedException

invokeAsync

IProcess invokeAsync(org.w3c.dom.Element input,
                     IProcessListener listener)
                     throws XmppException
Invokes the function. The call does not block. The listener will be informed about various events and errors. The IProcessListener is responsible (!) for handling the complete process logic: retrieving the result deleting the remote process when indicated.

Parameters:
input - The input XML element as Element.
listener - The listener responsible for retrieving the result and deleting the process when indicated.
Returns:
An object that represents the remote process.
Throws:
XmppException

invokeAsync

IProcess invokeAsync(org.w3c.dom.Element input,
                     ISimpleProcessListener simple_listener)
                     throws XmppException
Invokes the function. The call does not block. The listener will be informed about the result and errors. The ISimpleProcessListener is not (!) responsible for handling the process logic: the result will be automatically retrieved and the remote process will be automatically deleted.

Parameters:
input - The input XML element as Element.
simple_listener - The listener that will be informed about the result or errors.
Returns:
An object that represents the remote process.
Throws:
XmppException

invokeAsync

IProcess invokeAsync(java.lang.String input_element,
                     IProcessListener listener)
                     throws XmppException
Invokes the function. The call does not block. The listener will be informed about various events and errors. The IProcessListener is responsible (!) for handling the complete process logic: retrieving the result when indicated, deleting the remote process when indicated.

Parameters:
input_element - The input XML element as String.
listener - The listener responsible for retrieving the result and deleting the process when indicated.
Returns:
An object that represents the remote process.
Throws:
XmppException

invokeAsync

IProcess invokeAsync(java.lang.String input_element,
                     ISimpleProcessListener simple_listener)
                     throws XmppException
Invokes the function. The call does not block. The listener will be informed about the result and errors. The ISimpleProcessListener is not (!) responsible for handling the process logic: the result will be automatically retrieved and the remote process will be automatically deleted.

Parameters:
input_element - The input XML element as String.
simple_listener - The listener that will be informed about the result or errors.
Returns:
An object that represents the remote process.
Throws:
XmppException

pickAsync

IProcess pickAsync(java.lang.String sessionID,
                   IProcessListener listener)
                   throws XmppException
Picks the running remote process associated with a session ID. The call does not block. The listener will be informed about various events and errors. The IProcessListener is responsible (!) for handling the complete process logic: retrieving the result when indicated, deleting the remote process when indicated.

Parameters:
sessionID - The session ID of the remote process.
listener - The listener responsible for retrieving the result and deleting the process when indicated.
Returns:
An object that represents the remote process.
Throws:
XmppException

invokeSync

org.w3c.dom.Element invokeSync(org.w3c.dom.Element input,
                               long millis)
                               throws XmppException,
                                      XwsException,
                                      java.lang.InterruptedException
Invokes the function. The call blocks until the remote process returned the result, fails, or the timeout occurs. The remote process will be automatically deleted if this is required.

Parameters:
input - The input XML element as Element.
millis - The timeout in milliseconds.
Returns:
The output XML element as Element.
Throws:
XmppException
XwsException
java.lang.InterruptedException

invokeSync

org.w3c.dom.Element invokeSync(java.lang.String input_element,
                               long millis)
                               throws XmppException,
                                      XwsException,
                                      java.lang.InterruptedException
Invokes the function. The call blocks until the remote process returned the result, fails, or the timeout occurs. The remote process will be automatically deleted if this is required.

Parameters:
input_element - The input XML element as String.
millis - The timeout in milliseconds.
Returns:
The output XML element as Element.
Throws:
XmppException
XwsException
java.lang.InterruptedException