com.sap.mdm.examples
Class AuthenticatedRepositorySession

java.lang.Object
  extended bycom.sap.mdm.examples.AuthenticatedRepositorySession

public class AuthenticatedRepositorySession
extends Object

Represents an authenticated user session from the API to an MDM repository. Source code for AuthenticatedRepositorySession.java


Field Summary
 int state
          State of the session
static int STATE_CONNECTED
          Connected, but no session established yet
static int STATE_NOT_CONNECTED
          Initial state: Not (yet) even connected
static int STATE_SESSION_AUTHENTICATED
          Ready state: Authenticated user session is established and ready to be used
static int STATE_SESSION_ESTABLISHED
          Connected, session established, but not yet authenticated
 
Constructor Summary
AuthenticatedRepositorySession()
          Prepare session creation using default settings
AuthenticatedRepositorySession(Settings settings)
          Prepare session creation from specific settings
AuthenticatedRepositorySession(Settings settings, ConnectionAccessor connection)
           
 
Method Summary
 void create()
          Create and authenticate a new user session to an MDM repository.
 void destroy()
          Destroy the session and free reserved resources.
 ConnectionAccessor getConnection()
          Gets the connection to the MDM server created within the create() method.
 String getSession()
          Gets the session id.
static void main(String[] args)
          Simple main method for testing purposes.
 String toString()
          Return the session state in human-readable format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

state

public int state
State of the session


STATE_NOT_CONNECTED

public static final int STATE_NOT_CONNECTED
Initial state: Not (yet) even connected

See Also:
Constant Field Values

STATE_CONNECTED

public static final int STATE_CONNECTED
Connected, but no session established yet

See Also:
Constant Field Values

STATE_SESSION_ESTABLISHED

public static final int STATE_SESSION_ESTABLISHED
Connected, session established, but not yet authenticated

See Also:
Constant Field Values

STATE_SESSION_AUTHENTICATED

public static final int STATE_SESSION_AUTHENTICATED
Ready state: Authenticated user session is established and ready to be used

See Also:
Constant Field Values
Constructor Detail

AuthenticatedRepositorySession

public AuthenticatedRepositorySession()
                               throws ConnectionException
Prepare session creation using default settings


AuthenticatedRepositorySession

public AuthenticatedRepositorySession(Settings settings)
                               throws ConnectionException
Prepare session creation from specific settings

Parameters:
settings - use these parameters for session creation and authentication

AuthenticatedRepositorySession

public AuthenticatedRepositorySession(Settings settings,
                                      ConnectionAccessor connection)
Method Detail

create

public void create()
            throws ConnectionException,
                   CommandException
Create and authenticate a new user session to an MDM repository.

Throws:
ConnectionException - is propagated from the API
CommandException - is propagated from the API

destroy

public void destroy()
             throws CommandException
Destroy the session and free reserved resources. In addition the connection is closed. This method should be called as soon as a session is not needed any longer.

Throws:
CommandException - is propagated from the API

getConnection

public ConnectionAccessor getConnection()
Gets the connection to the MDM server created within the create() method.

Returns:
ConnectionAccessor

getSession

public String getSession()
Gets the session id.

Returns:
authenticated user session

toString

public String toString()
Return the session state in human-readable format.

See Also:
Object.toString()

main

public static void main(String[] args)
Simple main method for testing purposes.

Parameters:
args - are not supported


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.