Package com.sun.faban.harness

Examples of com.sun.faban.harness.ConfigurationException


     */
    @Configure public void configure() throws ConfigurationException {
        logger.fine("Configuring oracle service ");
        myServers = ctx.getUniqueHosts();
        if(myServers == null){
            throw new ConfigurationException("Oracle DB hostname is not provided");
        }
        oracleHome = ctx.getProperty("serverHome");
        if(oracleHome != null && oracleHome.trim().length() > 0) {
            if (!oracleHome.endsWith(File.separator))
            oracleHome = oracleHome + File.separator;
        }else{
            throw new ConfigurationException("Oracle DB serverHome is not provided");
        }
        oracleSid = ctx.getProperty("serverId");
        if(oracleSid == null || oracleSid.trim().length() <= 0){
            throw new ConfigurationException("Oracle DB serverId is not provided");
        }
        startupConf = ctx.getProperty("startupConf"); // What is this used for?
        if(startupConf == null || startupConf.trim().length() <= 0){
            throw new ConfigurationException("Oracle DB startupConf is not provided");
        }
        String includeListners = ctx.getProperty("includes");
        if(includeListners != null && includeListners.trim().length() > 0){
            StringTokenizer st = new StringTokenizer(includeListners,"; ,\n");
            while(st.hasMoreTokens()){
                listners.add(st.nextToken());
            }
        }else{
            throw new ConfigurationException("Oracle DB includes property is not provided");
        }
        oracleBin = oracleHome + "bin" + File.separator;
        oracleStartCmd = oracleBin + "sqlplus /nolog <<EOT\nconnect " +
                " / as sysdba \nstartup pfile=" + startupConf + "\nexit\nEOT";
        oracleStopCmd = oracleBin + "sqlplus /nolog <<EOT\nconnect " +
View Full Code Here


     */
    @Configure public void configure() throws ConfigurationException {
        LinkedHashSet<String> serverSet = new LinkedHashSet<String>();
        List<String> toolArgs = ctx.getToolArgs();
        if(toolArgs == null){
            throw new ConfigurationException("MemcacheStats toolArgs is not provided");
        }
        List<NameValuePair<Integer>> myHostPorts =
                ctx.getServiceContext().getUniqueHostPorts();
        if(myHostPorts == null){
            throw new ConfigurationException("Memcached host:port is not provided");
        }
        for(NameValuePair<Integer> myHostPort : myHostPorts){
            if(myHostPort.value == null)
                myHostPort.value = 11211;
            serverSet.add(myHostPort.name +":"+myHostPort.value);
View Full Code Here

                String shortName = aliasName.substring(0, idx);
                String fullName = domainMap.get(shortName);
                if (fullName == null) {
                    domainMap.put(shortName, aliasName);
                } else if (!fullName.equals(aliasName)) {
                    throw new ConfigurationException(
                            "Duplicate host names with different domains: " +
                            fullName + " and " + aliasName);
                }
            }
View Full Code Here

    private byte[] getNetworkAddress(InetAddress ia, short prefixLen)
            throws ConfigurationException {
        byte[] byteAddress = ia.getAddress();
        short networkBytes = (short) (prefixLen / 8);
        if (networkBytes > byteAddress.length) {
            throw new ConfigurationException(
            "Netmask too long. Network address " + ia + " has " +
                    prefixLen + "bit netmask while having " +
                    byteAddress.length + "bytes in the address. " +
                    "The address is a " + ia.getClass().getName());
        }
View Full Code Here

     */
    @Configure public void config() throws ConfigurationException {
        toolName = ctx.getToolName();       
        String mysqlHome = ctx.getServiceProperty("serverHome");
        if(mysqlHome == null || mysqlHome.trim().length() <= 0) {
            throw new ConfigurationException("MySQL serverHome property is not provided");
        }
        String mysqlUser = ctx.getServiceProperty("user");
        if(mysqlUser == null || mysqlUser.trim().length() <= 0) {
            throw new ConfigurationException("MySQL user is not provided");
        }
        String mysqlPass = ctx.getServiceProperty("password");
        if(mysqlPass == null || mysqlPass.trim().length() <= 0) {
            throw new ConfigurationException("MySQL password is not provided");
        }

        if (mysqlHome.endsWith(File.separator))
            mysqlHome = mysqlHome.substring(0, mysqlHome.length() -
                                              File.separator.length());
View Full Code Here

     */
    @Configure public void configure() throws ConfigurationException {
        toolName = ctx.getToolName();       
        String oracleHome = ctx.getServiceProperty("serverHome");
        if(oracleHome == null || oracleHome.trim().length() <= 0) {
            throw new ConfigurationException("Oracle DB serverHome property is not provided");
        }
        String oracleSid = ctx.getServiceProperty("serverId");
        if(oracleSid == null || oracleSid.trim().length() <= 0){
            throw new ConfigurationException("Oracle DB serverId is not provided");
        }
        String oracleBin = oracleHome + "bin" + File.separator;
       
        // Prepare the environment
        String[] env = new String[4];
View Full Code Here

     */
    @Configure public void configure() throws ConfigurationException {
        logger.fine("Configuring mysql Started");
        myServers = ctx.getUniqueHosts();
        if(myServers == null){
            throw new ConfigurationException("MySQL hostname is not provided");
        }
        dbHome = ctx.getProperty("serverHome");
        if(dbHome != null && dbHome.trim().length() > 0) {
            if (!dbHome.endsWith(File.separator))
                dbHome = dbHome + File.separator;
        }else{
            throw new ConfigurationException("MySQL serverHome is not provided");
        }
        confFile = ctx.getProperty("confPath");
        if(confFile == null || confFile.trim().length() <= 0){
            logger.warning("confPath is not provided");
        }
View Full Code Here

     * Configures the LighttpdService.
     */
    @Configure public void configure() throws ConfigurationException {
        myServers = ctx.getUniqueHosts();
        if(myServers == null){
            throw new ConfigurationException("Lighttpd hostname is not provided");
        }
        lightyCmd = ctx.getProperty("cmdPath");
        if(lightyCmd != null && lightyCmd.trim().length() > 0) {
            lightyCmd = lightyCmd + " ";
        }else{
            throw new ConfigurationException("Lighttpd cmdPath is not provided");
        }
        String logsDir = ctx.getProperty("logsDir");
        if(logsDir != null && logsDir.trim().length() > 0) {
            if (!logsDir.endsWith(File.separator))
                logsDir = logsDir + File.separator;
        }else{
            throw new ConfigurationException("Lighttpd logsDir is not provided");
        }

        String confDir = ctx.getProperty("confDir");
        if(confDir != null && confDir.trim().length() > 0) {
            if (!confDir.endsWith(File.separator))
            confDir = confDir + File.separator;
        }else{
            throw new ConfigurationException("Lighttpd confDir is not provided");
        }

        String pidDir = ctx.getProperty("pidDir");
        if(pidDir != null && pidDir.trim().length() > 0) {
            if (!pidDir.endsWith(File.separator))
                pidDir = pidDir + File.separator;
        }else{
            throw new ConfigurationException("Lighttpd pidDir is not provided");
        }

        sessionDir = ctx.getProperty("sessionDir");
        if(sessionDir != null && sessionDir.trim().length() > 0) {
            if (sessionDir.endsWith(File.separator)) {
View Full Code Here

     */
    @Configure public void configure() throws ConfigurationException {
        logger.fine("Configuring memcached service ");
        myHostPorts = ctx.getUniqueHostPorts();
        if(myHostPorts == null){
            throw new ConfigurationException("Memcached host:port is not provided");
        }
        memcachedCmdPath = ctx.getProperty("cmdPath");
        if(memcachedCmdPath != null && memcachedCmdPath.trim().length() > 0) {
            memcachedCmdPath = memcachedCmdPath + " ";
        }else{
            throw new ConfigurationException("Memcached cmdPath is not provided");
        }
        memcachedMemSize = ctx.getProperty("serverMemSize");
        if(memcachedMemSize == null || memcachedMemSize.trim().length() <= 0){
            throw new ConfigurationException("Memcached serverMemSize is not provided");
        }
       
        memcachedStartCmd = memcachedCmdPath + " -u mysql -m " +
                memcachedMemSize;
        memcacheHandles = new CommandHandle[myHostPorts.size()];
View Full Code Here

TOP

Related Classes of com.sun.faban.harness.ConfigurationException

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.