Class AppClientContainerBuilder
- java.lang.Object
-
- org.glassfish.appclient.client.acc.AppClientContainerBuilder
-
- All Implemented Interfaces:
AppClientContainer.Builder
public class AppClientContainerBuilder extends Object implements AppClientContainer.Builder
Implements a builder for accumulating configuration information for the app client container and then starting the ACC.The interface for the ACC builder is defined as AppClientContainer.Builder so the relevant JavaDoc is concentrated in that one class.
The AppClientContainerBuilder class records the information the container itself needs in order to operate.
- Author:
- tjquinn
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppClientContainerBuilder
addMessageSecurityConfig(org.glassfish.appclient.client.acc.config.MessageSecurityConfig msConfig)
Adds an optionalMessageSecurityConfig
setting.AppClientContainerBuilder
authRealm(String className)
Sets the optional authentication realm for the ACC.AppClientContainerBuilder
clientCredentials(String user, char[] password)
Sets the optional client credentials to be used during authentication to the back-end.AppClientContainerBuilder
clientCredentials(String user, char[] password, String realm)
Sets the optional client credentials and server-side realm to be used during authentication to the back-end.AppClientContainerBuilder
clientCredentials(org.glassfish.appclient.client.acc.config.ClientCredential cc)
AppClientContainerBuilder
containerProperties(List<org.glassfish.appclient.client.acc.config.Property> props)
Sets the container-level properties.AppClientContainerBuilder
containerProperties(Properties props)
Sets the container-level Properties.org.glassfish.appclient.client.acc.config.AuthRealm
getAuthRealm()
org.glassfish.appclient.client.acc.config.ClientCredential
getClientCredential()
Properties
getContainerProperties()
Returns the container-level Properties.Logger
getLogger()
List<org.glassfish.appclient.client.acc.config.MessageSecurityConfig>
getMessageSecurityConfig()
boolean
getSendPassword()
org.glassfish.appclient.client.acc.config.TargetServer[]
getTargetServers()
AppClientContainerBuilder
logger(Logger logger)
Sets the logger which the ACC should use as it runs.AppClientContainer
newContainer(Class mainClass)
AppClientContainer
newContainer(Class mainClass, CallbackHandler callerSpecifiedCallbackHandler)
AppClientContainer
newContainer(URI clientURI)
AppClientContainer
newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName)
AppClientContainer
newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName, boolean isTextAuth)
AppClientContainerBuilder
sendPassword(boolean sendPassword)
Sets whether the ACC should send the password to the server during authentication.
-
-
-
Method Detail
-
newContainer
public AppClientContainer newContainer(Class mainClass, CallbackHandler callerSpecifiedCallbackHandler) throws Exception
- Throws:
Exception
-
newContainer
public AppClientContainer newContainer(Class mainClass) throws Exception
- Specified by:
newContainer
in interfaceAppClientContainer.Builder
- Throws:
Exception
-
newContainer
public AppClientContainer newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName) throws Exception, UserError
- Specified by:
newContainer
in interfaceAppClientContainer.Builder
- Throws:
Exception
UserError
-
newContainer
public AppClientContainer newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName, boolean isTextAuth) throws Exception, UserError
- Specified by:
newContainer
in interfaceAppClientContainer.Builder
- Throws:
Exception
UserError
-
newContainer
public AppClientContainer newContainer(URI clientURI) throws Exception, UserError
- Specified by:
newContainer
in interfaceAppClientContainer.Builder
- Throws:
Exception
UserError
-
addMessageSecurityConfig
public AppClientContainerBuilder addMessageSecurityConfig(org.glassfish.appclient.client.acc.config.MessageSecurityConfig msConfig)
Description copied from interface:AppClientContainer.Builder
Adds an optionalMessageSecurityConfig
setting.- Specified by:
addMessageSecurityConfig
in interfaceAppClientContainer.Builder
- Parameters:
msConfig
- the new MessageSecurityConfig- Returns:
- the
Builder
instance
-
getMessageSecurityConfig
public List<org.glassfish.appclient.client.acc.config.MessageSecurityConfig> getMessageSecurityConfig()
- Specified by:
getMessageSecurityConfig
in interfaceAppClientContainer.Builder
-
logger
public AppClientContainerBuilder logger(Logger logger)
Description copied from interface:AppClientContainer.Builder
Sets the logger which the ACC should use as it runs.- Specified by:
logger
in interfaceAppClientContainer.Builder
- Returns:
-
getLogger
public Logger getLogger()
- Specified by:
getLogger
in interfaceAppClientContainer.Builder
-
authRealm
public AppClientContainerBuilder authRealm(String className)
Description copied from interface:AppClientContainer.Builder
Sets the optional authentication realm for the ACC.Each specific realm will determine which properties should be set in the Properties argument.
- Specified by:
authRealm
in interfaceAppClientContainer.Builder
- Parameters:
className
- name of the class which implements the realm- Returns:
- the
Builder
instance
-
getAuthRealm
public org.glassfish.appclient.client.acc.config.AuthRealm getAuthRealm()
- Specified by:
getAuthRealm
in interfaceAppClientContainer.Builder
-
clientCredentials
public AppClientContainerBuilder clientCredentials(String user, char[] password)
Description copied from interface:AppClientContainer.Builder
Sets the optional client credentials to be used during authentication to the back-end.If the client does not invoke
clientCredentials
then the ACC will use aCallbackHandler
when it discovers that authentication is required. SeeAppClientContainer.callerSuppliedCallbackHandler
.- Specified by:
clientCredentials
in interfaceAppClientContainer.Builder
password
- password valid in the default realm on the server for the username- Returns:
- the
Builder
instance
-
clientCredentials
public AppClientContainerBuilder clientCredentials(String user, char[] password, String realm)
Description copied from interface:AppClientContainer.Builder
Sets the optional client credentials and server-side realm to be used during authentication to the back-end.If the client does not invoke
clientCredentials
then the ACC will use aCallbackHandler
when it discovers that authentication is required. SeeAppClientContainer.callerSuppliedCallbackHandler
.- Specified by:
clientCredentials
in interfaceAppClientContainer.Builder
password
- password valid in the specified realm on the server for the username- Returns:
- the
Builder
instance
-
clientCredentials
public AppClientContainerBuilder clientCredentials(org.glassfish.appclient.client.acc.config.ClientCredential cc)
-
getClientCredential
public org.glassfish.appclient.client.acc.config.ClientCredential getClientCredential()
- Specified by:
getClientCredential
in interfaceAppClientContainer.Builder
-
containerProperties
public AppClientContainerBuilder containerProperties(Properties props)
Description copied from interface:AppClientContainer.Builder
Sets the container-level Properties.- Specified by:
containerProperties
in interfaceAppClientContainer.Builder
- Returns:
-
containerProperties
public AppClientContainerBuilder containerProperties(List<org.glassfish.appclient.client.acc.config.Property> props)
Description copied from interface:AppClientContainer.Builder
Sets the container-level properties.Typically used when setting the properties from the parsed XML config file.
- Specified by:
containerProperties
in interfaceAppClientContainer.Builder
- Parameters:
props
- Property objects to use in setting the properties- Returns:
-
getContainerProperties
public Properties getContainerProperties()
Description copied from interface:AppClientContainer.Builder
Returns the container-level Properties.- Specified by:
getContainerProperties
in interfaceAppClientContainer.Builder
- Returns:
- container-level properties
-
sendPassword
public AppClientContainerBuilder sendPassword(boolean sendPassword)
Description copied from interface:AppClientContainer.Builder
Sets whether the ACC should send the password to the server during authentication.- Specified by:
sendPassword
in interfaceAppClientContainer.Builder
- Returns:
-
getSendPassword
public boolean getSendPassword()
- Specified by:
getSendPassword
in interfaceAppClientContainer.Builder
-
getTargetServers
public org.glassfish.appclient.client.acc.config.TargetServer[] getTargetServers()
- Specified by:
getTargetServers
in interfaceAppClientContainer.Builder
-
-