Examples of OperationDO


Examples of org.wso2.carbon.bam.common.dataobjects.service.OperationDO

        }

    }

    public OperationDO getOperation(int operationID) throws BAMException {
        OperationDO operation = BAMConfigurationCache.getOperation(operationID);
        BAMConfigurationDSClient client = null;
        try {
            if (operation == null) {
                client = BAMUtil.getBAMConfigurationDSClient();
                operation = client.getOperation(operationID);
View Full Code Here

Examples of org.wso2.carbon.bam.common.dataobjects.service.OperationDO

        return serviceDO;

    }

    public static OperationDO convertOperationToOperationDO(Operation operation) {
        OperationDO operationDO = new OperationDO();
        operationDO.setDescription(operation.getOperationDesc());
        operationDO.setOperationID(Integer.parseInt(operation.getOperationID()));
        operationDO.setName(operation.getOperationName());
        operationDO.setServiceID(Integer.parseInt(operation.getServiceID()));

        return operationDO;

    }
View Full Code Here

Examples of org.wso2.carbon.bam.common.dataobjects.service.OperationDO

        setServer(server);
    }

    public StatisticsDO pullData(Object ctx) throws BAMException, RemoteException {
       BAMPersistenceManager persistenceManager = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry());
        OperationDO tmpOp = (OperationDO) ctx;
        String sessionCookie = ClientAuthHandler.getClientAuthHandler().getSessionString(getServer());
        StatisticsAdminClient client = new StatisticsAdminClient(getServer().getServerURL(), sessionCookie);
        ServiceDO svc = persistenceManager.getService(tmpOp.getServiceID());
        OperationStatistics opStatistics = client.getOperationStatistics(svc.getName(), tmpOp.getName());
        OperationStatisticsDO statisticsDO = new OperationStatisticsDO();
        statisticsDO.setServiceID(tmpOp.getServiceID());
        statisticsDO.setOperationName(tmpOp.getName());
        //This should set op.id if the service is already in DB
        OperationDO op = null;
        int operationId = statisticsDO.getOperationID();
        if(operationId >0){
           op = persistenceManager.getOperation(operationId);
        }else {
          op = persistenceManager.getOperation(statisticsDO.getServiceID() ,statisticsDO.getOperationName());
        }

        //if it is not, add it to DB
        if (op == null) {
            BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry()).addOperation(tmpOp);
        }
        //now that the op is added, op.id should definitely be set
        if (op != null) {
            statisticsDO.setOperationID(op.getOperationID());
        }

        //TODO Where should we set the timestamp?
        statisticsDO.setTimestamp(Calendar.getInstance());
        populateOperationStatisticsDO(statisticsDO, opStatistics);
View Full Code Here

Examples of org.wso2.carbon.bam.common.dataobjects.service.OperationDO

    public OperationDO[] getOperationList(int serviceId) throws BAMException {
        List<OperationDO> ops = persistenceManager.getAllOperations(serviceId);
        List<OperationDO> opList = new ArrayList<OperationDO>();
        if (ops != null) {
            for (OperationDO op : ops) {
                OperationDO dto = new OperationDO();
                dto.setOperationID(op.getOperationID());
                dto.setName(op.getName());
                opList.add(dto);
            }
        }
        return opList.toArray(new OperationDO[opList.size()]);
    }
View Full Code Here

Examples of org.wso2.carbon.bam.common.dataobjects.service.OperationDO

    serverMap.put(server.getServerURL(),server);
  }


  public static OperationDO getOperation(int serviceId,String operationName) {
    OperationDO operation = operationMap.get(String.valueOf(serviceId)+"_"+operationName);
    return operation;
  }
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.