public class StandardHubProfile extends Object implements HubProfile
Constructor and Description |
---|
StandardHubProfile()
Constructs a hub profile with default configuration.
|
StandardHubProfile(SampXmlRpcClientFactory xClientFactory,
SampXmlRpcServerFactory xServerFactory,
File lockfile,
String secret)
Constructs a hub profile with given configuration information.
|
Modifier and Type | Method and Description |
---|---|
static String |
createSecret()
Returns a string suitable for use as a Standard Profile Secret.
|
LockInfo |
getLockInfo()
Returns the lockfile information associated with this object.
|
MessageRestriction |
getMessageRestriction()
Returns a MessageRestriction object which controls what messages
may be sent by clients registering under ths profile.
|
String |
getProfileName()
Returns the name of this profile.
|
boolean |
isRunning()
Indicates whether this profile is currently running.
|
URL |
publishLockfile()
Returns an HTTP URL at which the lockfile for this hub can be found.
|
void |
start(ClientProfile profile)
Starts this profile's activity allowing access to a given supplier of
hub connections.
|
void |
stop()
Ends this profile's activity on behalf of the hub.
|
public StandardHubProfile(SampXmlRpcClientFactory xClientFactory, SampXmlRpcServerFactory xServerFactory, File lockfile, String secret)
lockfile
is null, no lockfile will
be written at hub startup.xClientFactory
- XML-RPC client factory implementationxServerFactory
- XML-RPC server implementationlockfile
- location to use for hub lockfile, or nullsecret
- value for samp.secret lockfile keypublic StandardHubProfile() throws IOException
IOException
public String getProfileName()
HubProfile
getProfileName
in interface HubProfile
getProfileName
in interface ProfileToken
public MessageRestriction getMessageRestriction()
ProfileToken
getMessageRestriction
in interface ProfileToken
public void start(ClientProfile profile) throws IOException
HubProfile
start
in interface HubProfile
profile
- object which can provide hub connectionsIOException
public boolean isRunning()
HubProfile
isRunning
in interface HubProfile
public void stop()
HubProfile
stop
in interface HubProfile
public LockInfo getLockInfo()
public URL publishLockfile() throws IOException
Use this with care; publishing your lockfile means that other people can connect to your hub and potentially do disruptive things.
IOException
public static String createSecret()
Copyright © 2008–2024. All rights reserved.