All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.elephantdrummer.tool.HistoryBuffer Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
package com.elephantdrummer.tool;

import java.util.concurrent.ConcurrentLinkedQueue;

import com.elephantdrummer.container.Container;
import com.elephantdrummer.container.ContainerElement;
import com.elephantdrummer.model.PtHistory;

/**
 * Copyright 2018 Elephant Software Klaudiusz Wojtkowiak e-mail: [email protected]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 * 
 *  http://www.apache.org/licenses/LICENSE-2.0 
 *  
 *  Unless required by applicable law or agreed to in writing, software 
 *  distributed under the License is distributed on an "AS IS" BASIS, 
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 *  See the License for the specific language governing permissions and 
 *  limitations under the License. 
 */
//@Singleton
public class HistoryBuffer extends ConcurrentLinkedQueue  implements ContainerElement{

	private static final long serialVersionUID = -3741683679786417675L;
	
	//private  ProducerCDIObjectFromClass cdiproducer=Container.getElement(ProducerCDIObjectFromClass.class);
	
	private PlatformInformation platformInformation=Container.getElement(PlatformInformation.class);
	
	
//	public void addJob(JobData data){
//		PtHistory his=new PtHistory();
//		his.setStartDate(data.getStartDate());
//		his.setStopDate(data.getFinishDate());
//		his.setJobUUIDId(data.getId());
//		his.setJobId(data.getPtJob().getPtJobId());
//		//his.setPtApplicationId(getPlatformInformation().getPtPlatform().getPtApplicationId());
//		//his.setExecutionTime(new BigDecimal(his.getStopDate().getTime()-his.getStartDate().getTime()));
//		his.setExecutionComment(data.getExecutionComment());
//		his.setStatus(new BigDecimal(data.getStatus()));
//		his.setPoolSize(data.getPoolSize()==null?null:new BigDecimal(data.getPoolSize().intValue()));
//		his.setPtExecutorId(data.getPtExecutorId());
//		add(his);
//		//usuwa powyzej 100 elementu
//		while(size()>4) remove();
//	}


	private PlatformInformation getPlatformInformation() {

		return platformInformation;
	}


	private void setPlatformInformation(PlatformInformation platformInformation) {
		this.platformInformation = platformInformation;
	}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy