NX Open C++ Reference Guide
Classes | Public Member Functions | List of all members
NXOpen::LicenseManager Class Reference

Provides utility methods for managing licenses. More...

Classes

struct  LicenseBundle
 License bundle structure containing name of license bundle and number of licenses checked out of the bundle. More...
 

Public Member Functions

std::vector< NXStringGetActiveLicensesInABundle (const NXString &bundleName)
 Returns the list of checked out licenses from the given bundle. More...
 
std::vector< NXStringGetActiveLicensesInABundle (const char *bundleName)
 Returns the list of checked out licenses from the given bundle. More...
 
std::vector
< NXOpen::LicenseManager::LicenseBundle
GetBundlesSelected ()
 Returns an array of license bundles in the form of a structure LicenseManager::LicenseBundle that are currently selected. More...
 
std::vector< NXStringGetBundlesUsed ()
 Returns the list of bundles that have licenses currently checked out. More...
 
std::vector< NXStringGetReservedLicenses (const NXString &contextName)
 Returns the licenses that are currently reserved against a context. More...
 
std::vector< NXStringGetReservedLicenses (const char *contextName)
 Returns the licenses that are currently reserved against a context. More...
 
void Release (const NXString &license, const NXString &contextName)
 Release a license against the specified license context. More...
 
void Release (const char *license, const char *contextName)
 Release a license against the specified license context. More...
 
void ReleaseAll (const NXString &contextName)
 Release all licenses against the specified license context. More...
 
void ReleaseAll (const char *contextName)
 Release all licenses against the specified license context. More...
 
void Reserve (const NXString &license, const NXString &contextName)
 Reserve a license against the specified license context. More...
 
void Reserve (const char *license, const char *contextName)
 Reserve a license against the specified license context. More...
 
void SetBundlesForUse (std::vector< NXString > &bundles)
 Changes the existing license bundle selection. More...
 
tag_t Tag () const
 Returns the tag of this object. More...
 

Detailed Description

Provides utility methods for managing licenses.


This class only manages the licenses that are used by the current NX Open application. If several applications are loaded in a session, each application will have its own independent license manager. It is possible for two applications to both reserve the same license. Although this will only reserve a single license from the FLEX server, the license will not be released to the server until both applications have released it.


As of NX6 the concept of User-Defined License Contexts has been introduced. This concept gives greater control of licensing of the application. To find out more about this topic, please reference the NXOpen Programmer's Guide. All user-defined context names have a max length of 128 characters long consisting of only numbers and letters.


The main NX User Interface will also manage licenses independently. If an NX Open application releases the "solid_modeling" license, but the main NX UI is still using that license, then it will not be returned to the server.


Methods for this class use the license feature name, which can be found in the documentation for NX Open methods and properties. This is in the format License requirements: license feature name ("license description"). For example, given License requirements: solid_modeling ("SOLIDS MODELING"), then the license feature name, solid_modeling would be used.


To obtain an instance of this class, refer to NXOpen::Session

Created in NX4.0.0.

Member Function Documentation

std::vector<NXString> NXOpen::LicenseManager::GetActiveLicensesInABundle ( const NXString bundleName)

Returns the list of checked out licenses from the given bundle.

Returns

Created in NX11.0.0.

License requirements : None
Parameters
bundleNamebundle name
std::vector<NXString> NXOpen::LicenseManager::GetActiveLicensesInABundle ( const char *  bundleName)

Returns the list of checked out licenses from the given bundle.

Returns

Created in NX11.0.0.

License requirements : None
Parameters
bundleNamebundle name
std::vector<NXOpen::LicenseManager::LicenseBundle> NXOpen::LicenseManager::GetBundlesSelected ( )

Returns an array of license bundles in the form of a structure LicenseManager::LicenseBundle that are currently selected.

Returns

Created in NX11.0.0.

License requirements : None
std::vector<NXString> NXOpen::LicenseManager::GetBundlesUsed ( )

Returns the list of bundles that have licenses currently checked out.

Returns

Created in NX11.0.0.

License requirements : None
std::vector<NXString> NXOpen::LicenseManager::GetReservedLicenses ( const NXString contextName)

Returns the licenses that are currently reserved against a context.

This method will also output the licenses reserved against the default context in the syslog.

Returns

Created in NX6.0.0.

License requirements : None
Parameters
contextNameName of context to release against. Will use the default context if NULL is specified.
std::vector<NXString> NXOpen::LicenseManager::GetReservedLicenses ( const char *  contextName)

Returns the licenses that are currently reserved against a context.

This method will also output the licenses reserved against the default context in the syslog.

Returns

Created in NX6.0.0.

License requirements : None
Parameters
contextNameName of context to release against. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::Release ( const NXString license,
const NXString contextName 
)

Release a license against the specified license context.


Created in NX6.0.0.

License requirements : None

Parameters
licenseLicense feature name to be released
contextNameName of context to release license against. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::Release ( const char *  license,
const char *  contextName 
)

Release a license against the specified license context.


Created in NX6.0.0.

License requirements : None

Parameters
licenseLicense feature name to be released
contextNameName of context to release license against. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::ReleaseAll ( const NXString contextName)

Release all licenses against the specified license context.

If the context specified is a user-defined context it will be deleted.
Created in NX6.0.0.

License requirements : None

Parameters
contextNameName of context release to release. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::ReleaseAll ( const char *  contextName)

Release all licenses against the specified license context.

If the context specified is a user-defined context it will be deleted.
Created in NX6.0.0.

License requirements : None

Parameters
contextNameName of context release to release. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::Reserve ( const NXString license,
const NXString contextName 
)

Reserve a license against the specified license context.

If the specified user-defined context does not already exist it will be created.
Created in NX6.0.0.

License requirements : None

Parameters
licenseLicense feature name to be reserved
contextNameName of context to reserve license against. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::Reserve ( const char *  license,
const char *  contextName 
)

Reserve a license against the specified license context.

If the specified user-defined context does not already exist it will be created.
Created in NX6.0.0.

License requirements : None

Parameters
licenseLicense feature name to be reserved
contextNameName of context to reserve license against. Will use the default context if NULL is specified.
void NXOpen::LicenseManager::SetBundlesForUse ( std::vector< NXString > &  bundles)

Changes the existing license bundle selection.

If the bundle switch fails because a license that is in use is not available in the new bundles, then an error will be returned and the bundle configuration will not be changed.
Created in NX11.0.0.

License requirements : None

Parameters
bundlesThe bundles are set in the same order as specified
tag_t NXOpen::LicenseManager::Tag ( ) const

Returns the tag of this object.


The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.