com.skype
Class Application

java.lang.Object
  extended by com.skype.Application
All Implemented Interfaces:
Serializable

public final class Application
extends Object

Implements the AP2AP API.

Author:
Koji Hisano
See Also:
https://developer.skype.com/Docs/ApiDoc/Application_to_application_commands, Serialized Form

Method Summary
 void addApplicationListener(ApplicationListener listener)
          Add a listener for events to this AP2AP implementation.
 Stream[] connect(Friend... friends)
          Setup an AP2AP connection with a Friend.
 Stream[] connect(String... ids)
          Setup an AP2AP connection with members.
 Stream[] connectToAll()
          Find connetable users.
 void finish()
          Finishes this application with disconnecting all streams.
 Friend[] getAllConnectableFriends()
          Find user to whom Skype can connect using AP2AP.
 Friend[] getAllConnectedFriends()
          Find all user with whom we have a established AP2AP connection.
 Friend[] getAllConnectingFriends()
          Find all users to whom SKype is connecting a AP2AP connection.
 Friend[] getAllReceivedFriends()
          Find all users which we have received data from using an AP2AP connection.
 Friend[] getAllSendingFriends()
          Find all user to whom we are sending data using a AP2AP connection.
 Stream[] getAllStreams()
          Gets all connected streams.
 Stream[] getAllStreams(Friend... friends)
          Gets all connected streams by Friend instances.
 Stream[] getAllStreams(String... ids)
          Gets connected streams by Skype IDs.
 Object getData(String name)
          Returns the user data to which this object maps to the specified by the name.
 String getName()
          Return the application name.
 void removeApplicationListener(ApplicationListener listener)
          Remove a listener for this AP2AP implementation.
 void setData(String name, Object userData)
          Associates the specified user data with the specified name in this object.
 String toString()
          Enable nice printing of Object, by returning the app name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()
Enable nice printing of Object, by returning the app name.

Overrides:
toString in class Object
Returns:
AP2AP application name.

getName

public String getName()
Return the application name.

Returns:
the application name.

finish

public void finish()
            throws SkypeException
Finishes this application with disconnecting all streams.

Throws:
SkypeException - when connection is gone bad.

connectToAll

public Stream[] connectToAll()
                      throws SkypeException
Find connetable users. Connections are only allowed to connectable users, online parties who are in the user's contact list or have active ongoing communication with the user.

Returns:
Stream of users.
Throws:
SkypeException - when connection is gone bad.

connect

public Stream[] connect(Friend... friends)
                 throws SkypeException
Setup an AP2AP connection with a Friend.

Parameters:
friends - The ppl to start a AP2AP with.
Returns:
The connected streams.
Throws:
SkypeException - when connection is gone bad.

connect

public Stream[] connect(String... ids)
                 throws SkypeException
Setup an AP2AP connection with members.

Parameters:
ids - The member IDs to start a AP2AP with.
Returns:
The connected streams.
Throws:
SkypeException - when connection is gone bad.

getAllStreams

public Stream[] getAllStreams(Friend... friends)
                       throws SkypeException
Gets all connected streams by Friend instances.

Parameters:
friends - to search streams for.
Returns:
the found streams.
Throws:
SkypeException - when connection is gone bad.

getAllStreams

public Stream[] getAllStreams(String... ids)
                       throws SkypeException
Gets connected streams by Skype IDs.

Parameters:
The - Skype Ids to search streams for.
Returns:
the found streams.
Throws:
SkypeException - when connection is gone bad.

getAllStreams

public Stream[] getAllStreams()
                       throws SkypeException
Gets all connected streams.

Returns:
all started streams.
Throws:
SkypeException - when connection is gone bad.

addApplicationListener

public void addApplicationListener(ApplicationListener listener)
Add a listener for events to this AP2AP implementation.

Parameters:
listener - the listener which will be triggered.

removeApplicationListener

public void removeApplicationListener(ApplicationListener listener)
Remove a listener for this AP2AP implementation. If listener is already removed nothing happens.

Parameters:
listener - The listener that has to be removed.

getAllConnectableFriends

public Friend[] getAllConnectableFriends()
                                  throws SkypeException
Find user to whom Skype can connect using AP2AP.

Returns:
Array of connectable users.
Throws:
SkypeException - when connection is gone bad.

getAllConnectingFriends

public Friend[] getAllConnectingFriends()
                                 throws SkypeException
Find all users to whom SKype is connecting a AP2AP connection.

Returns:
Array of user to whom a connecting AP2AP is in progress.
Throws:
SkypeException - when connection is gone bad.

getAllConnectedFriends

public Friend[] getAllConnectedFriends()
                                throws SkypeException
Find all user with whom we have a established AP2AP connection.

Returns:
all AP2AP connected users.
Throws:
SkypeException - when connection is gone bad.

getAllSendingFriends

public Friend[] getAllSendingFriends()
                              throws SkypeException
Find all user to whom we are sending data using a AP2AP connection.

Returns:
an array of users that we are sending to.
Throws:
SkypeException - when connection is gone bad.

getAllReceivedFriends

public Friend[] getAllReceivedFriends()
                               throws SkypeException
Find all users which we have received data from using an AP2AP connection.

Returns:
array of found users.
Throws:
SkypeException - when connection is gone bad.

getData

public final Object getData(String name)
Returns the user data to which this object maps to the specified by the name. Returns null if this object contains no mapping for the name.

Parameters:
name - name whose associated user data is to be returned.
Returns:
the user data to which this object maps the specified name, or null if this object contains no mapping for the name.
See Also:
Map.get(Object)

setData

public final void setData(String name,
                          Object userData)
Associates the specified user data with the specified name in this object.

Parameters:
name - name with which the specified user data is to be associated.
userData - user data to be associated with the specified name.
See Also:
Map.put(Object, Object)


Copyright © 2004-2011. All Rights Reserved.