Examples of PEFileLayout


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

    /**
     * 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

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

     * @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

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

     * @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

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

    public void validateAdminUserAndPassword(RepositoryConfig config,
        String user, String password) throws RepositoryException
    {
        try {      
            //Read in domain.xml. This will fail with a ConfigException if there is no domain.xml
            final PEFileLayout layout = getFileLayout(config);
            ConfigContext configContext = getConfigContext(config);
            //Fetch the name of the realm for the DAS system jmx connector
            String dasName = ServerHelper.getDAS(configContext).getName();           
            JmxConnector conn = ServerHelper.getServerSystemConnector(configContext,
                dasName);
            String realmName = conn.getAuthRealmName();
            SecurityService security = ServerHelper.getConfigForServer(configContext,
                dasName).getSecurityService();     
            //Load in the file realm
            //Before loading the realm, we must ensure that com.sun.aas.instanceRoot
            //is set correcty, since the keyfile is most likely referenced using this.
            //In addition java.security.auth.login.config must be setup.
            String oldRoot = System.getProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY);
            String oldConf = System.getProperty("java.security.auth.login.config");
            System.setProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY,
                layout.getRepositoryDir().getAbsolutePath());
            System.setProperty("java.security.auth.login.config",
                layout.getLoginConf().getAbsolutePath());
            RealmConfig.createRealms(realmName,
                new AuthRealm[] {security.getAuthRealmByName(realmName)});
            //Restore previous values just in case.
            if (oldRoot != null) {
                System.setProperty(SystemPropertyConstants.INSTANCE_ROOT_PROPERTY, oldRoot);
View Full Code Here

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

     * @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

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

     * @throws RepositoryException
     */   
    protected void changePasswordAliasKeystorePassword(RepositoryConfig config,
        String oldPassword, String newPassword) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File passwordAliases = layout.getPasswordAliasKeystore();
           
        //Change the password of the keystore alias file
        if (passwordAliases.exists()) {
            try {
                PasswordAdapter p = new PasswordAdapter(passwordAliases.getAbsolutePath(),
View Full Code Here

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

     * Create JBI instance.
     */
    protected void createJBIInstance(String instanceName,
        RepositoryConfig config) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        layout.createJBIDirectories();
        final TokenValueSet tvSet = new TokenValueSet();
        final String tvDelimiter = "@";
        final String tJbiInstanceName = "JBI_INSTANCE_NAME";
        final String tJbiInstanceRoot = "JBI_INSTANCE_ROOT";
        try {

            final TokenValue tvJbiInstanceName = new TokenValue(tJbiInstanceName,
                  instanceName, tvDelimiter);
            final TokenValue tvJbiInstanceRoot = new TokenValue(tJbiInstanceRoot,
                  layout.getRepositoryDir().getCanonicalPath(),tvDelimiter);
            tvSet.add(tvJbiInstanceName);
            tvSet.add(tvJbiInstanceRoot);
            final File src = layout.getJbiTemplateFile();
            final File dest = layout.getJbiRegistryFile();

            generateFromTemplate(tvSet, src, dest);
           
            final File httpConfigSrc = layout.getHttpBcConfigTemplate();
            final File httpConfigDest = layout.getHttpBcConfigFile();
            //tokens will be added in a follow-up integration
            final TokenValueSet httpTvSet = new TokenValueSet();           
            generateFromTemplate(httpTvSet, httpConfigSrc, httpConfigDest);
           
            createHttpBCInstallRoot(layout);
View Full Code Here

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

     * Create MQ instance.
     */
    protected void createMQInstance(
        RepositoryConfig config) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File broker = layout.getImqBrokerExecutable();
        final File mqVarHome = layout.getImqVarHome();
        try {
            mqVarHome.mkdirs();
            final List cmdInput = new ArrayList();
            cmdInput.add(broker.getAbsolutePath());
            cmdInput.add("-init");
View Full Code Here

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

     * Create the timer database wal file.
     */
    protected void createTimerWal(
        RepositoryConfig config) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
        final File src = layout.getTimerWalTemplate();
        final File dest = layout.getTimerWal();
        try {
            FileUtils.copy(src, dest);
        } catch (IOException ioe) {
            throw new RepositoryException(
                _strMgr.getString("timerWalNotCreated"), ioe);
View Full Code Here

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

     * Create the timer database dbn file.
     */
    protected void createTimerDbn(
        RepositoryConfig config) throws RepositoryException
    {
        final PEFileLayout layout = getFileLayout(config);
    final File src = layout.getTimerDbnTemplate();
        final File dest = layout.getTimerDbn();
        try {
            FileUtils.copy(src, dest);
        } catch (IOException ioe) {
            throw new RepositoryException(
                _strMgr.getString("timerDbnNotCreated"), ioe);
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.