All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

System Class CATSysCAALM

CATSysCAALM
 

Usage: you must use this class as is. You should never derive it.


public class CATSysCAALM

Class providing access to CATIA's licensing subsystem.


Method Index


o Initialize(char*,unsigned long,RequestCallback,Handle&)
Initializes the licensing subsystem with the CAA2 partner data.
o Initialize(char*,unsigned long,char*,RequestCallback,Handle&)
Initializes the licensing subsystem with the CAA2 partner data.
o IsProductAuthorized(char*)
Checks whether a product is enabled or not.
o LM_Setup()
This is not a function member of the CATSysCAALM class but an entry point to be defined in a shared library.
o ReleaseProduct(Handle,char*)
Releases a product that is enabled.
o RequestProduct(Handle,char*)
Requests a product for enabling.
o Start()
Initializes the licensing subsystem.
o Stop(Handle)
Releases licenses requested and resources used by the CAA2 partner.
o UpdateWorkbenches()
Updates the workbenches, works only with a CATInteractiveApplication.
o callback(char*,unsigned long,unsigned long[2])
This is the function to be implemented by the CAA2 partner and passed to Initialize.

Enumerated Type Index


o CATSysCAALMStatus
Status code returned.

Methods


o Initialize
public static int Initialize( const char* iPartnerName,
unsigned long iPartnerKey,
RequestCallback iRCB,
Handle& ohandle)
Initializes the licensing subsystem with the CAA2 partner data. This call should only be made by the LM_Setup entry point.
Parameters:
iPartnerName
The name of the CAA2 partner as specified by the SetPartner in the product identity card.
iPartnerKey
The confidential 32-bit integer assigned specifically to the CAA2 partner by DS.
iRCB
The pointer to a function implemented by the CAA2 partner that will be called for license operations. See RequestCallback for details.
ohandle
A Handle variable that will contain the CAA2 partner data upon return.
Returns:
success
invalidPartner
o Initialize
public static int Initialize( const char* iPartnerName,
unsigned long iPartnerKey,
const char* iICPath,
RequestCallback iRCB,
Handle& ohandle)
Initializes the licensing subsystem with the CAA2 partner data. This call should be made by the LM_Setup entry point. There are two different behaviours of the licensing subsystem:
  • the interactive mode, where licenses are read from settings (no need to call RequestProduct) and checked every 20 minutes.
  • the non-interactive mode, where licenses must be requested with RequestProduct and are not checked.
  • This should be the first call made by the application.
    Parameters:
    iPartnerName
    The name of the CAA2 partner as specified by the SetPartner in the product identity card.
    iPartnerKey
    The confidential 32-bit integer assigned specifically to the CAA2 partner by DS.
    iICPath
    A directory path where all the product identity cards are located.
    A NULL value indicates that the interactive mode will be activated.
    iRCB
    The pointer to a function implemented by the CAA2 partner that will be called for license operations. See RequestCallback for details.
    ohandle
    A Handle variable that will contain the CAA2 partner data upon return.
    Returns:
    success
    invalidICPath
    invalidPartner
    Deprecated:
    V5R16
    o IsProductAuthorized
    public static int IsProductAuthorized( const char* iproductName)
    Checks whether a product is enabled or not.
    Parameters:
    iProductName
    The name of the product (ie "ABC.prd")
    Returns:
    0 - the product is not enabled.
    non 0 - the product is enabled.
    o LM_Setup
    public void LM_Setup()
    This is not a function member of the CATSysCAALM class but an entry point to be defined in a shared library.
    Partners must normally deliver a shared library with a name of the form ABC_LM where ABC is the partner name as defined in the product identification card. The purpose of this entry point is to let the partner code perform all required initializations and to call Initialize.
    Please note that LM_Setup should be declared as extern "C". On Windows systems, it should also be declared as an exported symbol with __declspec (export).
    o ReleaseProduct
    public static int ReleaseProduct(Handle ihandle,
    const char* iProductName)
    Releases a product that is enabled.
    Parameters:
    ihandle
    The Handle variable that was passed to Initialize.
    iProductName
    The name of the product like ABC.prd
    Returns:
    sucess
    error - data returned by the callback is invalid.
    notInilialized
    invalidProduct
    invalidHandle
    o RequestProduct
    public static int RequestProduct(Handle ihandle,
    const char* iProductName)
    Requests a product for enabling.
    Parameters:
    ihandle
    The Handle variable that was passed to Initialize.
    iProductName
    The name of the product like ABC.prd
    Returns:
    sucess
    error - data returned by the callback is invalid.
    notInilialized
    invalidProduct
    invalidHandle
    o Start
    public static int Start()
    Initializes the licensing subsystem. This will call the LM_Setup entry point. Use this method in non-interactive mode.
    Returns:
    success
    error
    o Stop
    public static int Stop(Handle ihandle)
    Releases licenses requested and resources used by the CAA2 partner.
    Parameters:
    iohandle
    The Handle variable that was passed to Initialize.
    Returns:
    success
    invalidHandle
    o UpdateWorkbenches
    public static int UpdateWorkbenches()
    Updates the workbenches, works only with a CATInteractiveApplication.
    Returns:
    sucess
    error - unable to update workbenches.
    o callback
    public int callback( const char* iProductName,
    unsigned long iProductID,
    unsigned long[2] ioData)
    This is the function to be implemented by the CAA2 partner and passed to Initialize. It is not part of CATSysCAALM but included here only for documentation purpose.
    It is called when the licensing subsystem needs to probe, request, check, release... a license. Data returned represents a boolean indicating whether the operation has succeeded or failed.
    Parameters:
    iProductName
    The name of the product of the form ABC.prd
    iProductID
    The 32-bit integer specified by the SetLicense of the product identity card.
    ioData
    Two 32-bit integers that are used for verification. If the operation succeeds then ioData[0] must be XORed with the partner key and ioData[1] must also by XORed the product ID (2nd parameter). Any other value implies that the operation has failed.
    On input, bits 12-15 of the first word ((ioData[0] >> 12) & 0xf) represents a value describing the operation to be performed:
  • 0 - check that the license is present
  • 1 - request the license
  • 2 - check that the license (previously requested) is still granted
  • 3 - release the license (previously requested)
  • 4 - check if the product must be displayed in Tools/Options/Licensing tab (success -> displayed)
  • Enumerated Types


    o CATSysCAALMStatus
    enum CATSysCAALMStatus {
      success,
      error,
      notInitialized,
      alreadyInitialized,
      notRequested,
      invalidPartner,
      invalidProduct,
      invalidICPath,
      invalidHandle
    }
    
    Status code returned.
    Parameters:
    success
    The requested action has completed successfully.
    error
    Catch-all error code.
    notInitialized
    Initialize has not been called.
    alreadyInitialized
    The licensing subsystem is already initialized by way of Initialize or another CATIA's function. CAALM might not function.
    invalidPartner
    The specified CAA2 partner name and key are not recognized.
    invavlidProduct
    The specified product is unknown or cannot be handled by the current CAA2 partner.
    invalidICPath
    The specified directoty does not contain any product identity card.
    invalidHandle
    The specified Handle variable does not contain valid data.

    This object is included in the file: CATSysCAALM.h
    If needed, your Imakefile.mk should include the module: JS0GROUP

    Copyright © 2003, Dassault Systèmes. All rights reserved.