Package org.wso2.carbon.bam.common.clients

Examples of org.wso2.carbon.bam.common.clients.BAMConfigurationDSClient


        }
    }

    public OperationDO getOperation(int serviceID, String operationName) throws BAMException {

        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            OperationDO operation = client.getOperation(serviceID, operationName);

            if (operation == null) {
                operation = new OperationDO();
                operation.setName(operationName);
                operation.setServiceID(serviceID);

                client.addOperation(operation);
                operation = client.getOperation(serviceID, operationName);
            }

            if (operation != null) {
                BAMConfigurationCache.addOperation(operation);
            }

            return operation;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }

    }
View Full Code Here


    }

    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);
            }
            BAMConfigurationCache.addOperation(operation);
            return operation;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
    }
View Full Code Here

            }
        }
    }

    public List<MediationDataDO> getEndpoints(int serverId) throws BAMException {
        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            MediationDataDO[] endpoints = client.getEndpoints(serverId);
            List<MediationDataDO> endpointList = new ArrayList<MediationDataDO>(endpoints.length);
            endpointList.addAll(Arrays.asList(endpoints));
            return endpointList;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
    }
View Full Code Here

            }
        }
    }

    public List<MediationDataDO> getSequences(int serverId) throws BAMException {
        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            MediationDataDO[] sequences = client.getSequences(serverId);
            List<MediationDataDO> sequenceList = new ArrayList<MediationDataDO>(sequences.length);
            sequenceList.addAll(Arrays.asList(sequences));
            return sequenceList;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
    }
View Full Code Here

            }
        }
    }

    public List<MediationDataDO> getProxyServices(int serverId) throws BAMException {
        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            MediationDataDO[] proxySvcs = client.getProxyServices(serverId);
            List<MediationDataDO> proxyList = new ArrayList<MediationDataDO>(proxySvcs.length);
            proxyList.addAll(Arrays.asList(proxySvcs));
            return proxyList;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
    }
View Full Code Here

    /*
      * Add activity
      */

    public void addActivity(ActivityDO activity) throws BAMException {
        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            client.addActivity(activity);
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }

    }
View Full Code Here

    * Get activity using activitykeyID(primary key)
    */

    public ActivityDO getActivity(int activityKeyId) throws BAMException {
        ActivityDO activity = BAMConfigurationCache.getActivity(activityKeyId);
        BAMConfigurationDSClient client = null;
        try {
            if (activity == null) {
                client = BAMUtil.getBAMConfigurationDSClient();
                activity = client.getActivity(activityKeyId);
            }
            BAMConfigurationCache.addActivity(activityKeyId, activity);
            return activity;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
    }
View Full Code Here

    */

    public List<ActivityDO> getAllActivities() throws BAMException {
        List<ActivityDO> activities = BAMConfigurationCache.getAllActivities();

        BAMConfigurationDSClient client = null;
        try {
            if (activities == null || activities.size() <= 0) {
                client = BAMUtil.getBAMConfigurationDSClient();
                ActivityDO[] activitiesArray = client.getAllActivities();

                if (activitiesArray != null) {
                    activities = new ArrayList<ActivityDO>(activitiesArray.length);
                    activities.addAll(Arrays.asList(activitiesArray));
                }
            }
            for (ActivityDO activity : activities) {
                BAMConfigurationCache.addActivity(activity.getActivityKeyId(), activity);
            }
            return activities;
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }

    }
View Full Code Here

    }

    public List<PropertyFilterDO> getAllXPathConfigurations(int serverID) throws BAMException {
        List<PropertyFilterDO> xpathConfigs = BAMConfigurationCache.getAllXPathConfigurations(serverID);

        BAMConfigurationDSClient client = null;
        try {
            if (xpathConfigs == null || xpathConfigs.size() <= 0) {
                client = BAMUtil.getBAMConfigurationDSClient();
                PropertyFilterDO[] xpathConfigsArray = client.getAllXpathData(serverID);

                if (xpathConfigsArray != null) {
                    xpathConfigs = new ArrayList<PropertyFilterDO>(xpathConfigsArray.length);
                    xpathConfigs.addAll(Arrays.asList(xpathConfigsArray));
                }
            }
/*            for (PropertyFilterDO xpathConfig : xpathConfigs) {
                BAMConfigurationCache.addXpathConfig(xpathConfig);
            }*/
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }

        return xpathConfigs;
    }
View Full Code Here

    }

    public List<NamespaceDO> getAllNamespaces(int xpathId) throws BAMException {
        List<NamespaceDO> nsList = BAMConfigurationCache.getAllNamespaces(xpathId);

        BAMConfigurationDSClient client = null;
        try {
            if (nsList == null || nsList.size() <= 0) {
                client = BAMUtil.getBAMConfigurationDSClient();
                NamespaceDO[] nsArray = client.getAllNamespaceData(xpathId);

                if (nsArray != null) {
                    nsList = new ArrayList<NamespaceDO>(nsArray.length);
                    nsList.addAll(Arrays.asList(nsArray));
                }
            }
/*            for (NamespaceDO ns : nsArray) {
                BAMConfigurationCache.addXpathConfig(ns);
            }*/
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }

        return nsList;

View Full Code Here

TOP

Related Classes of org.wso2.carbon.bam.common.clients.BAMConfigurationDSClient

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.