Projects >> OpenMEAP >>4101e8b92d3ce929d7575e0888ce0923638c10fa

Chunk
Conflicting content
				}
			}
			
<<<<<<< HEAD
			try {
				// process the ClusterNode objects
				if( parameterMap.get(CLUSTER_NODE_URLS_PARAM)!=null ) {
					
					String[] clusterNodeUrls = (String[])parameterMap.get(CLUSTER_NODE_URLS_PARAM);
					String[] clusterNodePaths = (String[])parameterMap.get(CLUSTER_NODE_PATHS_PARAM);
					int end = clusterNodeUrls.length;
					
					// make sure there is a map in cluster nodes
					List clusterNodes = settings.getClusterNodes();
					if( clusterNodes==null ) {
						clusterNodes = new ArrayList();
						settings.setClusterNodes(clusterNodes);
					} 
=======
			List toDelete = new ArrayList();
			
			// process the ClusterNode objects
			if( parameterMap.get(CLUSTER_NODE_URLS_PARAM)!=null ) {
				String[] clusterNodeUrls = (String[])parameterMap.get(CLUSTER_NODE_URLS_PARAM);
				String[] clusterNodePaths = (String[])parameterMap.get(CLUSTER_NODE_PATHS_PARAM);
				int end = clusterNodeUrls.length;
				
				// make sure there is a map in cluster nodes
				List clusterNodes = settings.getClusterNodes();
				if( clusterNodes==null ) {
					clusterNodes = new ArrayList();
					settings.setClusterNodes(clusterNodes);
				} 
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
				
					// remove any nodes that no longer appear
					List urls = Arrays.asList(clusterNodeUrls);
Solution content
				}
			}
			
			List toDelete = new ArrayList();
			
			// process the ClusterNode objects
			if( parameterMap.get(CLUSTER_NODE_URLS_PARAM)!=null ) {
				String[] clusterNodeUrls = (String[])parameterMap.get(CLUSTER_NODE_URLS_PARAM);
				String[] clusterNodePaths = (String[])parameterMap.get(CLUSTER_NODE_PATHS_PARAM);
				int end = clusterNodeUrls.length;
				
				// make sure there is a map in cluster nodes
				List clusterNodes = settings.getClusterNodes();
				if( clusterNodes==null ) {
					clusterNodes = new ArrayList();
					settings.setClusterNodes(clusterNodes);
				} 
				
					// remove any nodes that no longer appear
					List urls = Arrays.asList(clusterNodeUrls);
File
GlobalSettingsBacking.java
Developer's decision
Version 2
Kind of conflict
Cast expression
Comment
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
						clusterNodes.remove(node);
						modelManager.delete(node,events);
					}
<<<<<<< HEAD
					
					// iterate over each node configuration, updating the clusterNodes as per input
					for( int i=0; i urls = Arrays.asList(clusterNodeUrls);
				for( ClusterNode node : settings.getClusterNodes() ) {
					if( !urls.contains(node.getServiceWebUrlPrefix()) ) {
						toDelete.add(node);
					}
				}
			}
		
			try {
				if(toDelete!=null) {
					for(ClusterNode node : toDelete) {
						settings.removeClusterNode(node);
						modelManager.delete(node,events);
					}
				}
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
				modelManager.addModify(settings,events);
				events.add(new MessagesEvent("The settings were successfully modified."));
			} catch( InvalidPropertiesException ipe ) {
Solution content
		
				}
			}
						clusterNodes.remove(node);
						modelManager.delete(node,events);
					}
					if( settings.getClusterNode(thisNodeUrl)!=null ) {
						settings.getClusterNode(thisNodeUrl).setFileSystemStoragePathPrefix(thisNodePath);
					} else {
						ClusterNode thisNode = new ClusterNode();
						thisNode.setServiceWebUrlPrefix(thisNodeUrl);
						thisNode.setFileSystemStoragePathPrefix(thisNodePath);
						settings.addClusterNode(thisNode);
					}
				}
				
				// remove any nodes that no longer appear
				List urls = Arrays.asList(clusterNodeUrls);
				for( ClusterNode node : settings.getClusterNodes() ) {
					if( !urls.contains(node.getServiceWebUrlPrefix()) ) {
						toDelete.add(node);
					}
			try {
				if(toDelete!=null) {
					for(ClusterNode node : toDelete) {
						settings.removeClusterNode(node);
						modelManager.delete(node,events);
					}
				}
				modelManager.addModify(settings,events);
				events.add(new MessagesEvent("The settings were successfully modified."));
			} catch( InvalidPropertiesException ipe ) {
File
GlobalSettingsBacking.java
Developer's decision
Version 2
Kind of conflict
Comment
For statement
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
		settings.setTemporaryStoragePath(AdminTestHelper.ADMIN_WEB_STORAGE);
		
		// correct cluster node location and path prefix
<<<<<<< HEAD
		List clusterNodeMap = new ArrayList();
		ClusterNode node = new ClusterNode();
		node.setServiceWebUrlPrefix(AdminTestHelper.NODE_01_SERVICES_URL);
		node.setFileSystemStoragePathPrefix(AdminTestHelper.NODE_01_STORAGE);
		clusterNodeMap.add(node);
		settings.setClusterNodes(clusterNodeMap);
=======
		ClusterNode node = new ClusterNode();
		node.setServiceWebUrlPrefix(AdminTestHelper.NODE_01_SERVICES_URL);
		node.setFileSystemStoragePathPrefix(AdminTestHelper.NODE_01_STORAGE);
		settings.addClusterNode(node);
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
		
		// validate settings stored in database
		Utils.consumeInputStream(helper.postGlobalSettings(settings).getResponseBody());
Solution content
		settings.setTemporaryStoragePath(AdminTestHelper.ADMIN_WEB_STORAGE);
		
		// correct cluster node location and path prefix
		ClusterNode node = new ClusterNode();
		node.setServiceWebUrlPrefix(AdminTestHelper.NODE_01_SERVICES_URL);
		node.setFileSystemStoragePathPrefix(AdminTestHelper.NODE_01_STORAGE);
		settings.addClusterNode(node);
		
		// validate settings stored in database
		Utils.consumeInputStream(helper.postGlobalSettings(settings).getResponseBody());
File
AdminTest.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
public class AdminTestHelper {
	
<<<<<<< HEAD
	final static public String ADMIN_HOST = "10.0.2.15:8080";
	final static public String NODE_HOST = "localhost:8080";
=======
	final static public String HOST = "localhost:8080";
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
	
	final static public String ADMIN_USER = "tomcat";
	final static public String ADMIN_PASS = "tomcat";
Solution content
public class AdminTestHelper {
	
	final static public String ADMIN_HOST = "10.0.2.15:8080";
	final static public String NODE_HOST = "localhost:8080";
	
	final static public String ADMIN_USER = "tomcat";
	final static public String ADMIN_PASS = "tomcat";
File
AdminTestHelper.java
Developer's decision
Version 1
Kind of conflict
Attribute
Chunk
Conflicting content
		Boolean isGood;
		try {
			isGood = AuthTokenProvider.validateAuthToken(authSalt, auth);
<<<<<<< HEAD
		} catch (DigestException e) {
=======
		} catch (Exception e) {
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
			throw new GenericRuntimeException(e);
		}
		logger.debug("Authentication of token \"{}\" with salt \"{}\" returned {}",new Object[]{authSalt,auth,isGood});
Solution content
		Boolean isGood;
		try {
			isGood = AuthTokenProvider.validateAuthToken(authSalt, auth);
		} catch (DigestException e) {
			throw new GenericRuntimeException(e);
		}
		logger.debug("Authentication of token \"{}\" with salt \"{}\" returned {}",new Object[]{authSalt,auth,isGood});
File
ServiceManagementServlet.java
Developer's decision
Version 1
Kind of conflict
Catch clause
Chunk
Conflicting content
		final Map urlRequestCompleteStatus = new HashMap();
		GlobalSettings globalSettings = modelManager.getGlobalSettings();
		List clusterNodes = globalSettings.getClusterNodes();
<<<<<<< HEAD
		for( ClusterNode thisNode : clusterNodes ) {
			
=======
		for( final ClusterNode node : clusterNodes ) {
			String thisUrlString = node.getServiceWebUrlPrefix();
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
			URL thisUrl = null;
			try {
				thisUrl = new URL(thisNode.getServiceWebUrlPrefix());
Solution content
		final Map urlRequestCompleteStatus = new HashMap();
		GlobalSettings globalSettings = modelManager.getGlobalSettings();
		List clusterNodes = globalSettings.getClusterNodes();
		for( ClusterNode thisNode : clusterNodes ) {
			
			URL thisUrl = null;
			try {
				thisUrl = new URL(thisNode.getServiceWebUrlPrefix());
File
AbstractClusterServiceMgmtNotifier.java
Developer's decision
Version 1
Kind of conflict
For statement
Method invocation
Variable
Chunk
Conflicting content
	private String serviceWebUrlPrefix;
	private String fileSystemStoragePathPrefix;
	private Long id;
<<<<<<< HEAD
	
	public ClusterNode() {}
	public ClusterNode(String serviceUrl, String prefix) {
		this.serviceWebUrlPrefix=serviceUrl;
		this.fileSystemStoragePathPrefix=prefix;
	}
=======
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
	
	static final private JSONProperty[] jsonProperties = new JSONProperty[] {
		new JSONProperty("serviceWebUrlPrefix",String.class,new JSONGetterSetter(){
Solution content
	private Long id;
	private String serviceWebUrlPrefix;
	private String fileSystemStoragePathPrefix;
	
	public ClusterNode() {}
	public ClusterNode(String serviceUrl, String prefix) {
		this.serviceWebUrlPrefix=serviceUrl;
		this.fileSystemStoragePathPrefix=prefix;
	}
	
	static final private JSONProperty[] jsonProperties = new JSONProperty[] {
		new JSONProperty("serviceWebUrlPrefix",String.class,new JSONGetterSetter(){
File
ClusterNode.java
Developer's decision
Version 1
Kind of conflict
Method declaration
Chunk
Conflicting content
	}
	
	@Transient public Long getPk() { return getId(); }
<<<<<<< HEAD
	public void setPk( Object pkValue ) { setPk((Long)pkValue); }
	 
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	public Long getId() {
		return this.id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
=======
	public void setPk( Object pkValue ) { setId((Long)pkValue); }
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO) 
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id=id;
	}
	
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
	@Column(name="svc_web_url_prfx",length=256,unique=true)
	public String getServiceWebUrlPrefix() {
		return serviceWebUrlPrefix;
Solution content
	}
	
	@Transient public Long getPk() { return getId(); }
	public void setPk( Object pkValue ) { setId((Long)pkValue); }
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO) 
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id=id;
	}
	
	@Column(name="svc_web_url_prfx",length=256,unique=true)
	public String getServiceWebUrlPrefix() {
		return serviceWebUrlPrefix;
File
ClusterNode.java
Developer's decision
Version 2
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
	public void setClusterNodes(List clusterNodes) {
		this.clusterNodes = clusterNodes;
	}
<<<<<<< HEAD
	public ClusterNode getClusterNode(String url) {
		if(clusterNodes==null) {
			return null;
		}
		for(int i=0; i>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
			}
		}
		return null;
Solution content
	public void setClusterNodes(List clusterNodes) {
		this.clusterNodes = clusterNodes;
	}
	public ClusterNode getClusterNode(String serviceUrlPrefix) {
		for(ClusterNode node : clusterNodes) {
			if( node.getServiceWebUrlPrefix().equals(serviceUrlPrefix)){
				return node;
			}
		}
		return null;
File
GlobalSettings.java
Developer's decision
Version 2
Kind of conflict
For statement
If statement
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
		}
		return null;
	}
<<<<<<< HEAD
=======
	public Boolean addClusterNode(ClusterNode node){
		
		if(clusterNodes==null) {
			clusterNodes = new ArrayList();
		}
		if(!clusterNodes.contains(node)) {
			clusterNodes.add(node);
			return true;
		} 
		return false;
	}
	public Boolean removeClusterNode(ClusterNode node){
		
		if(clusterNodes==null) {
			clusterNodes = new ArrayList();
		}
		if(clusterNodes.contains(node)) {
			return clusterNodes.remove(node);
		} 
		return false;
	}
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
	
	public Map validate() {
		try {
Solution content
		}
		return null;
	}
	public Boolean addClusterNode(ClusterNode node){
		
		if(clusterNodes==null) {
			clusterNodes = new ArrayList();
		}
		if(!clusterNodes.contains(node)) {
			clusterNodes.add(node);
			return true;
		} 
		return false;
	}
	public Boolean removeClusterNode(ClusterNode node){
		
		if(clusterNodes==null) {
			clusterNodes = new ArrayList();
		}
		if(clusterNodes.contains(node)) {
			return clusterNodes.remove(node);
		} 
		return false;
	}
	
	public Map validate() {
		try {
File
GlobalSettings.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
		settings = modelManager.getGlobalSettings();
		Assert.assertTrue(settings.getId().equals(Long.valueOf(1)));
		
<<<<<<< HEAD
		List nodes = settings.getClusterNodes();
		nodes.add(new ClusterNode("http://test","/tmp"));
		settings.getClusterNode("http://test").setServiceWebUrlPrefix("http://test");
		settings.getClusterNode("http://test").setFileSystemStoragePathPrefix("/tmp2");
=======
		ClusterNode node = new ClusterNode();
		node.setServiceWebUrlPrefix("http://test");
		node.setFileSystemStoragePathPrefix("/tmp2");
		settings.addClusterNode(node);
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
		settings = modelManager.addModify(settings,null);
		
		modelManager.refresh(settings,null);
Solution content
		settings = modelManager.getGlobalSettings();
		Assert.assertTrue(settings.getId().equals(Long.valueOf(1)));
		
		ClusterNode node = new ClusterNode();
		node.setServiceWebUrlPrefix("http://test");
		node.setFileSystemStoragePathPrefix("/tmp2");
		settings.addClusterNode(node);
		settings = modelManager.addModify(settings,null);
		
		modelManager.refresh(settings,null);
File
ModelManagerImplTest.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
		final ModelManager modelManager = new MockModelManager();
		final GlobalSettings globalSettings = new GlobalSettings();
		globalSettings.setServiceManagementAuthSalt(UUID.randomUUID().toString());
<<<<<<< HEAD
		List clusterNodes = new ArrayList();
		ClusterNode clusterNode = new ClusterNode();
		clusterNodes.add(clusterNode);
		clusterNode.setServiceWebUrlPrefix("http://www.openmeap.com/openmeap-services-web");
		globalSettings.setClusterNodes(clusterNodes);
=======
		ClusterNode clusterNode = new ClusterNode();
		clusterNode.setServiceWebUrlPrefix("http://www.openmeap.com/openmeap-services-web");
		globalSettings.addClusterNode(clusterNode);
>>>>>>> 1145357596234e7e2260d02bc7bb0ac43e9aa487
		new NonStrictExpectations(globalSettings,modelManager) {{
			modelManager.getGlobalSettings(); result = globalSettings;
		}};
Solution content
		final ModelManager modelManager = new MockModelManager();
		final GlobalSettings globalSettings = new GlobalSettings();
		globalSettings.setServiceManagementAuthSalt(UUID.randomUUID().toString());

		ClusterNode clusterNode = new ClusterNode();
		clusterNode.setServiceWebUrlPrefix("http://www.openmeap.com/openmeap-services-web");
		globalSettings.addClusterNode(clusterNode);
		new NonStrictExpectations(globalSettings,modelManager) {{
			modelManager.getGlobalSettings(); result = globalSettings;
		}};
File
ModelServiceRefreshNotifierTest.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable