/** * Reserved for internal use. Generates the request identity, consisting of the specified entry * name, or the PartitionKey and RowKey pair from the operation, to identify the operation target. * * @param isSingleIndexEntry Pass <code>true</code> to use the specified <code>entryName</code> * parameter, or <code>false</code> to use PartitionKey and RowKey values from the operation * as the request identity. * @param entryName The entry name to use as the request identity if the <code>isSingleIndexEntry * </code> parameter is <code>true</code>. * @param encodeKeys Pass <code>true</code> to url encode the partition & row keys * @return A <code>String</code> containing the formatted request identity string. * @throws StorageException If a storage service error occurred. */ protected String generateRequestIdentity( boolean isSingleIndexEntry, final String entryName, boolean encodeKeys) throws StorageException { if (isSingleIndexEntry) { return String.format("'%s'", entryName); } if (this.opType == TableOperationType.INSERT) { return Constants.EMPTY_STRING; } else { String pk = null; String rk = null; if (this.opType == TableOperationType.RETRIEVE) { final QueryTableOperation qOp = (QueryTableOperation) this; pk = qOp.getPartitionKey(); rk = qOp.getRowKey(); } else { pk = this.getEntity().getPartitionKey(); rk = this.getEntity().getRowKey(); } return String.format( "%s='%s',%s='%s'", TableConstants.PARTITION_KEY, encodeKeys ? Utility.safeEncode(pk) : pk, TableConstants.ROW_KEY, encodeKeys ? Utility.safeEncode(rk) : rk); } }