/* **************************************************************************

  $Archive: /njcl_v2rmi/src/com/novell/service/session/nds/NDSTreePersistenceService.java $
  $Revision: 9 $
  $Modtime: 1/12/01 3:49p $

  Copyright (c) 1997 Novell, Inc.  All Rights Reserved.

  THIS WORK IS  SUBJECT  TO  U.S.  AND  INTERNATIONAL  COPYRIGHT  LAWS  AND
  TREATIES.   NO  PART  OF  THIS  WORK MAY BE  USED,  PRACTICED,  PERFORMED
  COPIED, DISTRIBUTED, REVISED, MODIFIED, TRANSLATED,  ABRIDGED, CONDENSED,
  EXPANDED,  COLLECTED,  COMPILED,  LINKED,  RECAST, TRANSFORMED OR ADAPTED
  WITHOUT THE PRIOR WRITTEN CONSENT OF NOVELL, INC. ANY USE OR EXPLOITATION
  OF THIS WORK WITHOUT AUTHORIZATION COULD SUBJECT THE PERPETRATOR TO
  CRIMINAL AND CIVIL LIABILITY.

****************************************************************************/
package com.novell.service.session.nds;

import java.rmi.*;
import java.rmi.server.UnicastRemoteObject;
import com.novell.service.session.Session;
import com.novell.service.session.xplat.PersistenceService;
import com.novell.service.session.xplat.Connection;
import com.novell.service.session.spi.*;
import com.novell.service.session.SessionException;
import com.novell.service.session.spi.InvalidSessionState;

/**@internal
 *
 */
public class NDSTreePersistenceService extends UnicastRemoteObject
implements PersistenceService
{
   SessionImpl session;

   NDSTreePersistenceService
   (
      SessionImpl session,
      RMISocketFactories x
   )
   throws RemoteException
   {
      super(x.getPort(), x.getClientSocketFactory(), x.getServerSocketFactory());
      this.session = session;
   }

   NDSTreePersistenceService
   (
      SessionImpl session
   )
   throws RemoteException
   {
      this.session = session;
   }

   public void persist
   (
   )
   throws SessionException, RemoteException
   {
      NDSContextSessionState state = (NDSContextSessionState)session.getState();
      state.context.getConnection().keep();
   }

/* This method is commented out in the interface and thus is not available from a remote object
   private void desist
   (
   )
   throws SessionException, java.rmi.RemoteException
   {
      NDSContextSessionState state = (NDSContextSessionState)session.getState();
      state.context.close();
      Session parent = session.getParent();
      InvalidSessionState.makeInvalid(
         (SessionImpl)session,
         new SessionException("NDSTreePersistenceService.desist() called"));
//      parent.invalidate(session);
      session.close();
      parent.validateLinks();
   }
*/
}
