Source Code Cross Referenced for ClientPropertiesFilter.java in  » Portal » Open-Portal » com » sun » portal » providers » context » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.providers.context 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002 Sun Microsystems, Inc. All
003:         * rights reserved. Use of this product is subject
004:         * to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users
006:         * Subject to Standard License Terms and
007:         * Conditions.
008:         *
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010:         * are trademarks or registered trademarks of Sun Microsystems,
011:         * Inc. in the United States and other countries.
012:         */
013:
014:        package com.sun.portal.providers.context;
015:
016:        import java.util.List;
017:        import java.util.Iterator;
018:        import java.util.ArrayList;
019:        import java.util.Set;
020:        import java.util.Collections;
021:
022:        /**
023:         * This class implements the "client" filter.
024:         */
025:        public class ClientPropertiesFilter extends PropertiesFilter {
026:
027:            private static final String PARENTCLIENTS = "parentId";
028:
029:            /**
030:             * Constructor.  Do not call this directly.  Instead use
031:             * <code>PropertiesFilterFactory.get(CLIENT_PROPERTIESFILTER_CLASSNAME, ...)</code>.
032:             *
033:             * @see PropertiesFilterFactory#get(String, String, boolean)
034:             */
035:            public ClientPropertiesFilter() {
036:                super ();
037:            }
038:
039:            /**
040:             * CACHING IS DISABLED FOR NOW.
041:             *
042:             * Return <code>true</code>.
043:             *
044:             * @return <code>true</code>
045:             *
046:            public boolean isCachable() {
047:                return true;
048:            }
049:             */
050:
051:            /**
052:             * Return "<code>client</code>"
053:             *
054:             * @return "<code>client</code>"
055:             */
056:            public String getCondition() {
057:                return "client";
058:            }
059:
060:            /**
061:             * Does the given condition and value match this client filter?
062:             * This match method is based on a case-sensitive string comparison.
063:             *
064:             * In other words, the condition should be "client" and value should
065:             * exactly match the value that was used to instantiate this filter.
066:             *
067:             * @param condition filter condition.  i.e. "client"
068:             * @param value client type
069:             * @return boolean value indicating whether match has succeeded or not.
070:             */
071:            public boolean match(String condition, String value) {
072:                return condition.toLowerCase().equals("client")
073:                        && getValue().equals(value);
074:            }
075:
076:            /**
077:             * A convenience method for getting a list of
078:             * <code>ClientPropertiesFilters</code> for the given client.
079:             *
080:             * @param context provider context
081:             * @param clientType client type string
082:             * @param required boolean value that determines whether the filters are
083:             * required or optional
084:             * @return List of <code>ClientPropertiesFilter</code>s
085:             */
086:            public static List getClientFilters(ProviderContext context,
087:                    String clientType, boolean required)
088:                    throws PropertiesFilterException {
089:                List filters = new ArrayList();
090:                filters
091:                        .add(PropertiesFilterFactory
092:                                .get(
093:                                        PropertiesFilterFactory.CLIENT_PROPERTIESFILTER_CLASSNAME,
094:                                        clientType, required));
095:                Set parents = getClientParents(context, clientType);
096:                if (parents != null) {
097:                    for (Iterator pi = parents.iterator(); pi.hasNext();) {
098:                        filters
099:                                .add(PropertiesFilterFactory
100:                                        .get(
101:                                                PropertiesFilterFactory.CLIENT_PROPERTIESFILTER_CLASSNAME,
102:                                                (String) pi.next(), required));
103:                    }
104:                }
105:
106:                //
107:                // order it from the least-specific to the most-specific
108:                //
109:                Collections.reverse(filters);
110:
111:                return filters;
112:
113:            }
114:
115:            /**
116:             * A convenience method for getting a list of
117:             * <code>ClientPropertiesFilters</code> for the client based on the given
118:             * context.
119:             *
120:             * @param context provider context
121:             * @param required boolean value that determines whether the filters are
122:             * required or optional
123:             * @return List of <code>ClientPropertiesFilter</code>s
124:             */
125:            public static List getClientFilters(ProviderContext context,
126:                    boolean required) throws PropertiesFilterException {
127:
128:                return getClientFilters(context, context.getClientType(),
129:                        required);
130:
131:            }
132:
133:            /**
134:             * Gets the set of parents for the specified client.
135:             * @param context provider context
136:             * @param clientType client type string
137:             * @return Set of parent strings for the client
138:             */
139:            public static Set getClientParents(ProviderContext context,
140:                    String clientType) {
141:                return context.getClientTypeProperties(clientType,
142:                        PARENTCLIENTS);
143:            }
144:
145:            /**
146:             * Gets the set of parents for the client based on the context.
147:             * @param context provider context
148:             * @return Set of parent strings for the client
149:             */
150:            public static Set getClientParents(ProviderContext context) {
151:                return getClientParents(context, context.getClientType());
152:            }
153:
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.