本文整理汇总了Java中org.pentaho.di.core.logging.LogWriter.isDetailed方法的典型用法代码示例。如果您正苦于以下问题:Java LogWriter.isDetailed方法的具体用法?Java LogWriter.isDetailed怎么用?Java LogWriter.isDetailed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.logging.LogWriter
的用法示例。
在下文中一共展示了LogWriter.isDetailed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: systemPing
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean systemPing(String hostname, int timeout,LogWriter log)
{
boolean retval=false;
InetAddress address=null;
try{
address=InetAddress.getByName(hostname);
if(address==null)
{
log.logError(toString(),Messages.getString("JobPing.CanNotGetAddress",hostname));
return retval;
}
if(log.isDetailed())
{
log.logDetailed(toString(),Messages.getString("JobPing.HostName",address.getHostName()));
log.logDetailed(toString(),Messages.getString("JobPing.HostAddress",address.getHostAddress()));
}
retval = address.isReachable(timeout);
}catch(Exception e)
{
log.logError(toString(),Messages.getString("JobPing.ErrorSystemPing",hostname,e.getMessage()));
}
return retval;
}
示例2: classicPing
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean classicPing(String hostname, int nrpackets,LogWriter log)
{
boolean retval=false;
try
{
String lignePing = "";
String CmdPing="ping " ;
if(Const.isWindows())
CmdPing+= hostname + " " + Windows_CHAR + " " + nrpackets;
else
CmdPing+= hostname + " " + NIX_CHAR + " " + nrpackets;
if(log.isDetailed())
{
log.logDetailed(toString(), Messages.getString("JobPing.NbrPackets.Label", ""+nrpackets));
log.logDetailed(toString(), Messages.getString("JobPing.ExecClassicPing.Label", CmdPing));
}
Process processPing = Runtime.getRuntime().exec(CmdPing);
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobPing.Gettingresponse.Label",hostname));
// Get ping response
BufferedReader br = new BufferedReader(new InputStreamReader(processPing.getInputStream()));
// Read response lines
while ((lignePing = br.readLine()) != null)
{
if(log.isDetailed()) log.logDetailed(toString(), lignePing);
}
// We succeed only when 0% lost of data
if (processPing.exitValue()==0)
{
retval=true;
}
}
catch (IOException ex)
{
log.logError(toString(), Messages.getString("JobPing.Error.Label") + ex.getMessage());
}
return retval;
}
示例3: displayResults
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void displayResults(LogWriter log)
{
if(log.isDetailed()){
log.logDetailed(toString(), "=======================================");
log.logDetailed(toString(), Messages.getString("JobMoveFiles.Log.Info.FilesInError","" + NrErrors));
log.logDetailed(toString(), Messages.getString("JobMoveFiles.Log.Info.FilesInSuccess","" + NrSuccess));
log.logDetailed(toString(), "=======================================");
}
}
示例4: createParentFolder
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean createParentFolder(String filename)
{
// Check for parent folder
FileObject parentfolder=null;
boolean result=false;
LogWriter log = LogWriter.getInstance();
try
{
// Get parent folder
parentfolder=KettleVFS.getFileObject(filename).getParent();
if(!parentfolder.exists())
{
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.CanNotFindFolder",""+parentfolder.getName()));
parentfolder.createFolder();
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.FolderCreated",""+parentfolder.getName()));
}
else
{
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryZipFile.FolderExists", ""+parentfolder.getName()));
}
result= true;
}
catch (Exception e) {
log.logError(toString(),Messages.getString("JobEntryZipFile.CanNotCreateFolder",""+parentfolder.getName()));
}
finally {
if ( parentfolder != null )
{
try {
parentfolder.close();
parentfolder=null;
}
catch ( Exception ex ) {};
}
}
return result;
}
示例5: displayResults
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private void displayResults(LogWriter log)
{
if(log.isDetailed()){
log.logDetailed(toString(), "=======================================");
log.logDetailed(toString(), Messages.getString("JobEntryFTP.Log.Info.FilesInError","" + NrErrors));
log.logDetailed(toString(), Messages.getString("JobEntryFTP.Log.Info.FilesRetrieved","" + NrfilesRetrieved));
log.logDetailed(toString(), "=======================================");
}
}
示例6: CreateDestinationFolder
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean CreateDestinationFolder(String foldername,LogWriter log)
{
FileObject folder=null;
try
{
folder=KettleVFS.getFileObject(foldername);
if(!folder.exists())
{
log.logError(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderNotExists", foldername));
if(isCreateDestinationFolder())
folder.createFolder();
else
return false;
if(log.isBasic()) log.logBasic(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderCreated",foldername));
}else
{
if(log.isDetailed())
log.logDetailed(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.FolderExists",foldername));
}
return true;
}
catch (Exception e) {
log.logError(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.CanNotCreatedFolder", foldername,e.toString()));
}
finally {
if ( folder != null )
{
try {
folder.close();
}
catch (Exception ex ) {};
}
}
return false;
}
示例7: checkOneFile
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean checkOneFile(FileObject file, LogWriter log,Result result,Job parentJob)
{
boolean retval=false;
try
{
// We deal with a file..so let's check if it's well formed
boolean retformed=CheckWellFormed(file,log);
if(!retformed)
{
log.logError(toString(), Messages.getString("JobXMLWellFormed.Error.FileBadFormed",file.toString()));
// Update Bad formed files number
updateBadFormed();
if(resultfilenames.equals(ADD_ALL_FILENAMES) || resultfilenames.equals(ADD_BAD_FORMED_FILES_ONLY))
addFileToResultFilenames(KettleVFS.getFilename(file),log,result,parentJob);
}else
{
if(log.isDetailed())
{
log.logDetailed(toString(), "---------------------------");
log.logDetailed(toString(), Messages.getString("JobXMLWellFormed.Error.FileWellFormed",file.toString()));
}
// Update Well formed files number
updateWellFormed();
if(resultfilenames.equals(ADD_ALL_FILENAMES) || resultfilenames.equals(ADD_WELL_FORMED_FILES_ONLY))
addFileToResultFilenames(KettleVFS.getFilename(file),log,result,parentJob);
}
}catch (Exception e){}
return retval;
}
示例8: TruncateTables
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean TruncateTables(LogWriter log,String tablename, String schemaname, Database db)
{
boolean retval=false;
String realSchemaname=schemaname;
String realTablename=tablename;
try{
if(!Const.isEmpty(realSchemaname))
realTablename = db.getDatabaseMeta().getQuotedSchemaTableCombination(realSchemaname, realTablename);
// check if table exists!
if(db.checkTableExists(realTablename)){
if(!Const.isEmpty(realSchemaname))
db.truncateTable(realSchemaname, tablename);
else
db.truncateTable(tablename);
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryTruncateTables.Log.TableTruncated",realTablename));
retval=true;
}else{
log.logError(toString(), Messages.getString("JobEntryTruncateTables.Error.CanNotFindTable",realTablename));
}
}catch (Exception e)
{
log.logError(toString(), Messages.getString("JobEntryTruncateTables.Error.CanNotTruncateTables",realTablename,e.toString()));
}
return retval;
}
示例9: CreateDestinationFolder
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean CreateDestinationFolder(FileObject filefolder)
{
LogWriter log = LogWriter.getInstance();
FileObject folder=null;
try
{
if(destination_is_a_file)
folder=filefolder.getParent();
else
folder=filefolder;
if(!folder.exists())
{
if(create_destination_folder)
{
if(log.isDetailed()) log.logDetailed("Folder", "Folder " + folder.getName() + " does not exist !");
folder.createFolder();
if(log.isDetailed()) log.logDetailed("Folder", "Folder parent was created.");
}else
{
log.logError("Folder", "Folder " + folder.getName() + " does not exist !");
return false;
}
}
return true;
}
catch (Exception e) {
log.logError(toString(),"Couldn't created parent folder "+ folder.getName());
}
finally {
if ( folder != null )
{
try {
folder.close();
}
catch (Exception ex ) {};
}
}
return false;
}
示例10: deleteFolder
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean deleteFolder(String foldername) {
LogWriter log = LogWriter.getInstance();
boolean rcode = false;
FileObject filefolder = null;
try {
filefolder = KettleVFS.getFileObject(foldername);
// Here gc() is explicitly called if e.g. createfile is used in the same
// job for the same file. The problem is that after creating the file the
// file object is not properly garbaged collected and thus the file cannot
// be deleted anymore. This is a known problem in the JVM.
System.gc();
if (filefolder.exists()) {
// the file or folder exists
if (filefolder.getType() == FileType.FOLDER) {
// It's a folder
if (log.isDetailed())
log.logDetailed(toString(), Messages.getString("JobEntryDeleteFolders.ProcessingFolder", foldername)); //$NON-NLS-1$
// Delete Files
int Nr = filefolder.delete(new TextFileSelector());
if (log.isDetailed())
log.logDetailed(toString(), Messages.getString("JobEntryDeleteFolders.TotalDeleted", foldername,String.valueOf(Nr))); //$NON-NLS-1$
rcode = true;
} else {
// Error...This file is not a folder!
log.logError(toString(), Messages.getString("JobEntryDeleteFolders.Error.NotFolder"));
}
} else {
// File already deleted, no reason to try to delete it
if(log.isBasic()) log.logBasic(toString(), Messages.getString("JobEntryDeleteFolders.FolderAlreadyDeleted", foldername)); //$NON-NLS-1$
rcode = true;
}
} catch (IOException e) {
log.logError(toString(), Messages.getString("JobEntryDeleteFolders.CouldNotDelete", foldername, e.getMessage())); //$NON-NLS-1$
} finally {
if (filefolder != null) {
try {
filefolder.close();
} catch (IOException ex) {
};
}
}
return rcode;
}
示例11: execute
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result.
* In this case it means, just set the result boolean in the Result class.
* @param previousResult The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
Result result = previousResult;
result.setNrErrors(1);
result.setResult(false);
LogWriter log = LogWriter.getInstance();
String realEmailAddress=environmentSubstitute(emailAddress);
if(Const.isEmpty(realEmailAddress))
{
log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailEmpty"));
return result;
}
String realSender=environmentSubstitute(emailSender);
if(smtpCheck)
{
// check sender
if(Const.isEmpty(realSender))
{
log.logError(toString(),Messages.getString("JobEntryMailValidator.Error.EmailSenderEmpty"));
return result;
}
}
String realDefaultSMTP=environmentSubstitute(defaultSMTP);
int timeOut=Const.toInt(environmentSubstitute(timeout), 0);
// Split the mail-address: separated by space
String mailsCheck[] = realEmailAddress.split(" ");
boolean exitloop=false;
boolean mailIsValid=false;
String MailError=null;
for (int i = 0; i < mailsCheck.length && !exitloop; i++)
{
String email = mailsCheck[i];
if(log.isDetailed())
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.CheckingMail",email));
// Check if address is valid
MailValidationResult resultValidator=MailValidation.isAddressValid(email,
realSender, realDefaultSMTP,timeOut,smtpCheck);
mailIsValid=resultValidator.isValide();
MailError=resultValidator.getErrorMessage();
if(log.isDetailed())
{
if(mailIsValid)
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailValid",email));
else
{
log.logDetailed(toString(), Messages.getString("JobEntryMailValidator.MailNotValid",email));
log.logDetailed(toString(), MailError);
}
}
// invalid mail? exit loop
if(!resultValidator.isValide()) exitloop=true;
}
result.setResult(mailIsValid);
if(mailIsValid) result.setNrErrors(0);
// return result
return result;
}
示例12: processOneFolder
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
private boolean processOneFolder(Job parentJob,Result result,LogWriter log,
RepositoryDirectory repdir,String realoutfilename, int folderno, int totalfolders)
{
boolean retval=false;
try{
if(!repdir.isRoot())
{
if(repdir.toString().lastIndexOf("/")==0)
{
String filename=repdir.toString().replace("/", "");
String foldername=realoutfilename;
if(newfolder)
{
foldername=realoutfilename + Const.FILE_SEPARATOR + filename;
this.file=KettleVFS.getFileObject(foldername);
if(!this.file.exists())
{
this.file.createFolder();
}
}
filename=foldername+ Const.FILE_SEPARATOR + buildFilename(filename)+".xml";
this.file=KettleVFS.getFileObject(filename);
if(this.file.exists())
{
if(iffileexists.equals(If_FileExists_Skip)){
// Skip this folder
return true;
}else if(iffileexists.equals(If_FileExists_Uniquename)){
filename=realoutfilename+ Const.FILE_SEPARATOR + buildUniqueFilename(filename)+".xml";
}else if(iffileexists.equals(If_FileExists_Fail)){
// Fail
return false;
}
}
//System.out.print(filename + "\n");
if(log.isDetailed())
{
log.logDetailed(toString(),"---");
log.logDetailed(toString(), Messages.getString("JobExportRepository.Log.FolderProcessing",""+folderno,""+ totalfolders));
log.logDetailed(toString(), Messages.getString("JobExportRepository.Log.OutFilename",repdir.toString(),filename));
}
//System.out.println("Directory ID #"+d+" : "+dirids[d]+" : "+repdir + "\n");
this.repo.exportAllObjects(null, filename, repdir, "all");
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobExportRepository.Log.OutFilenameEnd",repdir.toString(),filename));
if(add_result_filesname) addFileToResultFilenames(filename,log,result,parentJob);
}
} // end if root
retval=true;
}catch(Exception e)
{
// Update errors
updateErrors();
log.logError(toString(),Messages.getString("JobExportRepository.ErrorExportingFolder",repdir.toString(),e.toString()));
}
return retval;
}
示例13: execute
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
LogWriter log = LogWriter.getInstance();
Result result = previousResult;
result.setResult( false );
if (foldername!=null)
{
String realFoldername = getRealFoldername();
FileObject FolderObject = null;
try {
FolderObject = KettleVFS.getFileObject(realFoldername);
if ( FolderObject.exists() )
{
boolean isFolder=false;
//Check if it's a folder
if(FolderObject.getType() == FileType.FOLDER) isFolder=true;
if ( isFailOfFolderExists() )
{
// Folder exists and fail flag is on.
result.setResult( false );
if(isFolder)
log.logError(toString(), "Folder ["+realFoldername+"] exists, failing.");
else
log.logError(toString(), "File ["+realFoldername+"] exists, failing.");
}
else
{
// Folder already exists, no reason to try to create it
result.setResult( true );
if(log.isDetailed())
log.logDetailed(toString(), "Folder ["+realFoldername+"] already exists, not recreating.");
}
}
else
{
// No Folder yet, create an empty Folder.
FolderObject.createFolder();
if(log.isDetailed())
log.logDetailed(toString(), "Folder ["+realFoldername+"] created!");
result.setResult( true );
}
} catch (IOException e) {
log.logError(toString(), "Could not create Folder ["+realFoldername+"], exception: " + e.getMessage());
result.setResult( false );
result.setNrErrors(1);
}
finally {
if ( FolderObject != null )
{
try {
FolderObject.close();
}
catch ( IOException ex ) {};
}
}
}
else
{
log.logError(toString(), "No Foldername is defined.");
}
return result;
}
示例14: execute
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
/**
* Execute this job entry and return the result.
* In this case it means, just set the result boolean in the Result class.
* @param previousResult The result of the previous execution
* @return The Result of the execution.
*/
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
Result result = previousResult;
result.setNrErrors(1);
result.setResult(false);
LogWriter log = LogWriter.getInstance();
if(rep==null)
{
log.logError(toString(), Messages.getString("JobEntryConnectedToRepository.Log.NotConnected"));
return result;
}
if(isspecificrep)
{
if(Const.isEmpty(repname))
{
log.logError(toString(), Messages.getString("JobEntryConnectedToRepository.Error.NoRep"));
return result;
}
String Reponame=environmentSubstitute(repname);
if(!Reponame.equals(rep.getName()))
{
log.logError(toString(), Messages.getString("JobEntryConnectedToRepository.Error.DiffRep",rep.getName(),Reponame));
return result;
}
}
if(isspecificuser)
{
if(Const.isEmpty(username))
{
log.logError(toString(), Messages.getString("JobEntryConnectedToRepository.Error.NoUser"));
return result;
}
String Username=environmentSubstitute(username);
if(!Username.equals(rep.getUserInfo().getLogin()))
{
log.logError(toString(), Messages.getString("JobEntryConnectedToRepository.Error.DiffUser",rep.getUserInfo().getLogin(),Username));
return result;
}
}
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryConnectedToRepository.Log.Connected",rep.getName(),rep.getUserInfo().getLogin()));
result.setResult(true);
result.setNrErrors(0);
return result;
}
示例15: execute
import org.pentaho.di.core.logging.LogWriter; //导入方法依赖的package包/类
public Result execute(Result previousResult, int nr, Repository rep, Job parentJob)
{
LogWriter log = LogWriter.getInstance();
Result result = previousResult;
result.setResult(false);
result.setNrErrors(1);
int nrexistcolums=0;
int nrnotexistcolums=0;
if(Const.isEmpty(tablename))
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.TablenameEmpty"));
return result;
}
if(arguments == null)
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.ColumnameEmpty"));
return result;
}
if (connection!=null)
{
Database db = new Database(connection);
try
{
String realSchemaname = environmentSubstitute(schemaname);
String realTablename = environmentSubstitute(tablename);
if(!Const.isEmpty(realSchemaname))
realTablename = db.getDatabaseMeta().getQuotedSchemaTableCombination(realSchemaname, realTablename);
else
realTablename = db.getDatabaseMeta().quoteField(realTablename);
db.connect();
if (db.checkTableExists(realTablename))
{
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryColumnsExist.Log.TableExists",realTablename));
for (int i = 0; i < arguments.length && !parentJob.isStopped(); i++)
{
String realColumnname = environmentSubstitute(arguments[i]);
realColumnname=db.getDatabaseMeta().quoteField(realColumnname);
if (db.checkColumnExists(realColumnname,realTablename))
{
if(log.isDetailed()) log.logDetailed(toString(), Messages.getString("JobEntryColumnsExist.Log.ColumnExists",realColumnname,realTablename));
nrexistcolums++;
}else
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Log.ColumnNotExists",realColumnname,realTablename));
nrnotexistcolums++;
}
}
}
else
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Log.TableNotExists",realTablename));
}
}
catch(KettleDatabaseException dbe)
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.UnexpectedError",dbe.getMessage()));
}finally
{
if(db!=null) try{db.disconnect();}catch(Exception e){};
}
}
else
{
log.logError(toString(), Messages.getString("JobEntryColumnsExist.Error.NoDbConnection"));
}
result.setEntryNr(nrnotexistcolums);
result.setNrLinesWritten(nrexistcolums);
if(nrnotexistcolums==0) result.setResult(true);
return result;
}