Examples of ServiceFilter


Examples of com.microsoft.windowsazure.core.pipeline.jersey.ServiceFilter

            throws ServiceException {
        // Arrange
        final List<ServiceRequestContext> requests = new ArrayList<ServiceRequestContext>();
        final List<ServiceResponseContext> responses = new ArrayList<ServiceResponseContext>();

        ServiceBusContract filtered = service.withFilter(new ServiceFilter() {
            @Override
            public ServiceResponseContext handle(ServiceRequestContext request,
                    Next next) throws Exception {
                requests.add(request);
                ServiceResponseContext response = next.handle(request);
View Full Code Here

Examples of org.wso2.carbon.governance.api.services.ServiceFilter

                referenceService = serviceManger.newService(referenceServiceElement);
            } else {
                referenceService = null;
            }
            //ListServiceFilter listServiceFilter = new ListServiceFilter(referenceService);
            ServiceFilter listServiceFilter = new ServiceFilter() {
                GovernanceArtifactFilter filter = new GovernanceArtifactFilter(referenceService);
                public boolean matches(Service service) throws GovernanceException {
                    return filter.matches(service);
                }
            };
View Full Code Here

Examples of org.wso2.carbon.governance.api.services.ServiceFilter

        Service service4 =  serviceManager.newService(new QName("http://baps.dadan.mug/jug", "doon"));
        service4.addAttribute("not-custom-attribute", "custom-value3");
        serviceManager.addService(service4);

        Service[] services = serviceManager.findServices(new ServiceFilter() {
            public boolean matches(Service service) throws GovernanceException {
                String attributeVal = service.getAttribute("custom-attribute");
                if (attributeVal != null && attributeVal.startsWith("custom-value")) {
                    return true;
                }
                return false;
            }
        });

        assertEquals(services.length, 2);
        assertTrue(services[0].getQName().equals(service.getQName()) ||
                services[0].getQName().equals(service2.getQName()));
        assertTrue(services[1].getQName().equals(service.getQName()) ||
                services[1].getQName().equals(service2.getQName()));

        // update the service2
        service2.setQName(new QName("http://bom.bom.com/baaaang", "bingo"));
        serviceManager.updateService(service2);

        newService = serviceManager.getService(service2.getId());
        assertEquals(service2.getAttribute("custom-attribute"), "custom-value2");


        // do the test again
        services = serviceManager.findServices(new ServiceFilter() {
            public boolean matches(Service service) throws GovernanceException {
                String attributeVal = service.getAttribute("custom-attribute");
                if (attributeVal != null && attributeVal.startsWith("custom-value")) {
                    return true;
                }
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.