Package org.wso2.carbon.base

Examples of org.wso2.carbon.base.ServerConfiguration


     * @throws EventBrokerException, if creating the static subscription to BAM failed.
     */
    public static void createStaticEventSubscription() throws EventBrokerException {

        //Get BAM URL from carbon.xml
        ServerConfiguration serverConfiguration = getServerConfiguration();
        if (serverConfiguration == null) {
            throw new IllegalArgumentException("Invalid server configuration");
        }
        String serverURL = serverConfiguration.getFirstProperty(UsageAgentConstants.BAM_SERVER_URL);
        log.debug("Bam url = " + serverURL);

        //Add static subscription only if bam url is set
        if (serverURL != null) {
            String serviceURL = serverURL + UsageAgentConstants.BAM_SERVER_STAT_SERVICE;
View Full Code Here


    private void createClientConfigContext() throws EC2Exception {
        // we can not use the same synapse configuration context object here.
        // synapse configuration context uses its nhttp transport which can not
        // use with the axis2 client
        //TODO Use the clienSide ConfigContext from the OSGi service
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        String clientRepositoryLocation =
            serverConfig.getFirstProperty(CLIENT_REPOSITORY_LOCATION);
        String clientAxis2XmlLocation =
            serverConfig.getFirstProperty(CLIENT_AXIS2_XML_LOCATION);
        try {
            clientConfigContext =
                ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                    clientRepositoryLocation, clientAxis2XmlLocation);
        } catch (AxisFault e) {
View Full Code Here

        clientConfigContext.setProperty(ServerConstants.WORK_DIR,
                                        System.getProperty("axis2.work.dir"));
    }

    private void createEC2Client() throws EC2Exception {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        String instanceMgtWSEndpoint =
            serverConfig.getFirstProperty(INSTANCE_MGT_WS_ENDPOINT);

        instanceManager.setNonReplicapableProperty(getConfigCtx())// TODO FIXME: Why is this needed
        EC2Client ec2Client = new EC2Client(clientConfigContext, pEc2PrivateKey, pEc2Cert);
        if (instanceMgtWSEndpoint == null || instanceMgtWSEndpoint.length() == 0) {
            instanceManager.setEc2Client(ec2Client);
View Full Code Here


    public static Policy getDefaultRampartConfig() {

        //Extract the primary keystore information from server configuration
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        String keyStore = serverConfig.getFirstProperty("Security.KeyStore.Location");
        String keyStoreType = serverConfig.getFirstProperty("Security.KeyStore.Type");
        String keyStorePassword = serverConfig.getFirstProperty("Security.KeyStore.Password");
        String privateKeyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias");
        String privateKeyPassword = serverConfig.getFirstProperty("Security.KeyStore.KeyPassword");

        //Populate Rampart Configuration
        RampartConfig rampartConfig = new RampartConfig();
        rampartConfig.setUser(privateKeyAlias);
        //TODO use a registry based callback handler
View Full Code Here

            AxisConfiguration axisConfiguration = configContext.getAxisConfiguration();
            SuperTenantCarbonContext superTenantCarbonContext = SuperTenantCarbonContext.getCurrentContext(axisConfiguration);
            String tenantDomainName = superTenantCarbonContext.getTenantDomain();

            if (tenantDomainName == null) {
                ServerConfiguration serverConfiguration = this.serverConfiguration;
                String mediationServerURL = serverConfiguration.getFirstProperty(BAM_SERVER_URL);

                if (mediationServerURL != null) {
                    EventBroker eventBroker = PublisherUtils.getEventBroker();

                    Subscription subscription = new Subscription();
View Full Code Here

    public String getSSLPort(){
        return sslPort;
    }

    private int readPortOffset() {
        ServerConfiguration carbonConfig = QpidServiceDataHolder.getInstance().getCarbonConfiguration();
        String portOffset = carbonConfig.getFirstProperty(CARBON_CONFIG_PORT_OFFSET_NODE);

        try {
            return ((portOffset != null) ? Integer.parseInt(portOffset.trim()) : CARBON_DEFAULT_PORT_OFFSET);
        } catch (NumberFormatException e) {
            return CARBON_DEFAULT_PORT_OFFSET;
View Full Code Here

        * Read port from carbon.xml
        *
        * @return
        */
    private String readPortFromCarbonConfig() {
        ServerConfiguration carbonConfig = QpidServiceDataHolder.getInstance().getCarbonConfiguration();
        String port = carbonConfig.getFirstProperty(CARBON_CONFIG_QPID_PORT_NODE);

        return ((port != null) ? port.trim() : "");
    }
View Full Code Here

        * Read port from carbon.xml
        *
        * @return
        */
    private String readSSLPortFromCarbonConfig() {
        ServerConfiguration carbonConfig = QpidServiceDataHolder.getInstance().getCarbonConfiguration();
        String port = carbonConfig.getFirstProperty(CARBON_CONFIG_QPID_SSL_PORT_NODE);

        return ((port != null) ? port.trim() : "");
    }
View Full Code Here

                String requestUrl = uri;
                if (requestUri.indexOf("://") == -1) {
                    HttpInetConnection inetConn = (HttpInetConnection) conn;

                    String hostName = "localhost";
                    ServerConfiguration serverConfig = ServerConfiguration.getInstance();
                    if (serverConfig.getFirstProperty("HostName") != null) {
                        hostName = serverConfig.getFirstProperty("HostName");
                    }

                    requestUrl = "http://" +
                            hostName + ":" + inetConn.getLocalPort() + requestUri;
                }
View Full Code Here

        String value = System.getProperty(name);
        if (value != null) {
            return value;
        }

        ServerConfiguration serverConf = ServerConfiguration.getInstance();
        return serverConf.getFirstProperty(name);
    }
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.