本文整理汇总了Java中org.pentaho.di.job.entry.JobEntryCopy类的典型用法代码示例。如果您正苦于以下问题:Java JobEntryCopy类的具体用法?Java JobEntryCopy怎么用?Java JobEntryCopy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JobEntryCopy类属于org.pentaho.di.job.entry包,在下文中一共展示了JobEntryCopy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobStopAll
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* 停止作业,包含子作业和转换 <br/>
* @author jingma
* @param job
*/
public static void jobStopAll(Job job){
job.stopAll();
JobMeta jobMeta = job.getJobMeta();
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
if(jet.getTrans()!=null){
jet.getTrans().stopAll();
}
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
if(jej.getJob()!=null){
jobStopAll(jej.getJob());
}
}
}
}
示例2: jobKillAll
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* 结束作业,包含子作业和转换 <br/>
* @author jingma
* @param job
*/
@SuppressWarnings("deprecation")
public static void jobKillAll(Job job){
job.stopAll();
JobMeta jobMeta = job.getJobMeta();
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
if(jet.getTrans()!=null){
jet.getTrans().killAll();
}
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
if(jej.getJob()!=null){
jobKillAll(jej.getJob());
}
}
}
//采用线程中断结束卡住的线程
if(job.getState().equals(State.BLOCKED)||job.getState().equals(State.TIMED_WAITING)){
job.stop();
}else{
job.interrupt();
}
}
示例3: jobCopy
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* 将指定job复制到KettleUtils中的资源库 <br/>
* @author jingma
* @param jobName job名称
* @param jobPath job路径
* @param fromRepository 来源资源库
* @param toRepository 目标资源库
* @throws KettleException
*/
public static void jobCopy(String jobName,String jobPath,Repository fromRepository,
Repository toRepository) throws KettleException {
JobMeta jobMeta = KettleUtils.loadJob(jobName,jobPath,fromRepository);
for(JobEntryCopy jec:jobMeta.getJobCopies()){
if(jec.isTransformation()){
JobEntryTrans jet = (JobEntryTrans)jec.getEntry();
transCopy(jet.getObjectName(), jet.getDirectory(),fromRepository,toRepository);
}else if(jec.isJob()){
JobEntryJob jej = (JobEntryJob)jec.getEntry();
jobCopy(jej.getObjectName(),jej.getDirectory(),fromRepository,toRepository);
}
}
jobMeta.setRepository(toRepository);
jobMeta.setMetaStore(toRepository.getMetaStore());
if(!isDirectoryExist(toRepository,jobPath)){
//所在目录不存在则创建
toRepository.createRepositoryDirectory(toRepository.findDirectory("/"), jobPath);
}
KettleUtils.saveJob(toRepository,jobMeta);
}
示例4: generateJobImage
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* 生成作业图 <br/>
* @author jingma
* @param jobMeta
* @return
* @throws Exception
*/
public static BufferedImage generateJobImage( JobMeta jobMeta ) throws Exception {
float magnification = 1.0f;
Point maximum = jobMeta.getMaximum();
maximum.multiply( magnification );
SwingGC gc = new SwingGC( null, maximum, 32, 0, 0 );
JobPainter jobPainter =
new JobPainter(
gc, jobMeta, maximum, null, null, null, null, null, new ArrayList<AreaOwner>(),
new ArrayList<JobEntryCopy>(), 32, 1, 0, 0, true, "Arial", 10 );
jobPainter.setMagnification( magnification );
jobPainter.drawJob();
BufferedImage image = (BufferedImage) gc.getImage();
return image;
}
示例5: drawJobEntryIcon
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public void drawJobEntryIcon(int x, int y, JobEntryCopy jobEntryCopy) {
if (jobEntryCopy == null)
return; // Don't draw anything
Image image = null;
if (jobEntryCopy.isSpecial()) {
if (jobEntryCopy.isStart()) {
image = GUIResource.getInstance().getImageStart();
}
if (jobEntryCopy.isDummy()) {
image = GUIResource.getInstance().getImageDummy();
}
} else {
String configId = jobEntryCopy.getEntry().getPluginId();
if (configId != null) {
image = GUIResource.getInstance().getImagesJobentries().get(configId);
}
}
if (image==null) {
return;
}
org.eclipse.swt.graphics.Rectangle bounds = image.getBounds();
gc.drawImage(image, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize);
}
示例6: getJobEntryCopy
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public JobEntryCopy getJobEntryCopy(int x, int y, int iconsize) {
int i, s;
s = nrJobEntries();
for (i = s - 1; i >= 0; i--) // Back to front because drawing goes
// from start to end
{
JobEntryCopy je = getJobEntry(i);
Point p = je.getLocation();
if (p != null) {
if (x >= p.x && x <= p.x + iconsize && y >= p.y && y <= p.y + iconsize) {
return je;
}
}
}
return null;
}
示例7: clearChanged
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public void clearChanged() {
changedEntries = false;
changedHops = false;
changedNotes = false;
changedDatabases = false;
for (int i = 0; i < nrJobEntries(); i++) {
JobEntryCopy entry = getJobEntry(i);
entry.setChanged(false);
}
for (JobHopMeta hi : jobhops) // Look at all the hops
{
hi.setChanged(false);
}
for (int i = 0; i < nrDatabases(); i++) {
DatabaseMeta db = getDatabase(i);
db.setChanged(false);
}
for (int i = 0; i < nrNotes(); i++) {
NotePadMeta note = getNote(i);
note.setChanged(false);
}
super.clearChanged();
}
示例8: isDatabaseConnectionUsed
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* This method asks all steps in the transformation whether or not the
* specified database connection is used. The connection is used in the
* transformation if any of the steps uses it or if it is being used to log
* to.
*
* @param databaseMeta
* The connection to check
* @return true if the connection is used in this transformation.
*/
public boolean isDatabaseConnectionUsed(DatabaseMeta databaseMeta) {
for (int i = 0; i < nrJobEntries(); i++) {
JobEntryCopy jobEntry = getJobEntry(i);
DatabaseMeta dbs[] = jobEntry.getEntry().getUsedDatabaseConnections();
for (int d = 0; d < dbs.length; d++) {
if (dbs[d] != null && dbs[d].equals(databaseMeta))
return true;
}
}
if (logConnection != null && logConnection.equals(databaseMeta))
return true;
return false;
}
示例9: addEntryMouseOverDelayTimer
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
private synchronized void addEntryMouseOverDelayTimer(final JobEntryCopy jobEntryCopy) {
// Don't add the same mouse over delay timer twice...
//
if (mouseOverEntries.contains(jobEntryCopy)) return;
mouseOverEntries.add(jobEntryCopy);
DelayTimer delayTimer = new DelayTimer(2500, new DelayListener() {
public void expired() {
mouseOverEntries.remove(jobEntryCopy);
delayTimers.remove(jobEntryCopy);
asyncRedraw();
}
});
new Thread(delayTimer).start();
delayTimers.put(jobEntryCopy, delayTimer);
}
示例10: findJobEntryResult
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
private JobEntryResult findJobEntryResult(JobEntryCopy jobEntryCopy) {
if (jobEntryResults==null) return null;
Iterator<JobEntryResult> iterator = jobEntryResults.iterator();
while (iterator.hasNext()) {
JobEntryResult jobEntryResult = iterator.next();
if (jobEntryResult.getJobEntryName().equals(jobEntryCopy.getName()) &&
jobEntryResult.getJobEntryNr() == jobEntryCopy.getNr()
) {
return jobEntryResult;
}
}
return null;
}
示例11: JobHopMeta
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public JobHopMeta(Repository rep, long id_job_hop, JobMeta job, List<JobEntryCopy> jobcopies) throws KettleException
{
try
{
long id_jobentry_copy_from;
long id_jobentry_copy_to;
RowMetaAndData r = rep.getJobHop(id_job_hop);
if (r!=null)
{
id_jobentry_copy_from = r.getInteger("ID_JOBENTRY_COPY_FROM", -1L);
id_jobentry_copy_to = r.getInteger("ID_JOBENTRY_COPY_TO", -1L);
enabled = r.getBoolean("ENABLED", true);
evaluation = r.getBoolean("EVALUATION", true);
unconditional = r.getBoolean("UNCONDITIONAL", !evaluation);
from_entry = JobMeta.findJobEntryCopy(jobcopies, id_jobentry_copy_from);
to_entry = JobMeta.findJobEntryCopy(jobcopies, id_jobentry_copy_to);
}
}
catch(KettleDatabaseException dbe)
{
throw new KettleException(Messages.getString("JobHopMeta.Exception.UnableToLoadHopInfoRep",""+id_job_hop) , dbe);
}
}
示例12: findHop
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* See if location (x,y) is on a line between two steps: the hop!
* @param x
* @param y
* @param exclude the step to exclude from the hops (from or to location). Specify null if no step is to be excluded.
* @return the transformation hop on the specified location, otherwise: null
*/
private JobHopMeta findHop(int x, int y, JobEntryCopy exclude) {
int i;
JobHopMeta online = null;
for (i = 0; i < jobMeta.nrJobHops(); i++) {
JobHopMeta hi = jobMeta.getJobHop(i);
JobEntryCopy fs = hi.getFromEntry();
JobEntryCopy ts = hi.getToEntry();
if (fs == null || ts == null)
return null;
// If either the "from" or "to" step is excluded, skip this hop.
//
if (exclude != null && (exclude.equals(fs) || exclude.equals(ts)))
continue;
int line[] = getLine(fs, ts);
if (pointOnLine(x, y, line))
online = hi;
}
return online;
}
示例13: selectInRect
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public void selectInRect(JobMeta jobMeta, org.pentaho.di.core.gui.Rectangle rect) {
int i;
for (i = 0; i < jobMeta.nrJobEntries(); i++) {
JobEntryCopy je = jobMeta.getJobEntry(i);
Point p = je.getLocation();
if (((p.x >= rect.x && p.x <= rect.x + rect.width) || (p.x >= rect.x + rect.width && p.x <= rect.x))
&& ((p.y >= rect.y && p.y <= rect.y + rect.height) || (p.y >= rect.y + rect.height && p.y <= rect.y)))
je.setSelected(true);
}
for (i = 0; i < jobMeta.nrNotes(); i++) {
NotePadMeta ni = jobMeta.getNote(i);
Point a = ni.getLocation();
Point b = new Point(a.x + ni.width, a.y + ni.height);
if (rect.contains(a.x, a.y) && rect.contains(b.x, b.y))
ni.setSelected(true);
}
}
示例14: findJobTracker
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
/**
* Finds the JobTracker for the job entry specified.
* Use this to
* @param jobEntryCopy The entry to search the job tracker for
* @return The JobTracker of null if none could be found...
*/
public JobTracker findJobTracker(JobEntryCopy jobEntryCopy)
{
for (int i=0;i<jobTrackers.size();i++)
{
JobTracker tracker = getJobTracker(i);
JobEntryResult result = tracker.getJobEntryResult();
if (result!=null)
{
JobEntryCopy jobEntry = result.getJobEntry();
if (jobEntry!=null)
{
if (jobEntry.equals(jobEntryCopy)) return tracker;
}
}
}
return null;
}
示例15: delSelected
import org.pentaho.di.job.entry.JobEntryCopy; //导入依赖的package包/类
public void delSelected() {
JobEntryCopy[] copies = jobMeta.getSelectedEntries();
int nrsels = copies.length;
if (nrsels == 0)
return;
// Load the list of steps
List<String> stepList = new ArrayList<String>();
for (int i = 0; i < copies.length; ++i) {
stepList.add(copies[i].toString());
}
// Display the delete confirmation message box
MessageBox mb = new DeleteMessageBox(shell, Messages.getString("Spoon.Dialog.DeletionConfirm.Message"), //$NON-NLS-1$
stepList);
int answer = mb.open();
if (answer == SWT.YES) {
// Perform the delete
for (int i = 0; i < copies.length; i++) {
spoon.deleteJobEntryCopies(jobMeta, copies[i]);
}
spoon.refreshTree();
spoon.refreshGraph();
}
}