Show / Hide Table of Contents

# Interface IELMService

This interface has operations for ELM management.

##### Syntax

    public interface IELMService

### Methods

#### AddPermission(ELMProduct, Guid, DateTime)

Adds a license permission to a user or group for the specified product.

##### Declaration

    int AddPermission(ELMProduct product, Guid guidOfUserOrGroup, DateTime expiry)

##### Parameters

Type | Name | Description
--- | --- | ---
ELMProduct | product | The product to which the license permission is to be added.
Guid | guidOfUserOrGroup | The Guid of the user or group to whom the permission is to be added.
DateTime | expiry | The UTC date and time of the expiry of the permission.

##### Returns

Type | Description
--- | ---
Int32 | The Id of the newly created permission.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.
ELMFault | Thrown in the following cases: With error code "ELM+ExpiryIsBackInTime" if expiry is back in time. With error code "ELM+UserOrGroupDoesNotExist" if guidOfUserOrGroup does not represent a valid user or group. With error code "ELM+ProductDoesNotExist" the product does not exist. With error code "ELM+ValidPermissionAlreadyExistsForUser" if a valid (unexpired) permission already exists for the user/group for the product.

#### AssignLicense(ELMProduct, Guid, DateTime)

Assigns a license to the specified user for the specified product. Available only if the server is using ELM licensing, otherwise throws a fault.

##### Declaration

    Guid AssignLicense(ELMProduct product, Guid userGuid, DateTime expiry)

##### Parameters

Type | Name | Description
--- | --- | ---
ELMProduct | product | The product for which license is to be allocated.
Guid | userGuid | The user to whom the license is to be assigned.
DateTime | expiry | The expiry of the license (UTC time). Has to be a date and time in the future.

##### Returns

Type | Description
--- | ---
Guid | The Guid of the new license assignment.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.
ELMFault | Thrown in the following cases: With error code "ELM+ServerUsingCALLicensing" if the server is using CAL licensing. With error code "ELM+ExpiryIsBackInTime" if expiry is back in time. With error code "ELM+UserDoesNotExist" if user does not exist. With error code "ELM+ProductDoesNotExist" if product does not exist. With error code "ELM+NoLicenseIsAvailable" if no free license is available. for the product. With error code "ELM+ValidLicenseAlreadyExistsForUser" if a valid license already exists for the user for the product.

#### ListELMPools()

Returns the list of the ELM license pools available on the computer.

##### Declaration

    ELMPoolInfo[] ListELMPools()

##### Returns

Type | Description
--- | ---
ELMPoolInfo[] | The array of the license pools.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.

#### ListLicenseAssignments(ELMProduct, Boolean)

Returns the list of license assignments. Does not throw if the product does not exist on the system, an empty array is returned in this case. Available only if the server is using ELM licensing, otherwise throws a fault.

##### Declaration

    ELMAssignment[] ListLicenseAssignments(ELMProduct product, bool includeExpiredAndReturned)

##### Parameters

Type | Name | Description
--- | --- | ---
ELMProduct | product | The product for which assignments are to be returned.
Boolean | includeExpiredAndReturned | Indicates whether expired and returned license assignments are also to be included in the list.

##### Returns

Type | Description
--- | ---
ELMAssignment[] | An array of license assignments.

##### Exceptions

Type | Condition
--- | ---
ELMFault | Thrown in the following cases: With error code "ELM+ServerUsingCALLicensing" if the server is using CAL licensing.

#### ListLicensePermissions(ELMProduct, Boolean)

Returns the list of (manual) license permission assignment. Does not throw if the product does not exist on the system, an empty array is returned in this case.

##### Declaration

    ELMPermission[] ListLicensePermissions(ELMProduct product, bool includeExpired)

##### Parameters

Type | Name | Description
--- | --- | ---
ELMProduct | product | The product for which permissions are to be returned.
Boolean | includeExpired | Indicates whether expired and permissions are also to be included in the list.

##### Returns

Type | Description
--- | ---
ELMPermission[] | An array of license permissions.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.

#### ListProjectPermissions()

Returns the list of project permissions for licenses.

##### Declaration

    ELMProjectPermission[] ListProjectPermissions()

##### Returns

Type | Description
--- | ---
ELMProjectPermission[] | The array of the project permissions.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.

#### RevokeAssignment(Guid)

Revokes the specified license assignment (makes it returned with the current date and time). memoQWeb licenses can not be revoked. Available only if the server is using ELM licensing, otherwise throws a fault.

##### Declaration

    void RevokeAssignment(Guid assignmentGuid)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | assignmentGuid |

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.
ELMFault | Thrown in the following cases: With error code "ELM+ServerUsingCALLicensing" if the server is using CAL licensing. With error code "ELM+LicenseDoesNotExist" if license assignment does not exist. With error code "ELM+LicenseIsReturned" if the license is returned. With error code "ELM+WebTransLicenseCanNotBeRevoked" if the license is a memoQWeb license.

#### RevokePermission(Int32)

Revokes the specified permission.

##### Declaration

    void RevokePermission(int permissionId)

##### Parameters

Type | Name | Description
--- | --- | ---
Int32 | permissionId | The Id of the permission.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.

#### SetAssignmentExpiry(Guid, DateTime)

Sets the expiry of the license assignment. Available only if the server is using ELM licensing, otherwise throws a fault.

##### Declaration

    void SetAssignmentExpiry(Guid assignmentGuid, DateTime newExpiry)

##### Parameters

Type | Name | Description
--- | --- | ---
Guid | assignmentGuid | The Guid of the license assignment.
DateTime | newExpiry | The UTC date and time of the new expiry.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.
ELMFault | Thrown in the following cases: With error code "ELM+ServerUsingCALLicensing" if the server is using CAL licensing. With error code "ELM+ExpiryIsBackInTime" if expiry is back in time. With error code "ELM+LicenseDoesNotExist" if license assignment does not exist. With error code "ELM+LicenseIsReturned" if the license is returned.

#### SetPermissionExpiry(Int32, DateTime)

Sets the expiry of the license permission.

##### Declaration

    void SetPermissionExpiry(int permissionId, DateTime newExpiry)

##### Parameters

Type | Name | Description
--- | --- | ---
Int32 | permissionId | The Id of the permission.
DateTime | newExpiry | The UTC date and time of the expiry of the permission to be set.

##### Exceptions

Type | Condition
--- | ---
UnexpectedFault | An unexpected error occurred; equivalent of an 501 'Internal server error' http result.
GenericFault | The details within the fault identify the specific error. Thrown for expected business error that have no specific faults.
ELMFault | Thrown in the following cases: With error code "ELM+ExpiryIsBackInTime" if expiry is back in time. With error code "ELM+PermissionDoesNotExist" if the permission does not exist.