Source Code Cross Referenced for RemoteRDMDb.java in  » Portal » Open-Portal » com » sun » portal » search » db » 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.search.db 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:
006:        package com.sun.portal.search.db;
007:
008:        import com.sun.portal.search.rdm.*;
009:        import com.sun.portal.search.soif.*;
010:        import com.sun.portal.search.util.*;
011:        import com.sun.portal.search.demo.*;
012:
013:        import java.util.*;
014:        import java.io.*;
015:
016:        /**
017:         *
018:         * Search engine interface implementation for searching a remote RDM server
019:         *
020:         */
021:        public class RemoteRDMDb implements  RDMDb {
022:
023:            String rdmserverurl;
024:            String rdmserverdb;
025:            String defaultView = "score,url,hl-url,hl-description,title,hl-title,classification,hl-classification";
026:
027:            /**
028:             * Store - creates a transaction for atomic indexing, if none supplied.
029:             * @param st Token for search
030:             * @param insoif SOIF document
031:             * @param view Set of Attributes
032:             * @param flags Options
033:             * @param t RDM transaction
034:             * @throws RDMException
035:             */
036:            public void store(SToken st, SOIF insoif, Set view, int flags,
037:                    RDMTransaction t) throws RDMException {
038:                throw new RDMException("RemoteRDMDb.store(): not implemented");
039:            }
040:
041:            /**
042:             * Empty the database
043:             * @param st Token for search
044:             * @param t RDM transaction handle
045:             * @throws RDMException
046:             */
047:            public int purge(SToken st, RDMTransaction t) throws RDMException {
048:                throw new RDMException("RemoteRDMDb.purge(): not implemented");
049:            }
050:
051:            /**
052:             * Open a database
053:             * @param st Token for search
054:             * @param rootdir Database home dir
055:             * @param dbname Name of database from root database
056:             * @param rw RDMDb.WRITER or RDMDb.WRCREAT or RDMDb.READER
057:             * @param mode Unix mode
058:             * @throws RDMException
059:             */
060:            public void open(SToken st, String rootdir, String dbname, int rw,
061:                    int mode) throws RDMException {
062:                SOIF dbsoif = DbManager.getRootDbEntry(st, dbname);
063:                rdmserverurl = dbsoif.getValue("rdmserverurl");
064:                rdmserverdb = dbsoif.getValue("databasename");
065:                String defview = dbsoif.getValue("defaultView");
066:                if (defview != null)
067:                    defaultView = defview;
068:            }
069:
070:            /**
071:             * Close database and index extents
072:             * @param st Token for search
073:             * @throws RDMException
074:             */
075:            public void close(SToken st) throws RDMException {
076:                ;//do nothing
077:            }
078:
079:            /**
080:             * Obtain the name for the search engine interface
081:             * @return the name of the search engine activity
082:             */
083:            public String getName() {
084:                return "RemoteRDM Search";
085:            }
086:
087:            /**
088:             * Submit the query to the search engine
089:             * @param st Token for search
090:             * @param queryString Search query
091:             * @param numHits Number of hits
092:             * @param view Set of attributes to be retrieved
093:             * @param sortOrder Order for sorting the results
094:             * @param t RDM transaction handle
095:             * @return RDMResultSet
096:             * @throws RDMException
097:             */
098:            public RDMResultSet search(SToken st, String query, int numHits,
099:                    Set view, String sortOrder, RDMTransaction t)
100:                    throws RDMException {
101:
102:                Search s;
103:
104:                try {
105:                    String csview = "";
106:
107:                    if (view != null) {
108:                        for (Iterator i = view.iterator(); i.hasNext();) {
109:                            csview = csview + (String) i.next();
110:                            if (i.hasNext())
111:                                csview += ",";
112:                        }
113:                    } else {
114:                        // view can be null even if the client sets a view, because
115:                        // it is not always passed down (in the case of rdmgr), rather,
116:                        // it is applied after results are pulled from the databse - 
117:                        // we need to change that and always do it down here in the
118:                        // db class. Here we will set a default view to avoid retrieving
119:                        // everything from the remote server. This view can be configured
120:                        // in the federated db.
121:                        csview = defaultView;
122:                    }
123:
124:                    if (csview.equals(""))
125:                        csview = null;
126:
127:                    s = new Search(query, csview, sortOrder, 1, numHits,
128:                            "search", rdmserverdb, rdmserverurl, null);
129:                    s.doQuery();
130:                } catch (Exception e) {
131:                    throw new RDMException(e);
132:                }
133:
134:                RemoteRDMResultSet rs = new RemoteRDMResultSet(st, this , query,
135:                        t);
136:                rs.setRemoteRDMSearchResult(s);
137:                return rs;
138:
139:            }
140:
141:            /**
142:             * Get search count
143:             * @return number of docs.
144:             */
145:            public int count(SToken st, RDMTransaction t) throws RDMException {
146:                return 250000000;
147:            }
148:
149:            /**
150:             * Delete RD from database
151:             * @param st Token for search
152:             * @param s SOIF document
153:             * @param view Set of attributes
154:             * @param flags Options
155:             * @param t RDM transaction handle
156:             * @throws RDMException
157:             */
158:            public void delete(SToken st, SOIF s, Set view, int flags,
159:                    RDMTransaction t) throws RDMException {
160:                throw new RDMException("RemoteRDMDb.delete() not implemented");
161:            }
162:
163:            /**
164:             * Update an RD with attributes set in View
165:             * @param st Token for search
166:             * @param insoif SOIF document
167:             * @param view Set of Attributes
168:             * @param flags Options
169:             * @param t RDM transaction
170:             * @throws RDMException
171:             */
172:            public void update(SToken st, SOIF insoif, Set view, int flags,
173:                    RDMTransaction t) throws RDMException {
174:                throw new RDMException("RemoteRDMDb.update() not implemented");
175:            }
176:
177:            /**
178:             * Retrieve RD from database, filtered by view
179:             * @param st Token for search
180:             * @param url URL string
181:             * @param view Set of Attributes
182:             * @param flags Options
183:             * @param t RDM transaction
184:             * @throws RDMException
185:             */
186:            public SOIF fetch(SToken st, String url, Set view, int flags,
187:                    RDMTransaction t) throws RDMException {
188:                throw new RDMException("RemoteRDMDb.fetch() not implemented");
189:            }
190:
191:            /**
192:             * Optimize the db
193:             * @param st Token for search
194:             * @throws RDMException
195:             */
196:            public void optimize(SToken st) throws RDMException {
197:                throw new RDMException("RemoteRDMDb.optimize() not implemented");
198:            }
199:
200:            /**
201:             * Batch Index
202:             * @param st Token for search
203:             * @throws RDMException
204:             */
205:            public void indexBatch(SToken st) throws RDMException {
206:                throw new RDMException(
207:                        "RemoteRDMDb.indexBatch() not implemented");
208:            }
209:
210:            /**
211:             * Recover the db - must be run stand alone (ie, no one else has the db open)
212:             * @param st Token for search
213:             * @param dbhome Database home dir
214:             * @param fatal Option
215:             * @throws RDMException
216:             */
217:            public void recover(SToken st, String dbhome, boolean fatal)
218:                    throws RDMException {
219:                throw new RDMException("RemoteRDMDb.recover() not implemented");
220:            }
221:
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.