Class WebHubProfile

    • Constructor Detail

      • WebHubProfile

        public WebHubProfile​(WebHubProfile.ServerFactory serverFactory,
                             ClientAuthorizer auth,
                             MessageRestriction mrestrict,
                             KeyGenerator keyGen,
                             boolean controlUrls)
        Constructs a profile with configuration options.
        Parameters:
        serverFactory - factory for server providing HTTP and XML-RPC implementation
        auth - client authorizer implementation
        mrestrict - restriction for permitted outward MTypes
        keyGen - key generator for private keys
        controlUrls - true iff access to local URLs is to be restricted
      • WebHubProfile

        public WebHubProfile()
                      throws java.io.IOException
        Constructs a profile with default configuration.
        Throws:
        java.io.IOException
    • Method Detail

      • getMessageRestriction

        public MessageRestriction getMessageRestriction()
        Description copied from interface: ProfileToken
        Returns a MessageRestriction object which controls what messages may be sent by clients registering under ths profile. If null is returned, any messages may be sent.
        Specified by:
        getMessageRestriction in interface ProfileToken
        Returns:
        message restriction, or null
      • start

        public void start​(ClientProfile profile)
                   throws java.io.IOException
        Description copied from interface: HubProfile
        Starts this profile's activity allowing access to a given supplier of hub connections.
        Specified by:
        start in interface HubProfile
        Parameters:
        profile - object which can provide hub connections
        Throws:
        java.io.IOException
      • isRunning

        public boolean isRunning()
        Description copied from interface: HubProfile
        Indicates whether this profile is currently running.
        Specified by:
        isRunning in interface HubProfile
        Returns:
        true iff profile is running
      • stop

        public void stop()
        Description copied from interface: HubProfile
        Ends this profile's activity on behalf of the hub. Any resources associated with the profile should be released. This does not include messaging registered clients about profile termination; that should be taken care of by the user of this profile.
        Specified by:
        stop in interface HubProfile
      • getConfigModels

        public javax.swing.JToggleButton.ToggleButtonModel[] getConfigModels()
        Description copied from interface: ConfigHubProfile
        Returns some toggle button models for hub profile configuration.
        Specified by:
        getConfigModels in interface ConfigHubProfile
        Returns:
        toggle button model array
      • createConfigModels

        private javax.swing.JToggleButton.ToggleButtonModel[] createConfigModels()
        Creates and returns some toggle models for configuration. They are only enabled when the profile is not running.
      • createKeyGenerator

        public static KeyGenerator createKeyGenerator()
        Convenience method to return a new key generator suitable for use with a WebHubProfile.
        Returns:
        new key generator for web hub private keys