Examples of PEFileLayout


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

    protected void handleDerby(final RepositoryConfig config) throws RepositoryException {
        final String DL = "derby.log"; // this is the file that derby creates its log in.
        final File derbyLog = new File(DL);
        try {
            final PEFileLayout layout = getFileLayout(config);
            final File derbySqlFile = layout.getDerbyEjbTimerSqlFile();
            final String tableStatement = formatSqlStatement(derbySqlFile);
            final String dbDir = layout.getDerbyEjbTimerDatabaseDirectory().getAbsolutePath();
            createEjbTimerDatabaseTable(tableStatement, dbDir);
        } catch (final Exception ae) {
            final String c = readDerbyLogFile(derbyLog);
            throw new RepositoryException(_strMgr.getString("derbyEjbTimerDBNotCreated", c), ae);
        } finally {
View Full Code Here

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

   
    protected synchronized ConfigContext getConfigContext(RepositoryConfig config)
        throws ConfigException
    {
        if (_configContext == null) {
            final PEFileLayout layout = getFileLayout(config);
            _configContext = ConfigFactory.createConfigContext(
                layout.getDomainConfigFile().getAbsolutePath());
        }
        return _configContext;
    }
View Full Code Here

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

     * @throws RepositoryException
     */
    void deleteJMSProviderInstance(RepositoryConfig config)
        throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final String repositoryName = config.getRepositoryName();
        try
        {
            final JMSAdmin jmsAdmin = IASJmsUtil.getJMSAdminFactory().
                                                    getJMSAdmin();
            final ConfigContext ctx = getConfigContext(config);
            final Server[] servers = getServers(ctx);
            for (int i = 0; i < servers.length; i++)
            {
                final String mqInstanceName = IASJmsUtil.getBrokerInstanceName(
                    repositoryName,
                    servers[i].getName(),
                    getJmsService(servers[i], ctx));
                final String javaHome = getJavaHome(servers[i], ctx);

                try
                {
            String iMQBin = System.getProperty(
                                  SystemPropertyConstants.IMQ_BIN_PROPERTY,
                      layout.getImqBinDir().getAbsolutePath());
            String iMQInstances = layout.getRepositoryDir() + File.separator +
                                  IASJmsUtil.MQ_DIR_NAME;
            String[] optArgs = new String[4];

            optArgs[0] = "-javahome";
            optArgs[1] = javaHome;
View Full Code Here

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

     @throws CommandExcpetion if error finding version
     **/
    private boolean checkIfVersion80(String domainName, String domainDir,
                                     String installDir) throws CommandException
    {
        final PEFileLayout layout = new PEFileLayout(config);
        final File domainFile = layout.getDomainConfigFile();

        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

        factory.setNamespaceAware(true);

View Full Code Here

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

         the possible changes to domain.xml (from invocation of asadmin start-domain to
         invocation of launcher) are done. The following call to create the
         config context "caches" the config context and hence the config context
         is not recreated. It is important to preserve that call.
        */
        final String xmlPath = new PEFileLayout(config).
            getDomainConfigFile().getAbsolutePath();
        this.cc = ConfigFactory.
            createConfigContext(xmlPath);

       
View Full Code Here

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

     * startserv & stopserv scripts.    
     * @param domainConfig
     */
    public static TokenValueSet getTokenValueSet(DomainConfig domainConfig)
    {
        final PEFileLayout layout = new PEFileLayout(domainConfig);

        final TokenValueSet tokens = new TokenValueSet();

        final String configRootDir = domainConfig.getConfigRoot();           
        TokenValue tv = new TokenValue(CONFIG_HOME, configRootDir);
        tokens.add(tv);

        final String instanceRoot =
            layout.getRepositoryDir().getAbsolutePath();
        tv = new TokenValue(INSTANCE_ROOT, instanceRoot);
        tokens.add(tv);

        final String instanceName = (String)domainConfig.get(DomainConfig.K_SERVERID);
        if((instanceName == null) || (instanceName.equals("")))
View Full Code Here

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

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

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

     */
    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[] keytoolCmd = {               
            "-genkey",
            "-keyalg", "RSA",
            "-keystore", keystore.getAbsolutePath(),
View Full Code Here

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

   
    protected void addToAsadminTrustStore(
        RepositoryConfig config, File certFile) throws RepositoryException
    {       
        boolean newTruststore = false;
        final PEFileLayout layout = getFileLayout(config);                 
        //import the newly created certificate into the asadmin truststore
        final File asadminTruststore = AsadminTruststore.getAsadminTruststore();       
       
        if (!asadminTruststore.exists()) {
            newTruststore = true;
        }       
     
        //The keystore alias name is the repository name. We want to avoid alias
        //name conflicts since multiple domains are likely to live on the same
        //machine.
        String aliasName = layout.getRepositoryDir().getAbsolutePath();
       
        //first delete the alias in case it already exists. This can happen for
        //example if a domain is created, deleted, and re-created again.
        String[] keytoolCmd;
        KeytoolExecutor p;
View Full Code Here

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();
        File certFile = null;
       
        try {
            FileUtils.copy(src, truststore);
        } catch (IOException ioe) {
            throw new RepositoryException(
                _strMgr.getString("trustStoreNotCreated", truststore), ioe);
        }
               
        try {
            String[] input = {masterPassword};
            String[] keytoolCmd = null;
            KeytoolExecutor p = null;
           
            changeKeystorePassword(DEFAULT_MASTER_PASSWORD, masterPassword, truststore);
           
            //export the newly created certificate from the keystore
            certFile = new File(layout.getConfigRoot(), CERTIFICATE_ALIAS + ".cer");           
            keytoolCmd = new String[] {               
                "-export",
                "-keystore", layout.getKeyStore().getAbsolutePath(),               
                "-alias", CERTIFICATE_ALIAS,
                "-file", certFile.getAbsolutePath(),               
            };                       
           
            p = new KeytoolExecutor(keytoolCmd, 30, input);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.