Package org.wso2.carbon.base

Examples of org.wso2.carbon.base.ServerConfiguration


        Security.addProvider(new BouncyCastleProvider());
    }

    public static CryptoUtil getDefaultCryptoUtil(){
        if(instance == null){
            ServerConfiguration config = ServerConfiguration.getInstance();
            String alias = config.getFirstProperty("Security.KeyStore.KeyAlias");
            String pkPassword = config.getFirstProperty( "Security.KeyStore.KeyPassword");
            instance = new CryptoUtil(alias,pkPassword);
        }
        return instance;
    }
View Full Code Here


            multitenantServerManager = new MultitenantServerManager();
            multitenantServerManager.start();

            //TODO As a tempory solution this part is added here. But when ui bundle are seperated from the core bundles
            //TODO this should be fixed.
            ServerConfiguration config = ServerConfiguration.getInstance();
            String type = config.getFirstProperty("Security.TrustStore.Type");
            String password = config.getFirstProperty("Security.TrustStore.Password");
            String storeFile = new File(config.getFirstProperty("Security.TrustStore.Location")).getAbsolutePath();

            System.setProperty("javax.net.ssl.trustStore", storeFile);
            System.setProperty("javax.net.ssl.trustStoreType", type);
            System.setProperty("javax.net.ssl.trustStorePassword", password);
View Full Code Here

        this.bundleContext = context;

        ConfigurationContext configContext =
                getConfigurationContextService().getClientConfigContext();

        ServerConfiguration serverConfig = getServerConfiguration();

        CarbonUIDefinitions carbonUIDefinitions = new CarbonUIDefinitions();
        context.registerService(CarbonUIDefinitions.class.getName(), carbonUIDefinitions, null);

        // create a CustomUIDefinitions object and set it as a osgi service. UIBundleDeployer can access this
View Full Code Here

public class MultitenantUtils {

    private static final Log log = LogFactory.getLog(MultitenantUtils.class);

    public static String getTenantAwareUsername(String username) {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        String value = serverConfig.getFirstProperty(CarbonConstants.USERNAME_STYLE);
        if (!CarbonConstants.USERNAME_STYLE_VALUE_EMAIL.equals(value)) {
            if (username.contains("@")) {
                username = username.substring(0, username.lastIndexOf("@"));
            }
        } else {
View Full Code Here

    public static String getTenantDomain(String username) {
        String tenantDomain = null;
        if (username.contains("@")) {
            tenantDomain = username.substring(username.lastIndexOf("@") + 1);
            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            String superTenantDomain =
                    serverConfig.getFirstProperty(MultitenantConstants.SUPER_TENANT_DOMAIN);
            String userNameStyle =
                    serverConfig.getFirstProperty(CarbonConstants.USERNAME_STYLE);

            if (superTenantDomain != null && superTenantDomain.equals(tenantDomain)
                    && CarbonConstants.USERNAME_STYLE_VALUE_EMAIL.equals(userNameStyle)) {
                tenantDomain = null; // no domain for super tenant
            }
View Full Code Here

        }
        return domain;
    }

    private static String getHostName() {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        if (serverConfig.getFirstProperty("HostName") != null) {
            return serverConfig.getFirstProperty("HostName");
        } else {
            return "localhost";
        }
    }
View Full Code Here

* This service returns the product version
*/
public class Version {

    public String getVersion() throws Exception {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        return serverConfig.getFirstProperty("Name") + "-" +
               serverConfig.getFirstProperty("Version") ;
    }
View Full Code Here

        }
    }

    private static void setHostName(AxisConfiguration axisConfig) throws DeploymentException {
        try {
            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            String hostName = serverConfig.getFirstProperty("HostName");
            if (hostName != null) {
                Parameter param = ParameterUtil.createParameter(HOST_ADDRESS, hostName);
                axisConfig.addParameter(param);
            }
        } catch (AxisFault axisFault) {
View Full Code Here

            List<String> customRoles = capm.readServerRoles(ServerRoleConstants.CUSTOM_ROLES_ID);
            roles.addAll(customRoles);
            serverRoles = roles.toArray(new String[roles.size()]);
        } else {
            // now try to read from carbon.xml
            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            serverRoles = serverConfig.getProperties(AppDeployerConstants.CARBON_SERVER_ROLE);
        }
        return serverRoles;
    }
View Full Code Here

            this.remoteRegistryChroot = remoteRegistryChroot;
        }
    }

    public String toString() {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        return "JVM Name='" + javaRuntimeName + '\'' +
               ", JVM Version='" + javaVMVersion + '\'' +
               ", JVM Vendor='" + javaVMVendor + '\'' +
               ", Java Home='" + javaHome + '\'' +
               ", OS Name='" + osName + '\'' +
               ", OS Version='" + osVersion + '\'' +
               ", user.home='" + userHome + '\'' +
               ", user.timezone='" + userTimezone + '\'' +
               ", username='" + userName + '\'' +
               ", user.country='" + userCountry + '\'' +
               ", Axis2 Location='" + axis2Location + '\'' +
               ", Server Name='" + serverName + '\'' +
               ", Repository Location='" + repoLocation + '\'' +
               ", " + serverConfig.getFirstProperty("Name") + " version ='" +
               serverConfig.getFirstProperty("Version") + '\'' ;
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.base.ServerConfiguration

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.