Search in sources :

Example 1 with Property

use of org.glassfish.appclient.client.acc.config.Property in project Payara by payara.

the class TargetServerHelper method selectEndpointsFromConfig.

private static List<TargetServer> selectEndpointsFromConfig(ClientContainer cc) {
    /*
         * Scan the property elements in the configuration for useful information.
         */
    /*
         * If the configuration specifies the "ssl" property then add a
         * child security element to each TargetServer created for the
         * target-server elements.
         */
    boolean isGlobalSSL = false;
    for (Property p : cc.getProperty()) {
        /*            if (p.getName().equals(GlassFishORBManager.IIOP_ENDPOINTS_PROPERTY)) {
                endpointPropertySetting = p.getValue();
             } else {
 */
        if (p.getName().equals(SSL_PROPERTY_NAME)) {
            isGlobalSSL = Boolean.parseBoolean(p.getValue());
        }
    // }
    }
    List<TargetServer> endpoints = new ArrayList<TargetServer>();
    /*
         * Start the target list with those specified in the configuration.
         */
    endpoints.addAll(cc.getTargetServer());
    /*
         * For all target servers assembled so far, if one does not have a
         * user-specified security child but the global SSL property was set
         * then add a security child.
         */
    for (TargetServer ts : endpoints) {
        /*
             * If the user selected SSL by setting that property in the
             * config then add a security child, because the AppClientContainer
             * expects each TargetServer object to declare its own
             * security needs explicitly.
             *
             * Note that if the user already defined a security element for the
             * target server we don't override it.
             */
        if (isGlobalSSL && ts.getSecurity() == null) {
            Security sec = new Security();
            ts.setSecurity(sec);
        }
    }
    return endpoints;
}
Also used : ArrayList(java.util.ArrayList) TargetServer(org.glassfish.appclient.client.acc.config.TargetServer) Security(org.glassfish.appclient.client.acc.config.Security) Property(org.glassfish.appclient.client.acc.config.Property)

Example 2 with Property

use of org.glassfish.appclient.client.acc.config.Property in project Payara by payara.

the class AppClientFacade method createBuilder.

private static Builder createBuilder(final TargetServer[] targetServers, final ClientContainer clientContainer, final AppclientCommandArguments appClientCommandArgs) throws IOException {
    Builder builder = AppClientContainer.newBuilder(targetServers);
    /*
         * Augment the builder with settings from the app client options that
         * can affect the builder itself.  (This is distinct from options
         * that affect what client to launch which are handled in creating
         * the ACC itself.
         */
    updateClientCredentials(builder, appClientCommandArgs);
    final List<MessageSecurityConfig> msc = clientContainer.getMessageSecurityConfig();
    if (msc != null) {
        builder.getMessageSecurityConfig().addAll(clientContainer.getMessageSecurityConfig());
    }
    builder.logger(new ACCLogger(clientContainer.getLogService()));
    final AuthRealm ar = clientContainer.getAuthRealm();
    if (ar != null) {
        builder.authRealm(ar.getClassname());
    }
    final List<Property> p = clientContainer.getProperty();
    if (p != null) {
        builder.containerProperties(p);
    }
    return builder;
}
Also used : AuthRealm(org.glassfish.appclient.client.acc.config.AuthRealm) Builder(org.glassfish.appclient.client.acc.AppClientContainer.Builder) MessageSecurityConfig(org.glassfish.appclient.client.acc.config.MessageSecurityConfig) ACCLogger(org.glassfish.appclient.client.acc.ACCLogger) Property(org.glassfish.appclient.client.acc.config.Property)

Aggregations

Property (org.glassfish.appclient.client.acc.config.Property)2 ArrayList (java.util.ArrayList)1 ACCLogger (org.glassfish.appclient.client.acc.ACCLogger)1 Builder (org.glassfish.appclient.client.acc.AppClientContainer.Builder)1 AuthRealm (org.glassfish.appclient.client.acc.config.AuthRealm)1 MessageSecurityConfig (org.glassfish.appclient.client.acc.config.MessageSecurityConfig)1 Security (org.glassfish.appclient.client.acc.config.Security)1 TargetServer (org.glassfish.appclient.client.acc.config.TargetServer)1