Package org.apache.imperius.spl.core

Examples of org.apache.imperius.spl.core.InternalClient


        DataCollector dc = new JavaDataCollectorImpl();
        Actuator ac = new JavaActuatorImpl();
        _policyManager = new PolicyManagerImpl(dc, ac);

        // registering internal client
        InternalClient oInternalClientObj = new InternalClient(_policyManager);
        InternalClientFactory.registerInternalClient(oInternalClientObj);

    }
View Full Code Here


    Actuator ac = new CIMActuatorImpl(ch);

    _policyManager= new PolicyManagerImpl(dc,ac);
   
    _internalClient=new InternalClient(_policyManager);
    InternalClientFactory.registerInternalClient(_internalClient);

  }
View Full Code Here

    Expression _rhsExp = null;
    TypeInfo lType = null;

//    try
//    {
      InternalClient internalClientObj = null;
      // System.out.println("parameters List " + _paramList);
      if (_paramList.size() == 0)
      {
        logger
            .severe("number of parameters passed to a InvokePolicyAction should be 2 or more");
        throw new SPLException(Messages.getString(
            "SPL_NO_OF_ARGUMENTS_PASSED_ERROR_MSG", new Object[] {
                "2 or more", "0" }));
      }
      else
      {
        internalClientObj = InternalClientFactory.getInternalClient();
        _lhsExp = (Expression) _paramList.get(0);
        lType = _lhsExp.getType();
        if (lType.getType() != TypeConstants.stringType)
        {
          logger
              .severe("first Expression should be a string describing the name of the policy to invoke");
          throw new SPLException(
              Messages
                  .getString("SPL_INVOKE_POLICY_ACTION_EXCEPTION1_MSG"));
        }
        String policyName = (String) _lhsExp.evaluate();

        if (_paramList.size() > 1)
        {
          // get second parameter
          _rhsExp = (Expression) _paramList.get(1);
          Object rhsResult = _rhsExp.evaluate();
          if ((rhsResult instanceof java.util.List))
          {
            List instanceInfoList = (List) rhsResult;
            internalClientObj.invokePolicy(policyName,
                instanceInfoList, true);
          }
          else
          {
            Map instanceInfoMap = new HashMap();
            Expression tempExpr = null;
            Object keyObj = null;
            Object valueObj = null;
            if (((_paramList.size() - 1) % 2) == 0)
            {
              for (int i = 1; i < _paramList.size(); i++)
              {
                tempExpr = (Expression) _paramList.get(i);
                keyObj = tempExpr.evaluate();
                if (++i < _paramList.size())
                {
                  tempExpr = (Expression) _paramList.get(i);
                  valueObj = tempExpr.evaluate();
                }
                else
                {
                  logger
                      .severe("instance names and instances passed are not same");
                  throw new SPLException(
                      "instance names and instances passed are not same");
                }
                instanceInfoMap.put(keyObj, valueObj);
              }
              internalClientObj.invokePolicy(policyName,
                  instanceInfoMap);
            } else {
              throw new SPLException(
                  "number of parameters passed is insufficient to invoke the policy");
            }
          }
        } else {
          internalClientObj.invokePolicy(policyName, null, true);
        }
      }
      logger.exiting(sourceClass, Thread.currentThread().getName() + " "
          + "execute");
      return true;
View Full Code Here

    Actuator ac = new CIMClientSideActuatorImpl(a);
   
   
    _policyManager= new PolicyManagerImpl(dc,ac);
    _client=a;
    _internalClient=new InternalClient(_policyManager);
    InternalClientFactory.registerInternalClient(_internalClient);
   
    logger.exiting(sourceClass,Thread.currentThread().getName()+" "+"initialize");
   
   
View Full Code Here

TOP

Related Classes of org.apache.imperius.spl.core.InternalClient

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.