KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > client > net > NetConfiguration


1 /*
2
3    Derby - Class org.apache.derby.client.net.NetConfiguration
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to You under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20 */

21 package org.apache.derby.client.net;
22
23 import org.apache.derby.iapi.reference.DRDAConstants;
24 import org.apache.derby.client.am.Version;
25
26 public class NetConfiguration {
27     // ---------------------------------------------------------------------------
28

29     static final int INITIAL_CAPACITY = 10; // initial size of the Vector for the input parameters
30

31     // Value to use when padding non-character data in ddm objects.
32
public static final byte NON_CHAR_DDM_DATA_PAD_BYTE = 0x00;
33
34     static final int CURSOR_NOT_OPEN = 0;
35     static final int CURSOR_OPEN = 1;
36     static final int CURSOR_CLOSE_ONLY = 2;
37
38     // Number of bytes in the DDM header.
39
static final int DDMHDR_LENGTH = 4;
40
41     // Number of bytes in the DSS header.
42
static final int DSSHDR_LENGTH = 6;
43
44     // Maximum size of External Name.
45
static final int EXTNAM_MAXSIZE = 255;
46
47     // Minimum agent level required by protocol.
48
static final int MIN_AGENT_MGRLVL = 3;
49
50     // Minimum communications tcpip manager level required by protocol.
51
static final int MIN_CMNTCPIP_MGRLVL = 5;
52
53     // Minimum LU6.2 Conversational Communications Manager
54
static final int MIN_CMNAPPC_MGRLVL = 3;
55
56     // Minimum rdb manager level required by protocol.
57
static final int MIN_RDB_MGRLVL = 3;
58
59     // Minimum secmgr manager level required by protocol.
60
static final int MIN_SECMGR_MGRLVL = 5;
61
62     // Minimum sqlam manager level required by protocol.
63
static final int MIN_SQLAM_MGRLVL = 4;
64
65     // Minimum xa manager level required by protocol.
66
static final int MIN_XAMGR_MGRLVL = 7;
67
68     // Minimum secmgr manager level required by protocol.
69
static final int MIN_SYNCPTMGR_MGRLVL = 5;
70
71     // Minimum sqlam manager level required by protocol.
72
static final int MIN_RSYNCMGR_MGRLVL = 5;
73
74     // Maximun Password size.
75
static final int PASSWORD_MAXSIZE = 255;
76
77     // Fixed PRDDTA application id fixed length.
78
public static final int PRDDTA_APPL_ID_FIXED_LEN = 20;
79
80     // PRDDTA Accounting Suffix Length byte offset.
81
static final int PRDDTA_ACCT_SUFFIX_LEN_BYTE = 55;
82
83     // PRDDTA Max Accounting Suffix Length.
84
static final int PRDDTA_MAX_ACCT_SUFFIX_LEN = 199;
85
86     // PRDDTA Length byte offset.
87
static final int PRDDTA_LEN_BYTE = 0;
88
89     // Maximum PRDDTA size.
90
static final int PRDDTA_MAXSIZE = 255;
91
92     // PRDDTA platform id.
93
public static final String JavaDoc PRDDTA_PLATFORM_ID = "JVM ";
94
95     // Fixed PRDDTA user id fixed length.
96
public static final int PRDDTA_USER_ID_FIXED_LEN = 8;
97
98     // Identifier Length for fixed length rdb name
99
public static final int PKG_IDENTIFIER_FIXED_LEN = 18;
100
101     // Maximum RDB Identifier Length
102
static final int PKG_IDENTIFIER_MAX_LEN = 255;
103
104     // Fixed pkgcnstkn length
105
public static final int PKGCNSTKN_FIXED_LEN = 8;
106
107     // Maximum length of a security token.
108
// Anything greater than 32763 bytes of SECTKN would require extended length DDMs.
109
// This seems like an impossible upper bound limit right now so set
110
// max to 32763 and cross bridge later.
111
static final int SECTKN_MAXSIZE = 32763; // this was 255
112

113     // Server class name of the ClientDNC product.
114
static final String JavaDoc SRVCLSNM_JVM = "QDERBY/JVM";
115
116     // Maximum size of SRVNAM Name.
117
static final int SRVNAM_MAXSIZE = 255;
118
119     // Manager is NA or not usued.
120
static final int MGRLVL_NA = 0;
121
122     // Manager Level 3 constant.
123
static final int MGRLVL_3 = 0x03;
124
125     // Manager Level 4 constant.
126
static final int MGRLVL_4 = 0x04;
127
128     // Manager Level 5 constant.
129
static final int MGRLVL_5 = 0x05;
130
131     // Manager level 6 constant.
132
static final int MGRLVL_6 = 0x06;
133
134     // Manager Level 7 constant.
135
static final public int MGRLVL_7 = 0x07;
136
137     // Indicates the DCE security mechanism.
138
static final int SECMEC_DCESEC = 0x01;
139
140     // Indicates encrypted userid, password,
141
// new password security mechanism.
142
static final int SECMEC_EUSRIDNWPWD = 0x0A;
143
144     // Indicates userid/encrypted password security mechanism.
145
public static final int SECMEC_EUSRIDPWD = 0x09;
146
147     // Indicates userid only security mechanism.
148
public static final int SECMEC_USRIDONL = 0x04;
149
150     // Indicates userid/encrypted password security mechanism.
151
public static final int SECMEC_USRENCPWD = 0x07;
152
153     // Indicates userid/new password security mechanism.
154
static final int SECMEC_USRIDNWPWD = 0x05;
155
156     // Indicates userid/password security mechanism.
157
public static final int SECMEC_USRIDPWD = 0x03;
158
159     //Indicates Encrypted userid and Encrypted Security-sensitive Data security mechanism
160
public static final int SECMEC_EUSRIDDTA = 0x0C;
161
162     //Indicates Encrypted userid,Encrypted password and Encrypted Security-sensitive Data security mechanism
163
public static final int SECMEC_EUSRPWDDTA = 0x0D;
164
165     // Indicates userid with strong password substitute security mechanism.
166
public static final int SECMEC_USRSSBPWD = 0x08;
167
168     // list of security mechanisms supported by this driver
169
static final int[] SECMGR_SECMECS = {NetConfiguration.SECMEC_EUSRIDPWD,
170                                          NetConfiguration.SECMEC_USRENCPWD,
171                                          NetConfiguration.SECMEC_USRIDPWD,
172                                          NetConfiguration.SECMEC_USRIDONL,
173                                          NetConfiguration.SECMEC_EUSRIDDTA,
174                                          NetConfiguration.SECMEC_EUSRPWDDTA,
175                                          NetConfiguration.SECMEC_USRSSBPWD};
176
177
178     // IEEE ASCII constant.
179
public static final String JavaDoc SYSTEM_ASC = "QTDSQLASC";
180
181     // JVM constant.
182
static final String JavaDoc SYSTEM_JVM = "QTDSQLJVM";
183
184     // Maximum size of User Name.
185
static final int USRID_MAXSIZE = 255;
186
187     // Product id of the ClientDNC.
188
public static String JavaDoc PRDID;
189
190     // The server release level of this product.
191
// It will be prefixed with PRDID
192
static String JavaDoc SRVRLSLV;
193
194     // Initialize PRDID and SRVRLSLV
195
static {
196         int majorVersion = Version.getMajorVersion();
197         int minorVersion = Version.getMinorVersion();
198         int protocolMaintVersion = Version.getProtocolMaintVersion();
199
200         // PRDID format as Network Server expects it: DNCMMmx
201
// MM = major version
202
// mm = minor version
203
// x = protocol MaintenanceVersion
204

205         String JavaDoc prdId = DRDAConstants.DERBY_DRDA_CLIENT_ID;
206         if (majorVersion < 10) {
207             prdId += "0";
208         }
209         prdId += majorVersion;
210
211         if (minorVersion < 10) {
212             prdId += "0";
213         }
214
215         prdId += minorVersion;
216         prdId += protocolMaintVersion;
217         PRDID = prdId;
218         SRVRLSLV = prdId + "/" + Version.getDriverVersion();
219     }
220
221 }
222
Popular Tags