Source Code Cross Referenced for ServiceReference.java in  » Database-Client » iSQL-Viewer » org » isqlviewer » 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 » Database Client » iSQL Viewer » org.isqlviewer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the Mozilla Public License
003:         * Version 1.1 (the "License"); you may not use this file except in
004:         * compliance with the License. You may obtain a copy of the License at
005:         * http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
009:         * License for the specific language governing rights and limitations
010:         * under the License.
011:         * 
012:         * The Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
013:         *
014:         * The Initial Developer of the Original Code is iSQL-Viewer, A Mutli-Platform Database Tool.
015:         * Portions created by Mark A. Kobold are Copyright (C) 2000-2007. All Rights Reserved.
016:         *
017:         * Contributor(s): 
018:         *  Mark A. Kobold [mkobold <at> isqlviewer <dot> com].
019:         *  
020:         * If you didn't download this code from the following link, you should check
021:         * if you aren't using an obsolete version: http://www.isqlviewer.com
022:         */
023:        package org.isqlviewer;
024:
025:        import java.net.URL;
026:        import java.util.Date;
027:
028:        /**
029:         * Lightweight object to refer to a service definition at runtime.
030:         * <p>
031:         * Service definitions within iSQL-Viewer can be and most often are heavy objects containing lots of information
032:         * regarding how to connect to a specific JDBC resource. This class serves as a lightwieght reference containing only
033:         * the basic information required to connect to the service, without having all the service connection information
034:         * resident in memory.
035:         * <p>
036:         * 
037:         * @author Mark A. Kobold &lt;mkobold at isqlviewer dot com&gt;
038:         * @version 1.0
039:         */
040:        public class ServiceReference {
041:
042:            private long id = -1;
043:            private String name = null;
044:            private int order = -1;
045:            private Date lastUsed = null;
046:            private Date createdOn = null;
047:            private URL resourceURL = null;
048:
049:            /**
050:             * Gets the unique identifier for this service reference.
051:             * <p>
052:             * Simply number that unique identifies this service reference within the iSQL-Viewer application. If the Id is -1
053:             * or less than 0, then that indicates that this particular service reference instance is not registered within the
054:             * application.
055:             * <p>
056:             * This value has no real value other than uniquely identifying this service.
057:             * 
058:             * @return the id of this service reference.
059:             */
060:            public long getId() {
061:
062:                return id;
063:            }
064:
065:            /**
066:             * Sets the service reference identifier to the specified value.
067:             * <p>
068:             * 
069:             * @param id the id to set to uniquely identify this service.
070:             */
071:            public void setId(long id) {
072:
073:                this .id = id;
074:            }
075:
076:            /**
077:             * Gets the common service name for this reference.
078:             * <p>
079:             * This is the name set by the user when the service definition was created.
080:             * 
081:             * @return the name of the service this instance refers to; can be null if not set.
082:             */
083:            public String getName() {
084:
085:                return name;
086:            }
087:
088:            /**
089:             * Sets the service name this instance refers to.
090:             * <p>
091:             * 
092:             * @param name to set as a logical reference for this instance.
093:             * @throws NullPointerException if the given name is <tt>null</tt>.
094:             * @throws IllegalArgumentException if the given name is blank.
095:             */
096:            public void setName(String name) {
097:
098:                if (name == null) {
099:                    throw new NullPointerException("name");
100:                } else if (name.trim().length() == 0) {
101:                    throw new IllegalArgumentException("name cannot be blank");
102:                }
103:                this .name = name;
104:            }
105:
106:            /**
107:             * Gets the preferred order of this service.
108:             * <p>
109:             * The order refers to the order defined by the user as thier preferred order.
110:             * 
111:             * @return the order of this service as determined by the user.
112:             */
113:            public int getOrder() {
114:
115:                return order;
116:            }
117:
118:            /**
119:             * Sets the order of this service reference.
120:             * <p>
121:             * 
122:             * @param order the order to set for this reference.
123:             * @throws IllegalArgumentException if the given order is less than zero.
124:             */
125:            public void setOrder(int order) {
126:
127:                this .order = order;
128:            }
129:
130:            /**
131:             * Gets the resource URL containing the service information for this instance.
132:             * <p>
133:             * This points to the service file containing all the nessecary connection information used to make and configure
134:             * JDBC connections made by iSQL-Viewer.
135:             * <p>
136:             * The idea for using URL versus local file is allow service defintions to be accessed via HTTP and other Java
137:             * supported protocols.
138:             * 
139:             * @return the resource URL containing the detailed service connection information.
140:             */
141:            public URL getResourceURL() {
142:
143:                return resourceURL;
144:            }
145:
146:            /**
147:             * Sets the resource URL for this service reference.
148:             * <p>
149:             * 
150:             * @param resourceURL to set for this reference.
151:             * @throws NullPointerException if the given URL is null.
152:             */
153:            public void setResourceURL(URL resourceURL) {
154:
155:                this .resourceURL = resourceURL;
156:            }
157:
158:            /**
159:             * Gets the last time a connection was made to the referring service by iSQL-Viewer.
160:             * <p>
161:             * 
162:             * @return the date and time at which a connection was made to this service.
163:             */
164:            public Date getLastUsed() {
165:
166:                return lastUsed;
167:            }
168:
169:            /**
170:             * Sets the last time a connection was made to this service.
171:             * <p>
172:             * 
173:             * @param lastUsed the date and time at which a connection was successfull.
174:             */
175:            public void setLastUsed(Date lastUsed) {
176:
177:                this .lastUsed = lastUsed;
178:            }
179:
180:            /**
181:             * @return the createdOn
182:             */
183:            public Date getCreatedOn() {
184:
185:                return createdOn;
186:            }
187:
188:            /**
189:             * @param createdOn the createdOn to set
190:             */
191:            public void setCreatedOn(Date createdOn) {
192:
193:                this.createdOn = createdOn;
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.