Source Code Cross Referenced for CallIdHeader.java in  » 6.0-JDK-Modules » j2me » gov » nist » siplite » header » 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 » 6.0 JDK Modules » j2me » gov.nist.siplite.header 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Portions Copyright  2000-2007 Sun Microsystems, Inc. All Rights
003:         * Reserved.  Use is subject to license terms.
004:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005:         * 
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License version
008:         * 2 only, as published by the Free Software Foundation.
009:         * 
010:         * This program is distributed in the hope that it will be useful, but
011:         * WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013:         * General Public License version 2 for more details (a copy is
014:         * included at /legal/license.txt).
015:         * 
016:         * You should have received a copy of the GNU General Public License
017:         * version 2 along with this work; if not, write to the Free Software
018:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA
020:         * 
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022:         * Clara, CA 95054 or visit www.sun.com if you need additional
023:         * information or have any questions.
024:         */
025:        /*
026:         */
027:        package gov.nist.siplite.header;
028:
029:        import gov.nist.core.*;
030:
031:        /**
032:         * Call ID Header
033:         *
034:         *
035:         * <a href="{@docRoot}/uncopyright.html">This code is in the public domain.</a>
036:         *
037:         * IMPL_NOTE: think about removing the specific parser for CallIdHeader.
038:         *
039:         */
040:        public class CallIdHeader extends ParameterLessHeader {
041:            /** Caller ID header label. */
042:            public static final String NAME = Header.CALL_ID;
043:
044:            /** Handle to class. */
045:            public static Class clazz;
046:
047:            /**
048:             * Caller Identifier field.
049:             */
050:            protected CallIdentifier callIdentifier;
051:
052:            static {
053:                clazz = new CallIdHeader().getClass();
054:            }
055:
056:            /**
057:             * Default constructor.
058:             */
059:            public CallIdHeader() {
060:                super (CALL_ID);
061:            }
062:
063:            /**
064:             * Compares two call ids for equality.
065:             *
066:             * @param other Object to set
067:             * @return true if the two call ids are equals, false otherwise
068:             */
069:            public boolean equals(Object other) {
070:                if (!this .getClass().equals(other.getClass())) {
071:                    return false;
072:                }
073:                CallIdHeader that = (CallIdHeader) other;
074:
075:                return this .callIdentifier.equals(that.callIdentifier);
076:            }
077:
078:            /**
079:             * Gets the encoded version of this id.
080:             *
081:             * @return String.
082:             */
083:            public String encode() {
084:                return headerName + Separators.COLON + Separators.SP
085:                        + callIdentifier.encode() + Separators.NEWLINE;
086:            }
087:
088:            /**
089:             * Encodes the body part of this header (leave out the hdrName).
090:             *
091:             * @return String encoded body part of the header.
092:             */
093:            public String encodeBody() {
094:                if (callIdentifier == null)
095:                    return "";
096:                else
097:                    return callIdentifier.encode();
098:            }
099:
100:            /**
101:             * Gets the Caller Id field. This does the same thing as
102:             * encodeBody.
103:             * @return String the encoded body part of the
104:             */
105:            public String getCallId() {
106:                return encodeBody();
107:            }
108:
109:            /**
110:             * Gets the call Identifer member.
111:             * @return CallIdentifier
112:             */
113:            public CallIdentifier getCallIdentifer() {
114:                return callIdentifier;
115:            }
116:
117:            /**
118:             * Sets the CallId field
119:             * @param cid String to set. This is the body part of the Call-Id
120:             * header. It must have the form localId@host or localId.
121:             * @throws IllegalArgumentException if cid is null, not a token, or is
122:             * not a token@token.
123:             */
124:            public void setCallId(String cid) throws IllegalArgumentException {
125:                callIdentifier = new CallIdentifier(cid);
126:            }
127:
128:            /**
129:             * Sets the callIdentifier member.
130:             * @param cid CallIdentifier to set (localId@host).
131:             */
132:            public void setCallIdentifier(CallIdentifier cid) {
133:                callIdentifier = cid;
134:            }
135:
136:            /**
137:             * Clone - do a deep copy.
138:             * @return Object CallIdHeader
139:             */
140:            public Object clone() {
141:                CallIdHeader retval = new CallIdHeader();
142:                if (this .callIdentifier != null)
143:                    retval.callIdentifier = (CallIdentifier) this .callIdentifier
144:                            .clone();
145:                return retval;
146:            }
147:
148:            /**
149:             * Gets the caller id header value.
150:             * @return the caller id value
151:             */
152:            public Object getValue() {
153:                return callIdentifier;
154:
155:            }
156:
157:            /**
158:             * Sets the header value field.
159:             * @param value is the value field to set.
160:             * @throws IllegalArgumentException if the value is invalid.
161:             */
162:            public void setHeaderValue(String value)
163:                    throws IllegalArgumentException {
164:                setCallId(value);
165:            }
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.