View Javadoc
1 /* 2 * $Header: /cvsroot/ebxmlrr/ebxmlrr/src/share/com/sun/ebxml/registry/query/filter/UserBranchProcessor.java,v 1.6 2002/03/06 04:40:40 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 UserBranchProcessor 14 * @see 15 * @author Nikola Stojanovic 16 */ 17 public class UserBranchProcessor extends BranchProcessor { 18 19 private UserBranch userBranch = null; 20 21 22 protected String getName() { 23 24 return "User"; 25 } 26 27 28 protected void setNativeBranch(Object branch) { 29 30 userBranch = (UserBranch)branch; 31 } 32 33 34 protected void buildFilterClauses() throws RegistryException { 35 36 convertUserFilter(); 37 convertPostalAddressFilter(); 38 convertTelephoneNumberFilters(); 39 convertEmailAddressFilters(); 40 } 41 42 43 protected void buildQueryClauses() throws RegistryException { 44 45 convertOrganizationQuery(); 46 } 47 48 49 protected void buildBranchClauses() throws RegistryException { 50 } 51 52 53 private void convertUserFilter() throws RegistryException { 54 55 if (userBranch.getUserFilter() != null) { 56 whereClause = filterProcessor.addNativeWhereClause(whereClause, userBranch.getUserFilter()); 57 } 58 } 59 60 61 private void convertPostalAddressFilter() throws RegistryException { 62 63 if (userBranch.getPostalAddressFilter() != null) { 64 filterProcessor.setSelectColumn("parent"); 65 whereClause = filterProcessor.addForeignWhereClause(whereClause, userBranch.getPostalAddressFilter()); 66 } 67 } 68 69 70 private void convertTelephoneNumberFilters() throws RegistryException { 71 72 TelephoneNumberFilter[] telFilter = userBranch.getTelephoneNumberFilter(); 73 74 if (telFilter.length > 0) { 75 filterProcessor.setSelectColumn("parent"); 76 77 for (int i=0; i<telFilter.length; i++) { 78 whereClause = filterProcessor.addForeignWhereClause(whereClause, telFilter[i]); 79 } 80 } 81 } 82 83 84 private void convertEmailAddressFilters() throws RegistryException { 85 86 EmailAddressFilter[] emailAddressFilter = userBranch.getEmailAddressFilter(); 87 88 if (emailAddressFilter.length > 0) { 89 filterProcessor.setSelectColumn("parent"); 90 91 for (int i=0; i<emailAddressFilter.length; i++) { 92 whereClause = filterProcessor.addForeignWhereClause(whereClause, emailAddressFilter[i]); 93 } 94 } 95 } 96 97 98 private void convertOrganizationQuery() throws RegistryException { 99 100 if (userBranch.getOrganizationQuery() != null) { 101 OrganizationQueryProcessor queryProcessor = new OrganizationQueryProcessor(); 102 queryProcessor.setParentJoinColumn("organization"); 103 queryProcessor.setSelectColumn("id"); 104 whereClause = queryProcessor.addWhereClause(whereClause, userBranch.getOrganizationQuery()); 105 } 106 } 107 }

This page was automatically generated by Maven