Examples of BAMDataServiceAdmin


Examples of org.wso2.carbon.bam.core.admin.BAMDataServiceAdmin

    public static final String ELEMENT_NAME_OPERATION_NAME = "OperationName";
    public static final String ELEMENT_NAME_SERVICE_NAME = "ServiceName";

    public final void invokeBusinessLogic(MessageContext mc) throws AxisFault {

        BAMDataServiceAdmin dsAdmin = new BAMDataServiceAdmin();

        try {
            handleServerUserDefinedData(mc, dsAdmin);
            handleOperationUserDefinedData(mc, dsAdmin);
        } catch (BAMException e) {
View Full Code Here

Examples of org.wso2.carbon.bam.core.admin.BAMDataServiceAdmin

            running = true;
        }

        List<ServerDO> serverList = null;
        BAMPersistenceManager persistenceManager;
        BAMDataServiceAdmin statisticsAdmin = new BAMDataServiceAdmin();

        try {
             persistenceManager = BAMPersistenceManager.getPersistenceManager(BAMUtil.getRegistry());
            if (persistenceManager != null) {
                serverList = Arrays.asList(persistenceManager.getMonitoredServersByType(BAMConstants.SERVER_TYPE_PULL));
            } else {
                throw new BAMException("Can't initialize BAMPersistenceManager");
            }
        } catch (Exception e) {
            if (log.isErrorEnabled()) {
                log.error("Error occurred while retrieving the server list for polling data", e);
            }
            return;
        }

        if (serverList != null && serverList.size() > 0) {
            BackOffCounter backoffcounter = BackOffCounter.getInstance();
            for (ServerDO server : serverList) {

                boolean isServerUp = isServerUpAndRunning(server);

                try {
                      Boolean state = false;
                    if(server.getActive()){
                        state =true;
                    }

                    if (state && !(backoffcounter.shouldBackoff(server))&& isServerUp) {

                        DataPuller  svrDataPuller = DataPullerFactory.getDataPuller(server, DataPullerFactory.SERVER_STATISTICS_PULLER);
                        MonitoredServerServiceInfoAdmin serviceInfoAdmin = new MonitoredServerServiceInfoAdmin();
                        String[] serviceNames = serviceInfoAdmin.getServiceNames(server);
                        ServerStatisticsDO svrStatisticsDO = (ServerStatisticsDO) svrDataPuller.pullData(server);
                        statisticsAdmin.addServerStatistics(svrStatisticsDO);

                        if (serviceNames != null && serviceNames.length > 0) {

                            DataPuller dataPuller = DataPullerFactory.getDataPuller(server,DataPullerFactory.SERVICE_STATISTICS_PULLER);
                            for (String serviceName : serviceNames) {
                                ServiceStatisticsDO svcStatisticsDO = (ServiceStatisticsDO) dataPuller.pullData(serviceName);
                                if (svcStatisticsDO != null) {
                                    statisticsAdmin.addServiceStatistics(svcStatisticsDO);
                                }

                                ServiceDO svc = persistenceManager.getService(server.getId(), serviceName);
                                String[] operationNames = serviceInfoAdmin.getOperationNames(server, serviceName);

                                if (operationNames != null && operationNames.length > 0) {
                                    DataPuller opDataPuller = DataPullerFactory.getDataPuller(server,
                                            DataPullerFactory.OPERTION_STATISTICS_PULLER);

                                    for (String operationName : operationNames) {
                                        OperationDO operationDO = new OperationDO();
                                        operationDO.setName(operationName);
                                        operationDO.setServiceID(svc.getId());
                                        OperationStatisticsDO opStatisticsDO;
                                        opStatisticsDO = (OperationStatisticsDO) opDataPuller.pullData(operationDO);
                                        statisticsAdmin.addOperationStatistics(opStatisticsDO);
                                    }
                                }
                            }
                        }
                        // Successfully collected data from this server... hence no more backing off.
View Full Code Here

Examples of org.wso2.carbon.bam.core.admin.BAMDataServiceAdmin

    public static final String STATISTICS_DATA_ELEMENT_NAME_SERVICE_NAME = "ServiceName";
    public static final String STATISTICS_DATA_ELEMENT_NAME_OPERATION_NAME = "OperationName";

    public final void invokeBusinessLogic(MessageContext mc) throws AxisFault {

        BAMDataServiceAdmin dsAdmin = new BAMDataServiceAdmin();
        EventData[] eventData;
        try {
            eventData = getEventDataArray(mc.getEnvelope().getBody());
        } catch (BAMException e) {
            log.error("BAM Statistics MessageReceiver invokeBusinessLogic " +
View Full Code Here

Examples of org.wso2.carbon.bam.core.admin.BAMDataServiceAdmin

     * When first time message comes to a system, service, operation will be
     * added.(bam persistance manager will take care about it, if not add to DB
     */
    protected void invokeBusinessLogic(MessageContext messageContext) throws AxisFault {

        BAMDataServiceAdmin dsAdmin = new BAMDataServiceAdmin();
        SOAPBody body = messageContext.getEnvelope().getBody();
        Iterator itr = body.getChildren(); // Retrieving an empty body message
        if (itr.hasNext()) {
            QName aidEventQname = new QName(ActivityConstants.ACTIVITY_NS_URI, ActivityConstants.ACTIVITY_ELEMENT_EVENT);
            OMElement aidEventElement = messageContext.getEnvelope().getBody().getFirstChildWithName(aidEventQname);
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.