public class WebClientProfile extends Object implements ClientProfile
Modifier and Type | Field and Description |
---|---|
static String |
URLTRANS_KEY
RegInfo map key for URL translation service base URL
("samp.url-translator").
|
static String |
WEBPROFILE_HUB_PREFIX
Prefix in SAMP_HUB value indicating web profile application name
("web-appname:").
|
static String |
WEBSAMP_CLIENT_PREFIX
Prefix to client interface opeation names for XML-RPC method names
("").
|
static String |
WEBSAMP_HUB_PREFIX
Prefix to hub interface operation names for XML-RPC method names
("samp.webhub.").
|
static String |
WEBSAMP_PATH
Path on WEBSAMP_PORT web server at which XML-RPC server lives
("/").
|
static int |
WEBSAMP_PORT
Web Profile hub port number (21012).
|
Constructor and Description |
---|
WebClientProfile()
Constructor with no arguments.
|
WebClientProfile(Map securityMap,
SampXmlRpcClientFactory xClientFactory,
URL hubEndpoint)
Constructor with configuration options.
|
WebClientProfile(String appName)
Constructor with declared client name.
|
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultAppName()
Returns the default application name used by this profile if none
is supplied explicitly.
|
static URL |
getDefaultHubEndpoint()
Returns the hub XML-RPC endpoint defined by the Web Profile.
|
URL |
getHubEndpoint()
Returns the hub XML-RPC endpoint used by this profile.
|
static WebClientProfile |
getInstance()
Returns a default instance of this profile.
|
boolean |
isHubRunning()
Indicates whether a hub contactable by this profile appears to be
running.
|
HubConnection |
register()
Attempts to register with a SAMP hub and return a corresponding
connection object.
|
public static final int WEBSAMP_PORT
public static final String WEBSAMP_PATH
public static final String WEBSAMP_HUB_PREFIX
public static final String WEBSAMP_CLIENT_PREFIX
public static final String URLTRANS_KEY
public static final String WEBPROFILE_HUB_PREFIX
public WebClientProfile(Map securityMap, SampXmlRpcClientFactory xClientFactory, URL hubEndpoint)
securityMap
- map containing security information for registrationxClientFactory
- XML-RPC client factoryhubEndpoint
- XML-RPC endpoint for hub serverpublic WebClientProfile(String appName)
appName
- client's declared application name
(samp.name entry in security-info map)public WebClientProfile()
getDefaultAppName()
.public boolean isHubRunning()
ClientProfile
isHubRunning
in interface ClientProfile
public HubConnection register() throws SampException
ClientProfile
register
in interface ClientProfile
SampException
- in case of some unexpected errorpublic URL getHubEndpoint()
public static URL getDefaultHubEndpoint()
public static WebClientProfile getInstance()
public static String getDefaultAppName()
Copyright © 2008–2024. All rights reserved.