The client connection model provides connection management. The Session Manager is a collection of packages that allows various session providers to be abstracted under one interface, using one manager to tie them together. The Session Manager uses a Session interface as a base class for most of its concepts. This helps keep the interfaces for working with sessions easy to learn and re-use. See also Section 2.11, Remote Session Manager for information about the clientless version of NJCL.
Sessions are the building blocks of the API layer and are used to set up a communication channel between two entities. The first entity, the initiating entity, creates a session, and the second entity, the domain, can be anything from a tree to a server to any other object. Sessions, therefore, form the established communication channel between two objects in a domain. Once the object has established a singular session, it can communicate with another object in the same domain. Domains can be hierarchical, with child domains narrowing the scope of their parents.
Sessions are the client/server connections in NetWare and are part of a tree hierarchy where the Session Manager is the top-level session of the tree that ties all session providers together and is a session itself. Sessions are unique in relation to their parent and their domain name, which means two different sessions can have the same domain name, as long as their parents are different.
The Multi User Session Manager feature allows multiple separate sessions to the same domain. It also provides the capability for multiple distinct authentications sumultaneously into the same domain. For example, User1 and User2 can both be simultaneously authenticated to Tree1. The two sessions, Session1 and Session2, will then have User1 and User2 rights, respectively, when accessing services in Tree1. This feature only works when running on a NetWare server unless you are using the clientless version of NJCL. A source code sample, MultiUserSessionTest.java, is provided as an example of how to use this functionality.
The Session Manager is broken down into four packages. The important components (interfaces and classes) of the Session Manager are contained in these packages.
The com.novell.service.session package provides the interfaces, classes, and operations that allow users to manage sessions across multiple session providers. Four interfaces and seven classes in the package are provided for public access.
Read-only functionality is available through session attributes, which can be retrieved via the getAttributes methods. While attributes are designed to allow sessions to expose provider-specifics, some session attributes are common to all sessions (like those described in this class) for the sake of convenience. Session attributes are also used by the search method to facilitate finding sessions of a certain category.
Read-write functionality is available through session services and the session environment. Session services are retrieved via the getService method, while the session environment can be manipulated via the following methods: getEnvironment, getEffectiveEnvironment, and setEnvironment.
The SessionManager interface provides no methods or constructors and only two variables (SCOPE_ATTR_ID and SESSION_MANAGER) for defining the scope and domain of the SessionManager. See the SessionManager interface in the Reference Guide for more specific information on these variables.
As the top level session, SessionManager is responsible for loading and managing initial providers. The SessionManager interface manages initial sessions by loading them via the InitialSessionFactory property and maintaining the load order as the preferred service-request order.
Getting a SessionManager requires, at a minimum, the following code:
// Initialize Factories
SessionEnv environment = new SessionEnv();
// Get the session manager
sm = SessionManagerFactory.getSessionManager(environment);
Each initial Session should be able to validate its sessions whenever requested to do so by calling the Session.validateLinks method.
By default, setting the environment on a parent session affects all of its children the same way. This is because the actual environment checked for modified behavior is the inherited, or effective, environment. To override this inherited behavior, the environment key/value pair should be set per child session, or removed from the parent.
The com.novell.service.session.bindery package provides a default implementation of sessions using a NetWare 3.x or 4.x server (if intended to be authenticated bindery) connections and security models. The bindery is contained in a flat hierarchy with no parent bindery sessions. Only one class, Bindery, of the bindery package is made public.
The com.novell.service.session.nds package provides a default implementation of sessions using NetWare 4.x and newer server connection and security models. NDSSessions are contained in a two-level hierarchy with NDSTreeSessions as parents of NDSServerSessions. Only one class, NDS, of the Session.NDS package is made public.
The com.novell.service.session.xplat package provides static attribute values and environment keys for Xplat-based providers. It provides for both bindery and NDS type sessions that have common roots in NetWare; thus both type sessions share some implementation in the session.xplat package. Only one class, Xplat, of the Session.Xplat package is made public.
Listed below are some important Session Manager methods of which to be aware. For a complete list of available methods, go to the Reference Guide documentation. Note that all other methods in the Authenticatable interface have been depreciated.
The relationship between the Session Manager interfaces and classes is illustrated in the diagram below, followed by a brief description of the relationship each interface and class has with other interfaces and classes.
Figure 2-14 Session Manager Interfaces and Classes

In this diagram of interfaces and classes a solid red line ending with a solid arrow represent an extension of a class or interface. The dotted black lines ending with a small solid arrow imply some relationships between the different interfaces and classes. Links are provided to the Reference Guide documentation for each of these important Session interfaces and classes.