// Path: rahub-cross-cutting-concerns/src/main/java/net/jotorren/microservices/tx/CompositeTransaction.java
// public class CompositeTransaction extends Transaction {
// 
// 	@JsonIgnore
// 	private String id;
// 
// 	public String getId() {
// 		return id;
// 	}
// 
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	
// 	public String getPartialTransactionId(int index) {
// 		if (index < 0 || null == participantLinks || index >= participantLinks.size()){
// 			return null;
// 		}
// 		
// 		String participantUri = participantLinks.get(index).getUri();
// 		return participantUri.substring(participantUri.lastIndexOf("/") + 1);
// 	}
// }
// 
// Path: rahub-cross-cutting-concerns/src/main/java/net/jotorren/microservices/tx/CompositeTransactionManager.java
// public interface CompositeTransactionManager {
// 
// 	void open(String txId);
// 	void enlist(String txId, EntityCommand<?> ec);
// 	List<EntityCommand<?>> fetch(String txId);
// 	void close(String txId);
// }


import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import net.jotorren.microservices.tx.CompositeTransaction;
import net.jotorren.microservices.tx.CompositeTransactionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.atomikos.tcc.rest.ParticipantLink;
import com.atomikos.tcc.rest.Transaction;
package net.jotorren.microservices.tcc;






@Service
public class TccRestCoordinator {

    @Autowired
    @Qualifier("tccCoordinatorClient")
    private WebTarget tccCoordinatorClient;
    
    @Autowired
    private CompositeTransactionManager txManager;
    
// Path: rahub-cross-cutting-concerns/src/main/java/net/jotorren/microservices/tx/CompositeTransaction.java
// public class CompositeTransaction extends Transaction {
// 
// 	@JsonIgnore
// 	private String id;
// 
// 	public String getId() {
// 		return id;
// 	}
// 
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	
// 	public String getPartialTransactionId(int index) {
// 		if (index < 0 || null == participantLinks || index >= participantLinks.size()){
// 			return null;
// 		}
// 		
// 		String participantUri = participantLinks.get(index).getUri();
// 		return participantUri.substring(participantUri.lastIndexOf("/") + 1);
// 	}
// }
// 
// Path: rahub-cross-cutting-concerns/src/main/java/net/jotorren/microservices/tx/CompositeTransactionManager.java
// public interface CompositeTransactionManager {
// 
// 	void open(String txId);
// 	void enlist(String txId, EntityCommand<?> ec);
// 	List<EntityCommand<?>> fetch(String txId);
// 	void close(String txId);
// }


// Path: rahub-composite-service/src/main/java/net/jotorren/microservices/tcc/TccRestCoordinator.java
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import net.jotorren.microservices.tx.CompositeTransaction;
import net.jotorren.microservices.tx.CompositeTransactionManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.atomikos.tcc.rest.ParticipantLink;
import com.atomikos.tcc.rest.Transaction;

package net.jotorren.microservices.tcc;






@Service
public class TccRestCoordinator {

    @Autowired
    @Qualifier("tccCoordinatorClient")
    private WebTarget tccCoordinatorClient;
    
    @Autowired
    private CompositeTransactionManager txManager;
    
	public CompositeTransaction open(long timestamp, String... participantUris){