KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > filesys > smb > server > SMBSrvSessionState


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.filesys.smb.server;
18
19 /**
20  * <p>
21  * Contains the various states that an SMB server session will go through during the session
22  * lifetime.
23  */

24 public class SMBSrvSessionState
25 {
26
27     // NetBIOS session has been closed.
28

29     public static final int NBHANGUP = 5;
30
31     // NetBIOS session request state.
32

33     public static final int NBSESSREQ = 0;
34
35     // SMB session closed down.
36

37     public static final int SMBCLOSED = 4;
38
39     // Negotiate SMB dialect.
40

41     public static final int SMBNEGOTIATE = 1;
42
43     // SMB session is initialized, ready to receive/handle standard SMB requests.
44

45     public static final int SMBSESSION = 3;
46
47     // SMB session setup.
48

49     public static final int SMBSESSSETUP = 2;
50
51     // State name strings
52

53     private static final String JavaDoc _stateName[] = {
54             "NBSESSREQ",
55             "SMBNEGOTIATE",
56             "SMBSESSSETUP",
57             "SMBSESSION",
58             "SMBCLOSED",
59             "NBHANGUP" };
60
61     /**
62      * Return the specified SMB state as a string.
63      */

64     public static String JavaDoc getStateAsString(int state)
65     {
66         if (state < _stateName.length)
67             return _stateName[state];
68         return "[UNKNOWN]";
69     }
70 }
Popular Tags