public class

DynamicsCRMOnpremiseConnector

extends BaseDynamicsCRMConnector
java.lang.Object
   ↳ org.mule.module.dynamicscrm.BaseDynamicsCRMConnector
     ↳ org.mule.module.dynamicscrmonpremise.DynamicsCRMOnpremiseConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Microsoft Dynamics CRM 2011 Onpremise version

This connector allow the integration with MS Dynamics CRM 2011 Onpremise version.

The service of MS Dynamics CRM provide a few operations that are extensible for all the entities (default and custom) created. A list of the default entities can be found in the MSDN documentation link: "http://msdn.microsoft.com/en-us/library/bb959317.aspx

The connector uses Kerberos/SPNEGO with Active Directory for Authentication.

If you are going to use this connector be sure to have your environment well configured. This requires a CRM Onpremise 2011 Server (Windows 2008 Server x64) running in a Active Directory Domain with a SPN configured over HTTP/... Also the DNS configuration for the CRM server and the Kerberos/AD server.

Debug purposes:

---------------

To add debug in Kerberos/SPNEGO flow add this parameters in the VM params:

-Dsun.security.krb5.debug=true

-Dsun.security.spnego.debug=true

Login Config File

-----------------

Create a new file with the next configuration in your server:

********************************************************************************************

Kerberos {

com.sun.security.auth.module.Krb5LoginModule required debug=true;

};

********************************************************************************************

i.e. In this case, Kerberos is the only module configured, and it will be the param to be used in loginConfigModule=Kerberos

Kerberos Config File

--------------------

Create a new file with the next configuration in your server:

********************************************************************************************

[libdefaults]

default_realm = <YOUR_REALM>

default_tkt_enctypes = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc

default_tgs_enctypes = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc

permitted_enctypes = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc

[realms]

<YOUR_REALM> = {

kdc = <Kerberos_location>

default_domain = <YOUR_REALM>

}

[domain_realm]

.<your_realm> = <YOUR_REALM>

<your_realm> = <YOUR_REALM>

********************************************************************************************

Please note the upper and lower case.

Summary

Fields
private String keyIdentifier Session identifier
protected final Log logger
[Expand]
Inherited Fields
From class org.mule.module.dynamicscrm.BaseDynamicsCRMConnector
Public Constructors
DynamicsCRMOnpremiseConnector()
Public Methods
void associate(String entityName, String entityId, Boolean relationshipEntityRoleIsReferenced, String relationshipSchemaName, List<Map<String, Object>> relatedEntitiesAttributes)
Associate a set of entities

synchronized void connect(String username, String password, String organizationServiceUrl, String spn, String realm, String kdcLocation, String kerberosConfigFile)
Testing phrase

test two

String create(String logicalName, Map<String, Object> entity)
Create entity

void delete(String logicalName, String guid)
Delete entity

void disassociate(String entityName, String entityId, Boolean relationshipEntityRoleIsReferenced, String relationshipSchemaName, List<Map<String, Object>> relatedEntitiesAttributes)
Disassociate a set of entities

synchronized void disconnect()
Map<String, Object> execute(String requestName, String requestGuid, Map<String, Object> requestParameters)
Execute a business logic method

String getFileSystemUri()
MetaData getMetadata(MetaDataKey key)
List<MetaDataKey> getMetadataKeys()
boolean isConnected()
Map<String, Object> retrieve(String logicalName, String guid, List<String> attributes)
Retrieve entity

List<Map<String, Object>> retrieveMultipleByAttributes(String entityName, List<String> columns, List<String> attributes, List<String> values, Map<String, String> orders, Integer count, Integer pageNumber, String pagingCookie, Boolean returnTotalRecordCount)
This method is deprecated. Use retrieveMultipleByQuery instead
PagingDelegate<Map<String, Object>> retrieveMultipleByQuery(DsqlQuery query, PagingConfiguration pagingConfiguration)
Retrieve multiple entities by a query described by and XML

The definition of the Microsoft XML Query Language can be found in the Schema Definition in this link: http://msdn.microsoft.com/en-us/library/bb930489.aspx

The aggregation examples can be found in this link: http://msdn.microsoft.com/en-us/library/gg309565.aspx

void update(String logicalName, String guid, Map<String, Object> attributesToUpdate)
Update entity

[Expand]
Inherited Methods
From class org.mule.module.dynamicscrm.BaseDynamicsCRMConnector
From class java.lang.Object

Fields

private String keyIdentifier

Session identifier

protected final Log logger

Public Constructors

public DynamicsCRMOnpremiseConnector ()

Public Methods

public void associate (String entityName, String entityId, Boolean relationshipEntityRoleIsReferenced, String relationshipSchemaName, List<Map<String, Object>> relatedEntitiesAttributes)

Associate a set of entities

Parameters
entityName Logical name of entity
entityId Guid of entity in string form
relationshipEntityRoleIsReferenced If the role of the entity is "Referenced" (true) of "Referencing" (false)
relationshipSchemaName The type of relationship
relatedEntitiesAttributes List of the attributes of related entities
Throws
IOrganizationServiceAssociateOrganizationServiceFaultFaultFaultMessage If associate fails

public synchronized void connect (String username, String password, String organizationServiceUrl, String spn, String realm, String kdcLocation, String kerberosConfigFile)

Testing phrase

test two

Parameters
username Username
password Password
organizationServiceUrl The path to the MS Dynamics Configuration scv
spn The Service Provider Name of the Dynamics Server in OnPremise mode (this can be found in the organizationServiceUrl, under \)
realm The realm of the Authentication server (generally in upper case format)

Generate a default config file using only as dinamic parameters the realm and the kdcLocation

The configuration generated is:

 [libdefaults]
 default_realm = realm
 default_tkt_enctypes = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc
 default_tgs_enctypes = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc
 permitted_enctypes   = rc4-hmac aes128-cts des3-cbc-sha1 des-cbc-md5 des-cbc-crc

[realms]
 realm = {
 kdc = kdcLocation
 }
 [domain_realm]
 .realmInLowerCase = realm
 realmInLowerCase = realm
 
 
kdcLocation The location of the Authentication server (used in the config example for realm paramameter)
kerberosConfigFile If this is specified realm and kdcLocation are ignored. You can pass the Kerberos config file as a raw String with line breaks using the ? (interrogation) character
Throws
ConnectionException If the connection failed

public String create (String logicalName, Map<String, Object> entity)

Create entity

Parameters
logicalName A logical name
entity An entity object represented as a map
Returns
  • The GUID of the created entity.
Throws
IOrganizationServiceCreateOrganizationServiceFaultFaultFaultMessage If create fails
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails

public void delete (String logicalName, String guid)

Delete entity

Parameters
logicalName Logical name of the entity to be updated
guid The guid of the entity to be retrieved
Throws
IOrganizationServiceDeleteOrganizationServiceFaultFaultFaultMessage If delete fails

public void disassociate (String entityName, String entityId, Boolean relationshipEntityRoleIsReferenced, String relationshipSchemaName, List<Map<String, Object>> relatedEntitiesAttributes)

Disassociate a set of entities

Parameters
entityName Logical name of entity
entityId Guid of entity in string form
relationshipEntityRoleIsReferenced If the role of the entity is "Referenced" (true) of "Referencing" (false)
relationshipSchemaName The type of relationship
relatedEntitiesAttributes List of the attributes of related entities
Throws
IOrganizationServiceDisassociateOrganizationServiceFaultFaultFaultMessage If disassociate fails

public synchronized void disconnect ()

Throws
IOException

public Map<String, Object> execute (String requestName, String requestGuid, Map<String, Object> requestParameters)

Execute a business logic method

Parameters
requestName Logical name of request to be made
requestGuid The guid of the request to me made
requestParameters A collection of parameters to the request in Map form
Returns
  • organization response to execute request
Throws
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails

public String getFileSystemUri ()

public MetaData getMetadata (MetaDataKey key)

Parameters
key
Throws
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage

public List<MetaDataKey> getMetadataKeys ()

Throws
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage

public boolean isConnected ()

public Map<String, Object> retrieve (String logicalName, String guid, List<String> attributes)

Retrieve entity

Parameters
logicalName Name od the entity to be retrieved
guid The guid of the entity to be retrieved
attributes Attributes that will be retrieved from the entity specified
Returns
  • attributes of specified entity in Map form
Throws
IOrganizationServiceRetrieveOrganizationServiceFaultFaultFaultMessage If retrieve fails

public List<Map<String, Object>> retrieveMultipleByAttributes (String entityName, List<String> columns, List<String> attributes, List<String> values, Map<String, String> orders, Integer count, Integer pageNumber, String pagingCookie, Boolean returnTotalRecordCount)

This method is deprecated.
Use retrieveMultipleByQuery instead

Retrieve multiple entities by attributes values and sorting options

Parameters
entityName Name of the entity type
columns Columns to retrieve
attributes Attributes to filter by
values Values of the attributes
orders Ordering fields, key is the name, value is "Ascending" or "Descending"
count Number of rows to retrieve
pageNumber Number of page to retrieve
pagingCookie Paging cookie
returnTotalRecordCount If total record count should be returned
Returns
  • entities retrieved
Throws
IOrganizationServiceRetrieveMultipleOrganizationServiceFaultFaultFaultMessage If retrieveMultiple fails

public PagingDelegate<Map<String, Object>> retrieveMultipleByQuery (DsqlQuery query, PagingConfiguration pagingConfiguration)

Retrieve multiple entities by a query described by and XML

The definition of the Microsoft XML Query Language can be found in the Schema Definition in this link: http://msdn.microsoft.com/en-us/library/bb930489.aspx

The aggregation examples can be found in this link: http://msdn.microsoft.com/en-us/library/gg309565.aspx

Parameters
query Query XML
pagingConfiguration The configuration for the pagination feature
Returns
  • A paging delegate with all the entities. This handles pagination internally on-demand.
Throws
IOrganizationServiceRetrieveMultipleOrganizationServiceFaultFaultFaultMessage If retrieveMultiple fails

public void update (String logicalName, String guid, Map<String, Object> attributesToUpdate)

Update entity

Parameters
logicalName Logical name of the entity to be updated
guid The guid of the entity to be retrieved
attributesToUpdate The attributes that will be updated, in Map form
Throws
IOrganizationServiceUpdateOrganizationServiceFaultFaultFaultMessage If update fails
IOrganizationServiceRetrieveOrganizationServiceFaultFaultFaultMessage If update fails
IOrganizationServiceExecuteOrganizationServiceFaultFaultFaultMessage If execute fails