* @param encodedKey the string-encoded composite flow execution key
* @return the composite key parts as a String array (executionId = 0, snapshotId = 1)
*/
public static String[] keyParts(String encodedKey) throws BadlyFormattedFlowExecutionKeyException {
if (!encodedKey.startsWith(EXECUTION_ID_PREFIX)) {
throw new BadlyFormattedFlowExecutionKeyException(encodedKey, FORMAT);
}
int snapshotStart = encodedKey.indexOf(SNAPSHOT_ID_PREFIX, EXECUTION_ID_PREFIX.length());
if (snapshotStart == -1) {
throw new BadlyFormattedFlowExecutionKeyException(encodedKey, FORMAT);
}
String executionId = encodedKey.substring(EXECUTION_ID_PREFIX.length(), snapshotStart);
String snapshotId = encodedKey.substring(snapshotStart + SNAPSHOT_ID_PREFIX.length());
return new String[] { executionId, snapshotId };
}