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

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


     */
    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) {
            throw new RepositoryException(
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 src = layout.getTrustStoreTemplate();
            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 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(
                _strMgr.getString("setPermissionError"), e);
View Full Code Here

     * operations will be authenticated against this file realm 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) {
            throw new RepositoryException(_strMgr.getString("keyFileNotCreated"), 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 it. J2EE application users will be added to this file later.
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(
                _strMgr.getString("serverPolicyNotCreated"), ioe);
View Full Code Here

     * @throws RepositoryException
     */   
    public void validateMasterPassword(RepositoryConfig config,
        String password) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            // WBN July 2007
            // we are constructing this object ONLY to see if it throws
            // an Exception.  We do not use the object.
            new PasswordAdapter(passwordAliases.getAbsolutePath(),
View Full Code Here

     * @throws RepositoryException
     */   
    public String getClearPasswordForAlias(RepositoryConfig config,
        String password,String alias) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
                password.toCharArray());
            String clearPwd = p.getPasswordForAlias(alias);
            return clearPwd;
View Full Code Here

     * @throws RepositoryException
     */   
    protected void createPasswordAliasKeystore(RepositoryConfig config,
        String password) throws RepositoryException
    {       
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
        try {
            PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
                password.toCharArray());
            p.writeStore();
        } catch (Exception ex) {
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.