Package org.wso2.carbon.base

Examples of org.wso2.carbon.base.ServerConfiguration


        Association[] tstedStores = registry.getAssociations(servicePath,
                SecurityConstants.ASSOCIATION_TRUSTED_KEYSTORE);

        if (pvtStores != null && pvtStores.length > 0) {
            String keyAlias = null;
            ServerConfiguration serverConfig = ServerConfiguration.getInstance();
            keyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias");
            cryptoProps.setProperty(ServerCrypto.PROP_ID_PRIVATE_STORE, privateKeyStore);
            cryptoProps.setProperty(ServerCrypto.PROP_ID_DEFAULT_ALIAS, keyAlias);
        }
        StringBuffer trustStores = new StringBuffer();
View Full Code Here


        addParameters(IdentityTenantUtil.getRegistry(null,null));

                 // Add the globally trusted relying party
        RelyingPartyDO rp = new RelyingPartyDO();

        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        if (serverConfig.getFirstProperty("HostName") != null) {
          rp.setHostName(serverConfig.getFirstProperty("HostName"));
          rp.setAlias(serverConfig.getFirstProperty("HostName"));
        } else {
          rp.setHostName("localhost");
          rp.setAlias("localhost");
        }

        rp.setAlias(serverConfig.getFirstProperty("Security.KeyStore.KeyAlias"));
        dbAdmin.createGloabllyTrustedRelyingParty(IdentityTenantUtil.getRegistry(null,null), rp);
      }
    } catch (Exception e) {
      throw new AxisFault(e.getMessage(), e);
    }
View Full Code Here

          count++;
        }

                if (isSuperTenant) {
                    KeyStoreData data = new KeyStoreData();
                    ServerConfiguration config = ServerConfiguration.getInstance();
                    String fileName = config
                            .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_FILE);
                    String type = config
                            .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_TYPE);
                    String name = KeyStoreUtil.getKeyStoreFileName(fileName);
                    data.setKeyStoreName(name);
                    data.setKeyStoreType(type);
                    data.setProvider(" ");
View Full Code Here

      String keyStoreType;
      String privateKeyPassowrd;
      if (KeyStoreUtil.isPrimaryStore(keyStoreName)) {
        KeyStoreManager keyMan = KeyStoreManager.getInstance((UserRegistry)registry);
        keyStore = keyMan.getPrimaryKeyStore();
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        keyStoreType = serverConfig
            .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIMARY_KEYSTORE_TYPE);
        privateKeyPassowrd = serverConfig
            .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIVATE_KEY_PASSWORD);
      } else {
        String path = SecurityConstants.KEY_STORES + "/" + keyStoreName;
        if (!registry.resourceExists(path)) {
          throw new SecurityConfigException("Key Store not found");
View Full Code Here

      for (int i = 0; i < keystores.length; i++) {
        if (KeyStoreUtil.isPrimaryStore(keystores[i].getKeyStoreName())) {
          KeyStoreManager keyMan = KeyStoreManager.getInstance((UserRegistry)registry);
          keyStore = keyMan.getPrimaryKeyStore();
          ServerConfiguration serverConfig = ServerConfiguration.getInstance();
          privateKeyPassowrd = serverConfig
              .getFirstProperty(RegistryResources.SecurityManagement.SERVER_PRIVATE_KEY_PASSWORD);
          return keyStore.getKey(alias, privateKeyPassowrd.toCharArray());
        }
      }
    } catch (Exception e) {
View Full Code Here

                                                                       SecurityConstants.ASSOCIATION_PRIVATE_KEYSTORE);

                Properties cryptoProps = new Properties();

                if (pvtStores != null && pvtStores.length > 0) {
                    ServerConfiguration serverConfig = ServerConfiguration.getInstance();
                    String pvtStore = serverConfig.getFirstProperty("Security.KeyStore.Location");
                    String keyAlias = null;
                    String name = null;                   
                    keyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias");
                    name = pvtStore.substring(pvtStore.lastIndexOf("/") + 1);
                    cryptoProps.setProperty(ServerCrypto.PROP_ID_PRIVATE_STORE, name);
                    cryptoProps.setProperty(ServerCrypto.PROP_ID_DEFAULT_ALIAS, keyAlias);
                    service.addParameter(RahasUtil.getSCTIssuerConfigParameter(ServerCrypto.class.getName(),
                            cryptoProps, -1, null, true, true));
View Full Code Here

     *
     * @return The command listener port
     */
    public static int getCommandListenerPort() {
        int serverPort = -1;
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        String port = serverConfig.getFirstProperty("Ports.CommandListener");
        if (port == null) {
            port = serverConfig.getFirstProperty("CommandListener.Port");
        }
        if (port != null) {
            serverPort = Integer.parseInt(port);
        }
        return serverPort;
View Full Code Here

        }
        return null;
    }

    public static boolean isRemoteRegistry() throws Exception {
        ServerConfiguration serverConfig = getServerConfiguration();
        String isRemoteRegistry =
                serverConfig.getFirstProperty("Registry.Type");
        return (isRemoteRegistry != null && isRemoteRegistry.equalsIgnoreCase("remote"));
    }
View Full Code Here

                serverConfig.getFirstProperty("Registry.Type");
        return (isRemoteRegistry != null && isRemoteRegistry.equalsIgnoreCase("remote"));
    }

    public static String getCarbonRepository() {
        ServerConfiguration serverConfig = getServerConfiguration();
        return serverConfig.getFirstProperty("Axis2Config.RepositoryLocation"); //TODO: Change to Carbon.Repository in carbon.xml
    }
View Full Code Here

        ServerConfiguration serverConfig = getServerConfiguration();
        return serverConfig.getFirstProperty("Axis2Config.RepositoryLocation"); //TODO: Change to Carbon.Repository in carbon.xml
    }

    public static ServerConfiguration getServerConfiguration() {
        ServerConfiguration serverConfig = ServerConfiguration.getInstance();
        if (!isServerConfigInitialized) {
            String serverXml = CarbonUtils.getServerXml();
            File carbonXML = new File(serverXml);
            InputStream inSXml = null;
            try {
                inSXml = new FileInputStream(carbonXML);
                serverConfig.init(inSXml);
                isServerConfigInitialized = true;
            } catch (Exception e) {
                log.error("Cannot read file " + serverXml, e);
            } finally {
                if (inSXml != null) {
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.