public final class GroupSpecifier
extends java.lang.Object
GroupSpecifier
- GroupSpecifier class is used to construct
the opaque groupspec strings that can be passed to NetStream and NetGroup constructors.
A groupspec specifies an RTMFP Peer-to-Peer Group, including the capabilities, restrictions,
and authorizations of the member using the groupspec.
Constructor and Description |
---|
GroupSpecifier(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBootstrapPeer(java.lang.String peerID)
Causes the associated NetStream or NetGroup to make an initial neighbor
connection to the specified peerID.
|
void |
addIPMulticastAddress(java.lang.String address,
int port,
java.lang.String source)
Causes the associated NetStream or NetGroup to join the specified IP multicast group and listen to the specified UDP port.
|
java.lang.String |
authorizations()
Returns a string that represents passwords for IP multicast publishing and for posting.
|
static java.lang.String |
encodeBootstrapPeerIDSpec(java.lang.String peerID)
Encodes and returns a string that represents a bootstrap peerID.
|
static java.lang.String |
encodeIPMulticastAddressSpec(java.lang.String address,
int port,
java.lang.String source)
Encodes and returns a string that represents an IP multicast socket address.
|
static java.lang.String |
encodePostingAuthorization(java.lang.String password)
Encodes and returns a string that represents a posting password.
|
static java.lang.String |
encodePublishAuthorization(java.lang.String password)
Encodes and returns a string that represents a multicast publishing password.
|
java.lang.String |
groupspecWithAuthorizations()
Returns the opaque groupspec string, including authorizations,
that can be passed to NetStream and NetGroup constructors.
|
java.lang.String |
groupspecWithoutAuthorizations()
Returns the opaque groupspec string, without authorizations,
that can be passed to NetStream and NetGroup constructors.
|
boolean |
ipMulticastMemberUpdatesEnabled()
Specifies whether information about group membership can be exchanged
on IP multicast sockets.
|
void |
ipMulticastMemberUpdatesEnabled(boolean enable)
Specifies whether information about group membership can be exchanged
on IP multicast sockets.
|
void |
makeUnique()
Adds a strong pseudorandom tag to the groupspec to make it unique.
|
int |
maxSupportedGroupspecVersion()
Specifies the maximum groupspec version supported by this runtime.
|
boolean |
multicastEnabled()
Specifies whether streaming is enabled for the NetGroup.
|
void |
multicastEnabled(boolean enable)
Specifies whether streaming is enabled for the NetGroup.
|
boolean |
objectReplicationEnabled()
Specifies whether object replication is enabled for the NetGroup.
|
void |
objectReplicationEnabled(boolean enable)
Specifies whether object replication is enabled for the NetGroup.
|
boolean |
peerToPeerDisabled()
Specifies whether peer-to-peer connections are disabled for the NetGroup or NetStream.
|
void |
peerToPeerDisabled(boolean disable)
Specifies whether peer-to-peer connections are disabled for the NetGroup or NetStream.
|
boolean |
postingEnabled()
Specifies whether posting is enabled for the NetGroup.
|
void |
postingEnabled(boolean enable)
Specifies whether posting is enabled for the NetGroup.
|
boolean |
routingEnabled()
Specifies whether directed routing methods are enabled for the NetGroup.
|
void |
routingEnabled(boolean enable)
Specifies whether directed routing methods are enabled for the NetGroup.
|
boolean |
serverChannelEnabled()
Specifies whether members of the NetGroup can open a channel to the server.
|
void |
serverChannelEnabled(boolean enable)
Specifies whether members of the NetGroup can open a channel to the server.
|
void |
setPostingPassword(java.lang.String password,
java.lang.String salt)
Specifies whether a password is required to post in the NetGroup.
|
void |
setPublishPassword(java.lang.String password,
java.lang.String salt)
Specifies whether a password is required to publish a multicast stream in the NetStream.
|
public GroupSpecifier(java.lang.String name)
name
- name for the Group on which all members must agreepublic static java.lang.String encodeBootstrapPeerIDSpec(java.lang.String peerID)
peerID
- public static java.lang.String encodeIPMulticastAddressSpec(java.lang.String address, int port, java.lang.String source)
address
- port
- source
- public static java.lang.String encodePostingAuthorization(java.lang.String password)
password
- password to encode, which must match the posting password (if set) to enable NetGroup.post()public static java.lang.String encodePublishAuthorization(java.lang.String password)
password
- password to encode, which must match the publish password (if set) to enable NetStream.publish().public boolean ipMulticastMemberUpdatesEnabled()
public void ipMulticastMemberUpdatesEnabled(boolean enable)
enable
- public int maxSupportedGroupspecVersion()
public boolean multicastEnabled()
false
(streaming is disabled).public void multicastEnabled(boolean enable)
false
(streaming is disabled).enable
- public boolean objectReplicationEnabled()
false
(object replication is disabled).public void objectReplicationEnabled(boolean enable)
false
(object replication is disabled).enable
- public boolean peerToPeerDisabled()
true
),
the P2P warning dialog is suppressed. In this situation, no neighbor connections
can be made, and no group members use upstream bandwidth.
Disabling P2P connections in this way is generally useful only
when receiving multicast streams via pure IP multicast.public void peerToPeerDisabled(boolean disable)
true
),
the P2P warning dialog is suppressed. In this situation, no neighbor connections
can be made, and no group members use upstream bandwidth.
Disabling P2P connections in this way is generally useful only
when receiving multicast streams via pure IP multicast.disable
- public boolean postingEnabled()
false
(posting is disabled).public void postingEnabled(boolean enable)
false
(posting is disabled).enable
- public boolean routingEnabled()
false
(directed routing methods are disabled).public void routingEnabled(boolean enable)
false
(directed routing methods are disabled).enable
- public boolean serverChannelEnabled()
false
.
A channel to the server must be opened before the server can provide
supporting functions to group members.
Depending on server configuration, supporting functions may or may not be provided over this channel.public void serverChannelEnabled(boolean enable)
false
.
A channel to the server must be opened before the server can provide
supporting functions to group members.
Depending on server configuration, supporting functions may or may not be provided over this channel.enable
- public void addBootstrapPeer(java.lang.String peerID)
peerID
- peerID to which an initial neighbor connection should be
made to bootstrap into the peer-to-peer meshpublic void addIPMulticastAddress(java.lang.String address, int port, java.lang.String source)
address
- string specifying the address of the IPv4 or IPv6 multicast group to join,
optionally followed by a colon (":") and the UDP port number.
If specifying an IPv6 address and a port, the IPv6 address must be enclosed in square brackets.
Examples: "224.0.0.254", "224.0.0.254:30000", "ff03::ffff", "[ff03::ffff]:30000".port
- source
- string specifying the source IP address of a source-specific multicast (SSM)public java.lang.String authorizations()
public java.lang.String groupspecWithAuthorizations()
public java.lang.String groupspecWithoutAuthorizations()
public void makeUnique()
public void setPostingPassword(java.lang.String password, java.lang.String salt)
password
- password that must be given to use NetGroup.post().
If null, no password is required to post.salt
- modifies the hash of the password to increase the difficulty of guessing it.
For best security, this parameter should be set to a random value.public void setPublishPassword(java.lang.String password, java.lang.String salt)
password
- password that must be given to use NetStream.publish().
If null, no password is required to publish.salt
- modifies the hash of the password to increase the difficulty of guessing it.
For best security, this parameter should be set to a random value.