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 AppClientContainerBuilderaddMessageSecurityConfig(org.glassfish.appclient.client.acc.config.MessageSecurityConfig msConfig)Adds an optionalMessageSecurityConfigsetting.AppClientContainerBuilderauthRealm(String className)Sets the optional authentication realm for the ACC.AppClientContainerBuilderclientCredentials(String user, char[] password)Sets the optional client credentials to be used during authentication to the back-end.AppClientContainerBuilderclientCredentials(String user, char[] password, String realm)Sets the optional client credentials and server-side realm to be used during authentication to the back-end.AppClientContainerBuilderclientCredentials(org.glassfish.appclient.client.acc.config.ClientCredential cc)AppClientContainerBuildercontainerProperties(List<org.glassfish.appclient.client.acc.config.Property> props)Sets the container-level properties.AppClientContainerBuildercontainerProperties(Properties props)Sets the container-level Properties.org.glassfish.appclient.client.acc.config.AuthRealmgetAuthRealm()org.glassfish.appclient.client.acc.config.ClientCredentialgetClientCredential()PropertiesgetContainerProperties()Returns the container-level Properties.LoggergetLogger()List<org.glassfish.appclient.client.acc.config.MessageSecurityConfig>getMessageSecurityConfig()booleangetSendPassword()org.glassfish.appclient.client.acc.config.TargetServer[]getTargetServers()AppClientContainerBuilderlogger(Logger logger)Sets the logger which the ACC should use as it runs.AppClientContainernewContainer(Class mainClass)AppClientContainernewContainer(Class mainClass, CallbackHandler callerSpecifiedCallbackHandler)AppClientContainernewContainer(URI clientURI)AppClientContainernewContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName)AppClientContainernewContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName, boolean isTextAuth)AppClientContainerBuildersendPassword(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:
newContainerin interfaceAppClientContainer.Builder- Throws:
Exception
-
newContainer
public AppClientContainer newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName) throws Exception, UserError
- Specified by:
newContainerin interfaceAppClientContainer.Builder- Throws:
ExceptionUserError
-
newContainer
public AppClientContainer newContainer(URI clientURI, CallbackHandler callerSpecifiedCallbackHandler, String callerSpecifiedMainClassName, String callerSpecifiedAppClientName, boolean isTextAuth) throws Exception, UserError
- Specified by:
newContainerin interfaceAppClientContainer.Builder- Throws:
ExceptionUserError
-
newContainer
public AppClientContainer newContainer(URI clientURI) throws Exception, UserError
- Specified by:
newContainerin interfaceAppClientContainer.Builder- Throws:
ExceptionUserError
-
addMessageSecurityConfig
public AppClientContainerBuilder addMessageSecurityConfig(org.glassfish.appclient.client.acc.config.MessageSecurityConfig msConfig)
Description copied from interface:AppClientContainer.BuilderAdds an optionalMessageSecurityConfigsetting.- Specified by:
addMessageSecurityConfigin interfaceAppClientContainer.Builder- Parameters:
msConfig- the new MessageSecurityConfig- Returns:
- the
Builderinstance
-
getMessageSecurityConfig
public List<org.glassfish.appclient.client.acc.config.MessageSecurityConfig> getMessageSecurityConfig()
- Specified by:
getMessageSecurityConfigin interfaceAppClientContainer.Builder
-
logger
public AppClientContainerBuilder logger(Logger logger)
Description copied from interface:AppClientContainer.BuilderSets the logger which the ACC should use as it runs.- Specified by:
loggerin interfaceAppClientContainer.Builder- Returns:
-
getLogger
public Logger getLogger()
- Specified by:
getLoggerin interfaceAppClientContainer.Builder
-
authRealm
public AppClientContainerBuilder authRealm(String className)
Description copied from interface:AppClientContainer.BuilderSets the optional authentication realm for the ACC.Each specific realm will determine which properties should be set in the Properties argument.
- Specified by:
authRealmin interfaceAppClientContainer.Builder- Parameters:
className- name of the class which implements the realm- Returns:
- the
Builderinstance
-
getAuthRealm
public org.glassfish.appclient.client.acc.config.AuthRealm getAuthRealm()
- Specified by:
getAuthRealmin interfaceAppClientContainer.Builder
-
clientCredentials
public AppClientContainerBuilder clientCredentials(String user, char[] password)
Description copied from interface:AppClientContainer.BuilderSets the optional client credentials to be used during authentication to the back-end.If the client does not invoke
clientCredentialsthen the ACC will use aCallbackHandlerwhen it discovers that authentication is required. SeeAppClientContainer.callerSuppliedCallbackHandler.- Specified by:
clientCredentialsin interfaceAppClientContainer.Builderpassword- password valid in the default realm on the server for the username- Returns:
- the
Builderinstance
-
clientCredentials
public AppClientContainerBuilder clientCredentials(String user, char[] password, String realm)
Description copied from interface:AppClientContainer.BuilderSets the optional client credentials and server-side realm to be used during authentication to the back-end.If the client does not invoke
clientCredentialsthen the ACC will use aCallbackHandlerwhen it discovers that authentication is required. SeeAppClientContainer.callerSuppliedCallbackHandler.- Specified by:
clientCredentialsin interfaceAppClientContainer.Builderpassword- password valid in the specified realm on the server for the username- Returns:
- the
Builderinstance
-
clientCredentials
public AppClientContainerBuilder clientCredentials(org.glassfish.appclient.client.acc.config.ClientCredential cc)
-
getClientCredential
public org.glassfish.appclient.client.acc.config.ClientCredential getClientCredential()
- Specified by:
getClientCredentialin interfaceAppClientContainer.Builder
-
containerProperties
public AppClientContainerBuilder containerProperties(Properties props)
Description copied from interface:AppClientContainer.BuilderSets the container-level Properties.- Specified by:
containerPropertiesin interfaceAppClientContainer.Builder- Returns:
-
containerProperties
public AppClientContainerBuilder containerProperties(List<org.glassfish.appclient.client.acc.config.Property> props)
Description copied from interface:AppClientContainer.BuilderSets the container-level properties.Typically used when setting the properties from the parsed XML config file.
- Specified by:
containerPropertiesin interfaceAppClientContainer.Builder- Parameters:
props- Property objects to use in setting the properties- Returns:
-
getContainerProperties
public Properties getContainerProperties()
Description copied from interface:AppClientContainer.BuilderReturns the container-level Properties.- Specified by:
getContainerPropertiesin interfaceAppClientContainer.Builder- Returns:
- container-level properties
-
sendPassword
public AppClientContainerBuilder sendPassword(boolean sendPassword)
Description copied from interface:AppClientContainer.BuilderSets whether the ACC should send the password to the server during authentication.- Specified by:
sendPasswordin interfaceAppClientContainer.Builder- Returns:
-
getSendPassword
public boolean getSendPassword()
- Specified by:
getSendPasswordin interfaceAppClientContainer.Builder
-
getTargetServers
public org.glassfish.appclient.client.acc.config.TargetServer[] getTargetServers()
- Specified by:
getTargetServersin interfaceAppClientContainer.Builder
-
-