01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.client;
17:
18: import java.io.Externalizable;
19: import java.io.ObjectInput;
20: import java.io.IOException;
21: import java.io.ObjectOutput;
22:
23: /**
24: * @version $Rev: 607077 $ $Date: 2007-12-27 06:55:23 -0800 $
25: */
26: public class DataSourceMetaData implements Externalizable {
27: private String jdbcUrl;
28: private String jdbcDriver;
29: private String defaultPassword;
30: private String defaultUserName;
31:
32: public DataSourceMetaData() {
33: }
34:
35: public DataSourceMetaData(String jdbcDriver, String jdbcUrl,
36: String defaultUserName, String defaultPassword) {
37: this .defaultPassword = defaultPassword;
38: this .defaultUserName = defaultUserName;
39: this .jdbcDriver = jdbcDriver;
40: this .jdbcUrl = jdbcUrl;
41: }
42:
43: public void readExternal(ObjectInput in) throws IOException,
44: ClassNotFoundException {
45: byte version = in.readByte(); // future use
46:
47: jdbcDriver = (String) in.readObject();
48: jdbcUrl = (String) in.readObject();
49: defaultUserName = (String) in.readObject();
50: defaultPassword = (String) in.readObject();
51: }
52:
53: public void writeExternal(ObjectOutput out) throws IOException {
54: // write out the version of the serialized data for future use
55: out.writeByte(1);
56:
57: out.writeObject(jdbcDriver);
58: out.writeObject(jdbcUrl);
59: out.writeObject(defaultUserName);
60: out.writeObject(defaultPassword);
61: }
62:
63: public String getDefaultPassword() {
64: return defaultPassword;
65: }
66:
67: public String getDefaultUserName() {
68: return defaultUserName;
69: }
70:
71: public String getJdbcDriver() {
72: return jdbcDriver;
73: }
74:
75: public String getJdbcUrl() {
76: return jdbcUrl;
77: }
78: }
|