Package com.sun.enterprise.admin.servermgmt.pe

Examples of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout


        return x509DistinguishedName;  //must be of form "CN=..., OU=..."
    }

    protected PEFileLayout getFileLayout(RepositoryConfig config) {
        if (_fileLayout == null) {
            _fileLayout = new PEFileLayout(config);
        }
        return _fileLayout;
    }
View Full Code Here


        }
        catch (RepositoryException re) {
            String msg = _strMgr.getString("SomeProblemWithKeytool", re.getMessage());
            System.err.println(msg);
            try {
                PEFileLayout lo = getFileLayout(config);
                File src = lo.getKeyStoreTemplate();
                File dest = lo.getKeyStore();
                FileUtils.copy(src, dest); //keystore goes first
                src = lo.getTrustStoreTemplate();
                dest = lo.getTrustStore();
                FileUtils.copy(src, dest); //and then cacerts with CA-signed certs
            }
            catch (Exception e) {
                getLogger().log(Level.SEVERE, UNHANDLED_EXCEPTION, e);
            }
View Full Code Here

     * @throws RepositoryException
     */
    protected void createKeyStore(
            RepositoryConfig config, String masterPassword) throws RepositoryException {
        //Generate a new self signed certificate with s1as as the alias
        final PEFileLayout layout = getFileLayout(config);
        final File keystore = layout.getKeyStore();
        //Create the default self signed cert
        final String dasCertDN = getDASCertDN(config);
        System.out.println(_strMgr.getString("CertificateDN", dasCertDN));
        addSelfSignedCertToKeyStore(keystore, CERTIFICATE_ALIAS, masterPassword, dasCertDN);

View Full Code Here

     * @throws RepositoryException
     */
    protected void createTrustStore(
            RepositoryConfig config, String masterPassword) throws RepositoryException {
        //copy the default truststore from the installation template directory
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getTrustStoreTemplate();
        final File truststore = layout.getTrustStore();

        try {
            FileUtils.copy(src, truststore);
        }
        catch (IOException ioe) {
View Full Code Here

     */
    protected void changeS1ASAliasPassword(RepositoryConfig config,
            String storePassword, String oldKeyPassword, String newKeyPassword)
            throws RepositoryException {
        if (!storePassword.equals(oldKeyPassword) && !oldKeyPassword.equals(newKeyPassword)) {
            final PEFileLayout layout = getFileLayout(config);
            final File keystore = layout.getKeyStore();
            //First see if the alias exists. The user could have deleted it. Any failure in the
            //command indicates that the alias does not exist, so we return without error.
            String keyStoreType = System.getProperty("javax.net.ssl.keyStoreType");
            if (keyStoreType == null) {
                keyStoreType = KeyStore.getDefaultType();
View Full Code Here

     * @param oldKeyPassword
     * @param newKeyPassword
     */
    protected void changeSSLCertificateDatabasePassword(RepositoryConfig config,
            String oldPassword, String newPassword) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(config);
        File keystore = layout.getKeyStore();
        File truststore = layout.getTrustStore();

        if (keystore.exists()) {
            //Change the password on the keystore
            changeKeystorePassword(oldPassword, newPassword, keystore);
            //Change the s1as alias password in the keystore...The assumption
View Full Code Here

    /**
     * Sets the permissions for the domain directory, its config directory,
     * startserv/stopserv scripts etc.
     */
    protected void setPermissions(RepositoryConfig repositoryConfig) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(repositoryConfig);
        final File domainDir = layout.getRepositoryDir();
        try {
            chmod("-R 755", domainDir);
        }
        catch (Exception e) {
            throw new RepositoryException(
View Full Code Here

     * by default.
     *
     * @see PEFileLayout#ADMIN_KEY_FILE
     */
    protected void createAdminKeyFile(final RepositoryConfig config, final String user, final String clearPwd) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getKeyFileTemplate();
        final File dest = layout.getAdminKeyFile();
        try {
            FileUtils.copy(src, dest);
            modifyKeyFile(dest, user, clearPwd);
        }
        catch (final Exception e) {
View Full Code Here

    /**
     * Create the FileRealm kefile from the given user and password.
     */
    protected void createKeyFile(RepositoryConfig config, String user,
            String password) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getKeyFileTemplate();
        final File dest = layout.getKeyFile();
        try {
            FileUtils.copy(src, dest);
            /*
             * This keyfile is simply a copy of the template as by default at
             * the domain creation time, we do not add administrative user to
View Full Code Here

    /**
     * Create the default server.policy file.
     */
    protected void createServerPolicyFile(RepositoryConfig config) throws RepositoryException {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getPolicyFileTemplate();
        final File dest = layout.getPolicyFile();
        try {
            FileUtils.copy(src, dest);
        }
        catch (IOException ioe) {
            throw new RepositoryException(
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.servermgmt.pe.PEFileLayout

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.