public class WebHubProfile extends java.lang.Object implements HubProfile, ConfigHubProfile
Modifier and Type | Class and Description |
---|---|
private class |
WebHubProfile.ConfigEnabler
Runnable to be called on the Event Dispatch Thread which sets the
enabledness of the user controls for configuration of this profile.
|
private static class |
WebHubProfile.ConfigModel
Helper class to generate toggle button models for hub configuration.
|
static class |
WebHubProfile.ServerFactory
Creates and configures the HTTP server on which the Web Profile resides.
|
Modifier and Type | Field and Description |
---|---|
private ClientAuthorizer |
auth_ |
private WebHubProfile.ConfigEnabler |
configDisabler_ |
private WebHubProfile.ConfigEnabler |
configEnabler_ |
private javax.swing.JToggleButton.ToggleButtonModel[] |
configModels_ |
private boolean |
controlUrls_ |
private KeyGenerator |
keyGen_ |
private static java.util.logging.Logger |
logger_ |
private MessageRestriction |
mrestrict_ |
private WebHubProfile.ServerFactory |
serverFactory_ |
private InternalServer |
xServer_ |
Constructor and Description |
---|
WebHubProfile()
Constructs a profile with default configuration.
|
WebHubProfile(WebHubProfile.ServerFactory serverFactory,
ClientAuthorizer auth,
MessageRestriction mrestrict,
KeyGenerator keyGen,
boolean controlUrls)
Constructs a profile with configuration options.
|
Modifier and Type | Method and Description |
---|---|
private javax.swing.JToggleButton.ToggleButtonModel[] |
createConfigModels()
Creates and returns some toggle models for configuration.
|
static KeyGenerator |
createKeyGenerator()
Convenience method to return a new key generator
suitable for use with a WebHubProfile.
|
javax.swing.JToggleButton.ToggleButtonModel[] |
getConfigModels()
Returns some toggle button models for hub profile configuration.
|
MessageRestriction |
getMessageRestriction()
Returns a MessageRestriction object which controls what messages
may be sent by clients registering under ths profile.
|
java.lang.String |
getProfileName()
Returns the name of this profile.
|
boolean |
isRunning()
Indicates whether this profile is currently running.
|
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.
|
private final WebHubProfile.ServerFactory serverFactory_
private final ClientAuthorizer auth_
private final KeyGenerator keyGen_
private final WebHubProfile.ConfigEnabler configEnabler_
private final WebHubProfile.ConfigEnabler configDisabler_
private MessageRestriction mrestrict_
private boolean controlUrls_
private InternalServer xServer_
private javax.swing.JToggleButton.ToggleButtonModel[] configModels_
private static final java.util.logging.Logger logger_
public WebHubProfile(WebHubProfile.ServerFactory serverFactory, ClientAuthorizer auth, MessageRestriction mrestrict, KeyGenerator keyGen, boolean controlUrls)
serverFactory
- factory for server providing HTTP
and XML-RPC implementationauth
- client authorizer implementationmrestrict
- restriction for permitted outward MTypeskeyGen
- key generator for private keyscontrolUrls
- true iff access to local URLs is to be restrictedpublic WebHubProfile() throws java.io.IOException
java.io.IOException
public java.lang.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 java.io.IOException
HubProfile
start
in interface HubProfile
profile
- object which can provide hub connectionsjava.io.IOException
public boolean isRunning()
HubProfile
isRunning
in interface HubProfile
public void stop()
HubProfile
stop
in interface HubProfile
public javax.swing.JToggleButton.ToggleButtonModel[] getConfigModels()
ConfigHubProfile
getConfigModels
in interface ConfigHubProfile
private javax.swing.JToggleButton.ToggleButtonModel[] createConfigModels()
public static KeyGenerator createKeyGenerator()