View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/ebxmlrr/src/share/com/sun/ebxml/registry/query/filter/ServiceBindingBranchProcessor.java,v 1.6 2003/01/14 22:19:45 nstojano Exp $ 3 */ 4 5 package com.sun.ebxml.registry.query.filter; 6 7 import com.sun.ebxml.registry.*; 8 9 import org.oasis.ebxml.registry.bindings.query.*; 10 import org.oasis.ebxml.registry.bindings.rs.*; 11 12 /*** 13 * Class Declaration for ServiceBindingBranchProcessor 14 * @see 15 * @author Nikola Stojanovic 16 */ 17 public class ServiceBindingBranchProcessor extends BranchProcessor { 18 19 private ServiceBindingBranch serviceBindingBranch = null; 20 private ServiceBindingTargetBranch serviceBindingTargetBranch = null; 21 22 protected String getName() { 23 24 return "ServiceBinding"; 25 } 26 27 28 protected void setNativeBranch(Object branch) { 29 30 if (branch instanceof org.oasis.ebxml.registry.bindings.query.ServiceBindingBranch) { 31 serviceBindingBranch = (ServiceBindingBranch)branch; 32 } 33 else if (branch instanceof org.oasis.ebxml.registry.bindings.query.ServiceBindingTargetBranch) { 34 serviceBindingTargetBranch = (ServiceBindingTargetBranch)branch; 35 } 36 // serviceBindingBranch = (ServiceBindingBranch)branch; 37 } 38 39 40 protected void buildFilterClauses() throws RegistryException { 41 42 convertServiceBindingFilter(); 43 } 44 45 46 protected void buildQueryClauses() throws RegistryException { 47 } 48 49 50 protected void buildBranchClauses() throws RegistryException { 51 52 convertSpecificationLinkBranches(); 53 convertServiceBindingTargetBranch(); 54 } 55 56 57 private void convertServiceBindingFilter() throws RegistryException { 58 59 ServiceBindingFilter serviceBindingFilter = null; 60 61 if (serviceBindingBranch != null) { 62 serviceBindingFilter = serviceBindingBranch.getServiceBindingFilter(); 63 } 64 else if (serviceBindingTargetBranch != null){ 65 serviceBindingFilter = serviceBindingTargetBranch.getServiceBindingFilter(); 66 } 67 } 68 69 70 private void convertSpecificationLinkBranches() throws RegistryException { 71 72 if (serviceBindingBranch != null) { 73 SpecificationLinkBranch[] specificationLinkBranch = serviceBindingBranch.getSpecificationLinkBranch(); 74 75 if (specificationLinkBranch.length > 0) { 76 77 for (int i=0; i<specificationLinkBranch.length; i++) { 78 SpecificationLinkBranchProcessor branchProcessor = new SpecificationLinkBranchProcessor(); 79 branchProcessor.setSelectColumn("serviceBinding"); 80 whereClause = branchProcessor.addWhereClause(whereClause, specificationLinkBranch[i]); 81 } 82 } 83 } 84 else if (serviceBindingTargetBranch != null){ 85 SpecificationLinkBranch[] specificationLinkBranch = serviceBindingTargetBranch.getSpecificationLinkBranch(); 86 87 if (specificationLinkBranch.length > 0) { 88 89 for (int i=0; i<specificationLinkBranch.length; i++) { 90 SpecificationLinkBranchProcessor branchProcessor = new SpecificationLinkBranchProcessor(); 91 branchProcessor.setSelectColumn("serviceBinding"); 92 whereClause = branchProcessor.addWhereClause(whereClause, specificationLinkBranch[i]); 93 } 94 } 95 } 96 } 97 98 99 private void convertServiceBindingTargetBranch() throws RegistryException { 100 101 ServiceBindingBranchProcessor branchProcessor = new ServiceBindingBranchProcessor(); 102 103 if (serviceBindingBranch != null) { 104 if (serviceBindingBranch.getServiceBindingTargetBranch() != null) { 105 branchProcessor.setParentJoinColumn("targetBinding"); 106 branchProcessor.setSelectColumn("id"); 107 whereClause = branchProcessor.addWhereClause(whereClause, serviceBindingBranch.getServiceBindingTargetBranch()); 108 } 109 } 110 else if (serviceBindingTargetBranch != null){ 111 if (serviceBindingTargetBranch.getServiceBindingTargetBranch() != null) { 112 branchProcessor.setParentJoinColumn("targetBinding"); 113 branchProcessor.setSelectColumn("id"); 114 whereClause = branchProcessor.addWhereClause(whereClause, serviceBindingTargetBranch.getServiceBindingTargetBranch()); 115 } 116 } 117 } 118 }

This page was automatically generated by Maven