X4 Produktdokumentation

Microsoft Azure Table Storage Connector

This adapter allows you to connect to a Microsoft Azure table storage to perform various operations.

Properties

Operation

Operation executed by the adapter

Possible values:

  • CreateTable: Creates a new table
    Required parameters: tableName

  • ListTable: Lists all tables.

  • DeleteTable: Deletes an existing table
    Required parameters: TableName

  • InsertEntity: Inserts the entity if the entity does not already exist or replaces an existing entity.
    After the operation is successful, the table contains the new entity with the defined properties, and the previous entity and its properties are replaced.
    Required parameters: tableName, partitionKey, rowKey

  • InsertBatchEntities: Inserts multiple entities with one write operation or replaces existing entities. Uses the InsertOrReplace entity.
    Required parameters: tableName

  • RetrieveEntity: Retrieves a single, specified entity
    Required parameters: tableName, partitionKey, rowKey

  • RetrieveAllEntities: Retrieves all entities from a specific partitionKey.
    Required parameters: tableName, partitionKey

  • RetrieveRangeEntities: Retrieves a set of entities using the partitionKey and filters by a set of rowKey values. The partitionKey value identifies a specific partition, and the rowKey values identify a subset of the entities of that partition.
    Required parameters: tableName, partitionKey, rowKey, filterCondition

  • DeleteEntity: Deletes a single entity.
    Required parameters: TableName, partitionKey, rowKey

  • ModifyEntity: Modifies an entity and selects between a merge and a replace operation using the replaceExistingItems parameter check.
    If the replace operation is selected (replaceExistingItems="true"), then only the specified properties are retained after the operation, all other properties are deleted.
    If the merge operation is selected (replaceExistingItems="false"), all properties are retained and the existing ones are updated.
    Required parameters: tableName, partitionKey, rowKey, replaceExistingItems

  • QuerySubsetOfEntityProperties: Retrieves a subset of entity properties according to an XML input.
    If rowKey and partitionKey are specified, only the appropriate properties of the entities are retrieved.
    If neither rowKey nor partitionKey are specified, then all properties of the table entities are retrieved. The output of this operation is an XML file that contains the subset of properties within a parent for each associated entity.
    Required parameters: tableName, partitionKey, rowKey

Parameters

accountName

Name of the Microsoft Azure account

Possible values: Any valid string (for example, softproject)

accountKey

Password for the Microsoft Azure account

Possible values: Any string containing the key provided by Microsoft Azure, such as AD9ohFhJ6Hve9ODJEXTw53MjR1tjoUZ8lWfDlw5UFqGMih3VtUCapIfEMBmITeShQN9MbCITE4SzxTcGIybw==

endPoint

Azur Cosmos DB endpoint

tableName

Name of the table in which the entities are stored

Possible values: String containing the ID for the new table

info Table names must meet the same naming conventions as database IDs. Database names must be between 1 and 255 characters long and cannot be / \ # ? There is a space left.

partitionKey

Element of the primary key

Entities with the same partition key can be queried more quickly and inserted/updated in atomic operations.

Possible values: Any string containing the partition key

rowKey

Element of the primary key

An entity's line key is its unique identifier within a partition.

Possible values: Any string containing the line key

filterCondition

Compares partitionKey and rowKey

Possible values:

  • EQUAL

  • GREATER_THAN

  • GREATER_THAN_OR_EQUAL

  • LESS_THAN

  • LESS_THAN_OR_EQUAL

  • NOT_EQUAL

replaceExistingItems

Specifies whether ModifyEntity performs a merge or replace operation. For more information, visit http://azure.github.io/azure-storage-java/.

Possible values:

  • true: Run the Replace operation

  • false: Run the Merge operation

Status values

1

The adapter operation was executed successfully

-1

An error occurred while running the adapter

0

Operation CreateTable: The table could not be created, but neither an error nor an exception was returned.

DeleteTable operation: The specified tableName does not exist.

Input

The adapter expects a predefined XML structure as input.

  • An XML file with the following structure is expected for the InsertEntity operation:

    Expected structure for the InsertEntity operation

    XML
    <?xml version="1.0" encoding="UTF-8"
    <Entity>
        <Properties1 name="Department" value="ITAdministration"/>
        <Properties2 name="Address" value="C\Pirandello"/>
        <Properties3 name="Name" value="Paolo"/>
        <Properties4 name="Surname" value="Green"/>
    </Entity>
    

    The name property cannot be a protected word, such as Id.

  • The ModifyEntity operation expects an XML file with the following structure and properties with the same name and value are updated:

    Expected structure for the ModifyEntity operation

    XML
    <?xml version="1.0" encoding="UTF-8" ?>
    <Entity>
    	<Properties name="Name" value="Carlos" />
    </Entity>
    
  • The QueryOfSubsetEntityProperties operation expects an XML file that specifies the required properties:

    Expected structure for the QueryOfSubsetEntityProperties operation

    XML
    <?xml version="1.0" encoding="UTF-8" ?>
    <Entity>
    	<Property name="Department" />
    	<Property name="Surname" />
    	<Property name="nonExistingProperty" />
    </Entity>
    

Output

The adapter returns different types of documents, depending on the operation you are performing:

  • Output the RetrieveEntity operation:

    Output for the RetrieveEntity operation

    XML
    <?xml version="1.0" encoding="UTF-8"
    <Entity partitionKey="ITEmployee" rowKey="ref-0001">
        <Properties name="Department" value="ITAdministration"/>
        <Properties name="Address" value="C\Pirandello"/>
    	<Properties name="Surname" value="Green"/>    
    	<Properties name="Name" value="Paolo"/>
    </Entity>
    
  • Output the RetrieveAllEntities and RetrieveRangeEntities operation:

    Output for the RetrieveAllEntities and RetrieveRangeEntities operation

    XML
    <?xml version="1.0" encoding="UTF-8" ?>
    <ListEntities>
    	<Entity partitionKey="ITEmployee" rowKey="ref-0001">
    		<Properties name="Department" value="ITAdministration" />
    		<Properties name="Address" value="C\Pirandello" />
    		<Properties name="Surname" value="Green" />
    		<Properties name="Name" value="Paolo" />
    	</Entity>
    	<Entity partitionKey="ITEmployee" rowKey="ref-0002">
    		<Properties name="Department" value="Developments" />
    		<Properties name="Address" value="C\Francisco" />
    		<Properties name="Surname" value="Lopez" />
    		<Properties name="Name" value="Luis" />
    	</Entity>
    	<Entity partitionKey="ITEmployee" rowKey="ref-0003">
    		<Properties name="Department" value="Sales" />
    		<Properties name="Address" value="C\Espada" />
    		<Properties name="Surname" value="Red" />
    		<Properties name="Name" value="Paula" />
    	</Entity>
    </ListEntities>
    
  • Output of the QueryOfSubsetEntityProperties operation:

    Output for the QueryOfSubsetEntityProperties operation

    XML
    <?xml version="1.0" encoding="UTF-8" ?>
    <ListEntities>
    	<Entity>
    		<Property partitionKey="ITEmployee" />
    		<Property rowKey="ref-0001" />
    		<Property name="Department" value="ITAdministration" />
    		<Property name="nonExistingProperty" />
    		<Property name="Surname" value="Green" />
    	</Entity>
    </ListEntities>
    

    The two properties partitionKey and rowKey are always returned because they can be used to uniquely identify the entity. Since the operation is able to return multiple properties from more than one object, it is important to map the properties to the associated entity.