KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > ra > MuleConnectionRequestInfo


1 /*
2  * $Id: MuleConnectionRequestInfo.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.ra;
12
13 import java.io.IOException JavaDoc;
14 import java.io.ObjectInputStream JavaDoc;
15 import java.io.Serializable JavaDoc;
16
17 import javax.resource.spi.ConnectionRequestInfo JavaDoc;
18
19 import org.mule.MuleManager;
20 import org.mule.config.builders.MuleXmlConfigurationBuilder;
21 import org.mule.umo.manager.UMOManager;
22 import org.mule.util.StringUtils;
23
24 /**
25  * <code>MuleConnectionRequestInfo</code> TODO
26  */

27 public class MuleConnectionRequestInfo implements ConnectionRequestInfo JavaDoc, Cloneable JavaDoc, Serializable JavaDoc
28 {
29     /**
30      * Serial version
31      */

32     private static final long serialVersionUID = 910828075890304726L;
33
34     private transient UMOManager manager;
35
36     private String JavaDoc configurationBuilder = MuleXmlConfigurationBuilder.class.getName();
37     private String JavaDoc configurations;
38     private String JavaDoc username;
39     private String JavaDoc password;
40
41     public MuleConnectionRequestInfo()
42     {
43         super();
44     }
45
46     private void readObject(ObjectInputStream JavaDoc ois) throws ClassNotFoundException JavaDoc, IOException JavaDoc
47     {
48         ois.defaultReadObject();
49         this.manager = MuleManager.getInstance();
50     }
51
52     public String JavaDoc getConfigurationBuilder()
53     {
54         return configurationBuilder;
55     }
56
57     public void setConfigurationBuilder(String JavaDoc configurationBuilder)
58     {
59         this.configurationBuilder = configurationBuilder;
60     }
61
62     public String JavaDoc getConfigurations()
63     {
64         return configurations;
65     }
66
67     public String JavaDoc[] getConfigurationsAsArray()
68     {
69         return StringUtils.splitAndTrim(configurations, ",");
70     }
71
72     public void setConfigurations(String JavaDoc configurations)
73     {
74         this.configurations = configurations;
75     }
76
77     public String JavaDoc getUserName()
78     {
79         return username;
80     }
81
82     public void setUserName(String JavaDoc username)
83     {
84         this.username = username;
85     }
86
87     public String JavaDoc getPassword()
88     {
89         return password;
90     }
91
92     public void setPassword(String JavaDoc password)
93     {
94         this.password = password;
95     }
96
97     public UMOManager getManager()
98     {
99         return manager;
100     }
101
102     public void setManager(UMOManager manager)
103     {
104         this.manager = manager;
105     }
106
107     public boolean equals(Object JavaDoc obj)
108     {
109         if (this == obj)
110         {
111             return true;
112         }
113
114         if (obj == null)
115         {
116             return false;
117         }
118
119         if (this.getClass() != obj.getClass())
120         {
121             return false;
122         }
123
124         final MuleConnectionRequestInfo muleConnectionRequestInfo = (MuleConnectionRequestInfo)obj;
125
126         if (configurationBuilder != null
127                         ? !configurationBuilder.equals(muleConnectionRequestInfo.configurationBuilder)
128                         : muleConnectionRequestInfo.configurationBuilder != null)
129         {
130             return false;
131         }
132
133         if (configurations != null
134                         ? !configurations.equals(muleConnectionRequestInfo.configurations)
135                         : muleConnectionRequestInfo.configurations != null)
136         {
137             return false;
138         }
139
140         if (password != null
141                         ? !password.equals(muleConnectionRequestInfo.password)
142                         : muleConnectionRequestInfo.password != null)
143         {
144             return false;
145         }
146
147         if (username != null
148                         ? !username.equals(muleConnectionRequestInfo.username)
149                         : muleConnectionRequestInfo.username != null)
150         {
151             return false;
152         }
153
154         return true;
155     }
156
157     public int hashCode()
158     {
159         int result = (configurationBuilder != null ? configurationBuilder.hashCode() : 0);
160         result = 29 * result + (configurations != null ? configurations.hashCode() : 0);
161         result = 29 * result + (username != null ? username.hashCode() : 0);
162         return 29 * result + (password != null ? password.hashCode() : 0);
163     }
164
165     protected Object JavaDoc clone() throws CloneNotSupportedException JavaDoc
166     {
167         return super.clone();
168     }
169 }
170
Popular Tags