Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.SecureAdmin


            if (secureAdmin_w == null) {

                /*
                 * Create the secure admin node if it is not already there.
                 */
                SecureAdmin secureAdmin = d.getSecureAdmin();
                if (secureAdmin == null) {
                    secureAdmin_w = writableDomain().createChild(SecureAdmin.class);
                    writableDomain().setSecureAdmin(secureAdmin_w);
                } else {
                    /*
 
View Full Code Here


                this.newEnabledState = newEnabledState;
            }

            @Override
            public boolean run(final TopLevelContext context) throws TransactionFailure {
                final SecureAdmin secureAdmin_w = context.writableSecureAdmin();
                updateSecureAdminEnabledSetting(
                        secureAdmin_w, newEnabledState);
                /*
                 * The subclass might have overridden updateSecureAdminSettings.
                 * Give it a change to run logic specific to enable or disable.
View Full Code Here

      if (! ("localhost".equals(host) || "0.0.0.0".equals(host))){
                restURL = restURL.replace("localhost", adminListener.getAddress());
            }

            //If secure admin is enabled, we need to ensure using https
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            if (restURL.startsWith("http:") && (SecureAdmin.Util.isEnabled(secureAdmin))) {
                restURL = restURL.replace("http:", "https:");
            }
        }
    }
View Full Code Here

        if (client == null) {
            client = getJerseyClient();
        }
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);
            client.property(ClientProperties.SSL_CONFIG, new SslConfig(new BasicHostnameVerifier(),
                                                                                          habitat.<SSLUtils>getService(SSLUtils.class).getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null)));
            client.register(CsrfProtectionFilter.class);

        } catch (Exception ex) {
View Full Code Here

    //******************************************************************************************************************

    public static ClientBuilder initialize(ClientBuilder clientBuilder) {
        try {
            ServiceLocator habitat = SecurityServicesUtil.getInstance().getHabitat();
            SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);

            final SSLContext sslContext = habitat
                    .<SSLUtils>getService(SSLUtils.class)
                    .getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), null);

View Full Code Here

         * abstracted into HttpConnectorAddress.
         */
        @Override
        public HttpURLConnection getHttpURLConnection(URL url) throws IOException {
            final Domain domain = habitat.getComponent(Domain.class);
            SecureAdmin secureAdmin = domain.getSecureAdmin();
            final String certAlias = SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin) ? null : SecureAdmin.Util.DASAlias(secureAdmin);
            HttpConnectorAddress httpConnectorAddress = new HttpConnectorAddress(habitat.getComponent(SSLUtils.class).getAdminSocketFactory(certAlias, "TLS"));
            AuthenticationInfo authenticationInfo = authenticationInfo(habitat, secureAdmin);
            if (authenticationInfo != null) {
                httpConnectorAddress.setAuthenticationInfo(authenticationInfo);
View Full Code Here

         * abstracted into HttpConnectorAddress.
         */
        @Override
        public HttpURLConnection getHttpURLConnection(URL url) throws IOException {
            final Domain domain = habitat.getComponent(Domain.class);
            SecureAdmin secureAdmin = domain.getSecureAdmin();
            final String certAlias = SecureAdmin.Util.isUsingUsernamePasswordAuth(secureAdmin) ? null : SecureAdmin.Util.DASAlias(secureAdmin);
            HttpConnectorAddress httpConnectorAddress = new HttpConnectorAddress(habitat.getComponent(SSLUtils.class).getAdminSocketFactory(certAlias, "TLS"));
            AuthenticationInfo authenticationInfo = authenticationInfo(habitat, secureAdmin);
            if (authenticationInfo != null) {
                httpConnectorAddress.setAuthenticationInfo(authenticationInfo);
View Full Code Here

    /**
     * Use SSL to authenticate
     */
    private Client addAuthenticationInfo(Client client, Server server, ServiceLocator habitat) {
        SecureAdmin secureAdmin = habitat.getService(SecureAdmin.class);

        // TODO need to get hardcoded "TLS" from corresponding ServerRemoteAdminCommand constant);
        final SSLContext sslContext = habitat
                .<SSLUtils>getService(SSLUtils.class)
                .getAdminSSLContext(SecureAdmin.Util.DASAlias(secureAdmin), "TLS");
View Full Code Here

            if (secureAdmin_w == null) {

                /*
                 * Create the secure admin node if it is not already there.
                 */
                SecureAdmin secureAdmin = d.getSecureAdmin();
                if (secureAdmin == null) {
                    secureAdmin_w = writableDomain().createChild(SecureAdmin.class);
                    writableDomain().setSecureAdmin(secureAdmin_w);
                } else {
                    /*
 
View Full Code Here

                this.newEnabledState = newEnabledState;
            }

            @Override
            public boolean run(final TopLevelContext context) throws TransactionFailure {
                final SecureAdmin secureAdmin_w = context.writableSecureAdmin();
                updateSecureAdminEnabledSetting(
                        secureAdmin_w, newEnabledState);
                /*
                 * The subclass might have overridden updateSecureAdminSettings.
                 * Give it a change to run logic specific to enable or disable.
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.SecureAdmin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.