net.sf.beep4j
Interface StartChannelRequest


public interface StartChannelRequest

Represents a request to start a new channel by the other peer. This request may be cancelled or accepted by selecting a profile from a list of profiles. If you take no action, the request will be cancelled, the channel not created.

Author:
Simon Raess

Method Summary
 void cancel(int code, java.lang.String message)
          Cancels the request to start a new channel.
 ProfileInfo getProfile(java.lang.String profileUri)
          Gets the ProfileInfo for the given profile uri.
 ProfileInfo[] getProfiles()
          Gets the list of acceptable profiles sent as part of the start channel request.
 boolean hasProfile(java.lang.String profileUri)
          Determines whether there is a profile element with the given profile uri.
 void selectProfile(ProfileInfo profile, ChannelHandler handler)
          Selects one particular profile from the list of profiles.
 

Method Detail

getProfiles

ProfileInfo[] getProfiles()
Gets the list of acceptable profiles sent as part of the start channel request.

Returns:
the array of acceptable profiles

hasProfile

boolean hasProfile(java.lang.String profileUri)
Determines whether there is a profile element with the given profile uri.

Parameters:
profileUri - the profile uri
Returns:
true iff a profile info object with the given uri is available

getProfile

ProfileInfo getProfile(java.lang.String profileUri)
Gets the ProfileInfo for the given profile uri. If there is no ProfileInfo object matching the uri, an IllegalArgumentException is thrown. This method does not return null.

Parameters:
profileUri - the profile uri
Returns:
the ProfileInfo object matching the given profile uri
Throws:
java.lang.IllegalArgumentException - if the profile info element is missing

selectProfile

void selectProfile(ProfileInfo profile,
                   ChannelHandler handler)
Selects one particular profile from the list of profiles. The acceptable list of profiles can be retrieved from the getProfiles() method. If you pass in a profile which is not in the list of profiles, this method will throw an exception.

Parameters:
profile - the selected profile for the channel
handler - the channel handler for the new channel

cancel

void cancel(int code,
            java.lang.String message)
Cancels the request to start a new channel. An error element in a negative reply is sent to the other peer and the channel won't be created.

Parameters:
code - the reply code
message - the diagnostic message


Copyright © 2007 null. All Rights Reserved.