Source Code Cross Referenced for PingQueueEntryData.java in  » Blogger-System » apache-roller-3.1 » org » apache » roller » pojos » 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 » Blogger System » apache roller 3.1 » org.apache.roller.pojos 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  The ASF licenses this file to You
004:         * under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *   http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.  For additional information regarding
015:         * copyright in this work, please see the NOTICE file in the top level
016:         * directory of this distribution.
017:         */
018:
019:        package org.apache.roller.pojos;
020:
021:        import java.io.Serializable;
022:        import java.sql.Timestamp;
023:
024:        /**
025:         * Ping queue entry.  Each instance of this class represents an entry on the ping queue. The entry indicates when it was
026:         * added to the queue, which configuration to apply for the ping, and the number of ping attempts that have been made
027:         * for this entry so far.
028:         *
029:         * @author <a href="mailto:anil@busybuddha.org">Anil Gangolli</a>
030:         * @ejb:bean name="PingQueueEntryData"
031:         * @hibernate.class lazy="false" table="pingqueueentry"
032:         * @hibernate.cache usage="read-write"
033:         */
034:        public class PingQueueEntryData extends PersistentObject implements 
035:                Serializable {
036:            private String id = null;
037:            private Timestamp entryTime = null;
038:            private PingTargetData pingTarget = null;
039:            private WebsiteData website = null;
040:            private int attempts = 0;
041:
042:            public static final long serialVersionUID = -1468021030819538243L;
043:
044:            /**
045:             * Default constructor.  Leaves all fields at Java-specified default values.
046:             */
047:            public PingQueueEntryData() {
048:            }
049:
050:            /**
051:             * Construct with all members
052:             *
053:             * @param id         unique id of this entry
054:             * @param entryTime  timestamp of first entry onto queue
055:             * @param pingTarget target site to ping
056:             * @param website    website originating the ping
057:             * @param attempts   number of prior ping attempts
058:             */
059:            public PingQueueEntryData(String id, Timestamp entryTime,
060:                    PingTargetData pingTarget, WebsiteData website, int attempts) {
061:                this .id = id;
062:                this .entryTime = entryTime;
063:                this .pingTarget = pingTarget;
064:                this .website = website;
065:                this .attempts = attempts;
066:            }
067:
068:            /**
069:             * @see PersistentObject#setData(PersistentObject)
070:             */
071:            public void setData(PersistentObject vo) {
072:                PingQueueEntryData other = (PingQueueEntryData) vo;
073:
074:                id = other.getId();
075:                entryTime = other.getEntryTime();
076:                pingTarget = other.getPingTarget();
077:                website = other.getWebsite();
078:                attempts = other.getAttempts();
079:            }
080:
081:            /**
082:             * Get the unique id (primary key) of this object.
083:             *
084:             * @return the unique id of this object.
085:             * @ejb:persistent-field
086:             * @hibernate.id column="id" generator-class="uuid.hex" unsaved-value="null"
087:             */
088:            public String getId() {
089:                return id;
090:            }
091:
092:            /**
093:             * Set the unique id (primary key) of this object.
094:             *
095:             * @param id
096:             * @ejb:persistent-field
097:             */
098:            public void setId(String id) {
099:                this .id = id;
100:            }
101:
102:            /**
103:             * Get the entry time.  Get the time this entry was first added to the queue.
104:             *
105:             * @return the time the entry was first added to the queue.
106:             * @ejb:persistent-field
107:             * @hibernate.property column="entrytime" non-null="true"
108:             */
109:            public Timestamp getEntryTime() {
110:                return entryTime;
111:            }
112:
113:            /**
114:             * Set the entry time.
115:             *
116:             * @param entryTime the time the entry was first added to the queue.
117:             * @ejb:persistent-field
118:             */
119:            public void setEntryTime(Timestamp entryTime) {
120:                this .entryTime = entryTime;
121:            }
122:
123:            /**
124:             * Get the ping target.  Get the target to ping.
125:             *
126:             * @return the ping target to ping.
127:             * @ejb:persistent-field
128:             * @hibernate.many-to-one column="pingtargetid" cascade="none" not-null="true"
129:             */
130:            public PingTargetData getPingTarget() {
131:                return pingTarget;
132:            }
133:
134:            /**
135:             * Set the ping target.
136:             *
137:             * @param pingTarget target to ping.
138:             * @ejb:persistent-field
139:             */
140:            public void setPingTarget(PingTargetData pingTarget) {
141:                this .pingTarget = pingTarget;
142:            }
143:
144:            /**
145:             * Get the website originating the ping.
146:             *
147:             * @return the website originating the ping.
148:             * @ejb:persistent-field
149:             * @hibernate.many-to-one column="websiteid" cascade="none" not-null="true"
150:             */
151:            public WebsiteData getWebsite() {
152:                return website;
153:            }
154:
155:            /**
156:             * Set the website originating the ping.
157:             *
158:             * @param website the website originating the ping.
159:             * @ejb:persistent-field
160:             */
161:            public void setWebsite(WebsiteData website) {
162:                this .website = website;
163:            }
164:
165:            /**
166:             * Get the number of ping attempts that have been made for this queue entry.
167:             *
168:             * @return the number of ping attempts that have been made for this queue entry.
169:             * @ejb:persistent-field
170:             * @hibernate.property column="attempts" non-null="true"
171:             */
172:            public int getAttempts() {
173:                return attempts;
174:            }
175:
176:            /**
177:             * Set the number of failures that have occurred for this queue entry.
178:             *
179:             * @param attempts
180:             * @ejb:persistent-field
181:             */
182:            public void setAttempts(int attempts) {
183:                this .attempts = attempts;
184:            }
185:
186:            /**
187:             * Increment the number of failures for this queue entry.
188:             *
189:             * @return the new value.
190:             */
191:            public int incrementAttempts() {
192:                return ++attempts;
193:            }
194:
195:            /**
196:             * @see Object#equals(Object o)
197:             */
198:            public boolean equals(Object o) {
199:                if (this  == o)
200:                    return true;
201:                if (!(o instanceof  PingQueueEntryData))
202:                    return false;
203:
204:                final PingQueueEntryData pingQueueEntryData = (PingQueueEntryData) o;
205:
206:                if (attempts != pingQueueEntryData.getAttempts())
207:                    return false;
208:                if (entryTime != null ? !entryTime.equals(pingQueueEntryData
209:                        .getEntryTime())
210:                        : pingQueueEntryData.getEntryTime() != null) {
211:                    return false;
212:                }
213:                if (id != null ? !id.equals(pingQueueEntryData.getId())
214:                        : pingQueueEntryData.getId() != null)
215:                    return false;
216:                if (pingTarget != null ? !pingTarget.equals(pingQueueEntryData
217:                        .getPingTarget())
218:                        : pingQueueEntryData.getPingTarget() != null) {
219:                    return false;
220:                }
221:                if (website != null ? !website.equals(pingQueueEntryData
222:                        .getWebsite())
223:                        : pingQueueEntryData.getWebsite() != null) {
224:                    return false;
225:                }
226:
227:                return true;
228:            }
229:
230:            /**
231:             * @see Object#hashCode()
232:             */
233:            public int hashCode() {
234:                return (id != null ? id.hashCode() : 0);
235:            }
236:
237:            /**
238:             * Generate a string form of the object appropriate for logging or debugging.
239:             *
240:             * @return a string form of the object appropriate for logging or debugging.
241:             * @see Object#toString()
242:             */
243:            public String toString() {
244:                return "PingQueueEntryData{"
245:                        + "id='"
246:                        + id
247:                        + "'"
248:                        + ", entryTime="
249:                        + entryTime
250:                        + ", pingTarget="
251:                        + pingTarget
252:                        + ", website= "
253:                        + (website == null ? "null" : "{id='" + website.getId()
254:                                + "'} ") + ", attempts=" + attempts + "}";
255:            }
256:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.