Package com.cloud.hypervisor.vmware.util

Examples of com.cloud.hypervisor.vmware.util.VmwareContext.validate()


    @Override
    public VmwareContext getServiceContext(Command cmd) {
        VmwareContext context = null;
        if(s_serviceContext.get() != null) {
            context = s_serviceContext.get();
            if (context.validate()) {
                if (s_logger.isTraceEnabled()) {
                    s_logger.trace("ThreadLocal context is still valid, just reuse");
                }
                return context;
            } else {
View Full Code Here


        VmwareContext context = s_pool.getContext(vCenterAddress, vCenterUserName);
        if (context == null) {
            context = create(vCenterAddress, vCenterUserName, vCenterPassword);
        } else {
            // Validate current context and verify if vCenter session timeout value of the context matches the timeout value set by Admin
            if (!context.validate() || (context.getVimClient().getVcenterSessionTimeout() != s_vmwareMgr.getVcenterSessionTimeout())) {
                s_logger.info("Validation of the context failed, dispose and create a new one");
                context.close();
                context = create(vCenterAddress, vCenterUserName, vCenterPassword);
            }
        }
View Full Code Here

        try {
            _resource.ensureOutgoingRuleForAddress(vCenterAddress);

            VmwareContext context = currentContext.get();
            if (context != null) {
                if(!context.validate()) {
                    invalidateServiceContext(context);
                    context = null;
                } else {
                    context.registerStockObject("serviceconsole", cmd.getContextParam("serviceconsole"));
                    context.registerStockObject("manageportgroup", cmd.getContextParam("manageportgroup"));
View Full Code Here

    @Override
    public VmwareContext getServiceContext(Command cmd) {
        VmwareContext context = null;
        if(s_serviceContext.get() != null) {
            context = s_serviceContext.get();
            if (context.validate()) {
                return context;
            } else {
                s_logger.info("Validation of the context failed, dispose and use a new one");
                invalidateServiceContext(context);
            }
View Full Code Here

  public static VmwareContext getContext(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {
    VmwareContext context = s_pool.getContext(vCenterAddress, vCenterUserName);
    if(context == null) {
      context = create(vCenterAddress, vCenterUserName, vCenterPassword);
    } else {
      if(!context.validate()) {
        s_logger.info("Validation of the context faild. dispose and create a new one");
        context.close();
        context = create(vCenterAddress, vCenterUserName, vCenterPassword);
      }
    }
View Full Code Here

  public static VmwareContext getContext(String vCenterAddress, String vCenterUserName, String vCenterPassword) throws Exception {
    VmwareContext context = s_pool.getContext(vCenterAddress, vCenterUserName);
    if(context == null) {
      context = create(vCenterAddress, vCenterUserName, vCenterPassword);
    } else {
      if(!context.validate()) {
        s_logger.info("Validation of the context faild. dispose and create a new one");
        context.close();
        context = create(vCenterAddress, vCenterUserName, vCenterPassword);
      }
    }
View Full Code Here

        VmwareContext context = s_pool.getContext(vCenterAddress, vCenterUserName);
        if (context == null) {
            context = create(vCenterAddress, vCenterUserName, vCenterPassword);
        } else {
            // Validate current context and verify if vCenter session timeout value of the context matches the timeout value set by Admin
            if (!context.validate() || (context.getVimClient().getVcenterSessionTimeout() != s_vCenterSessionTimeout)) {
                s_logger.info("Validation of the context faild. dispose and create a new one");
                context.close();
                context = create(vCenterAddress, vCenterUserName, vCenterPassword);
            }
        }
View Full Code Here

    VmwareContext context = s_pool.getContext(vCenterAddress, vCenterUserName);
    if(context == null) {
      context = create(vCenterAddress, vCenterUserName, vCenterPassword);
    } else {
            // Validate current context and verify if vCenter session timeout value of the context matches the timeout value set by Admin
            if(!context.validate() || (context.getVimClient().getVcenterSessionTimeout() != s_vmwareMgr.getVcenterSessionTimeout())) {
                s_logger.info("Validation of the context failed. dispose and create a new one");
        context.close();
        context = create(vCenterAddress, vCenterUserName, vCenterPassword);
      }
    }
View Full Code Here

    @Override
    public VmwareContext getServiceContext(Command cmd) {
        VmwareContext context = null;
        if(s_serviceContext.get() != null) {
            context = s_serviceContext.get();
            if (context.validate()) {
                return context;
            } else {
                s_logger.info("Validation of the context failed, dispose and use a new one");
                invalidateServiceContext(context);
            }
View Full Code Here

        try {
            _resource.ensureOutgoingRuleForAddress(vCenterAddress);

        VmwareContext context = currentContext.get();
            if (context != null) {
                if(!context.validate()) {
                    invalidateServiceContext(context);
                    context = null;
                } else {
                    context.registerStockObject("serviceconsole", cmd.getContextParam("serviceconsole"));
                    context.registerStockObject("manageportgroup", cmd.getContextParam("manageportgroup"));
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.