本文整理了Java中org.pentaho.di.repository.Repository.insertLogEntry
方法的一些代码示例,展示了Repository.insertLogEntry
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.insertLogEntry
方法的具体详情如下:
包路径:org.pentaho.di.repository.Repository
类名称:Repository
方法名:insertLogEntry
[英]Insert an entry in the audit trail of the repository. This is an optional operation and depends on the capabilities of the underlying repository.
[中]在存储库的审核跟踪中插入条目。这是一个可选操作,取决于基础存储库的功能。
代码示例来源:origin: pentaho/pentaho-kettle
@Override
public ObjectId insertLogEntry( String s ) throws KettleException {
return getDelegate().insertLogEntry( s );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void editSlaveServer( String slaveName ) {
try {
ObjectId id = rep.getSlaveID( slaveName );
SlaveServer slaveServer = rep.loadSlaveServer( id, null ); // Load the last version
SlaveServerDialog dd = new SlaveServerDialog( shell, slaveServer );
if ( dd.open() ) {
rep.insertLogEntry( "Updating slave server '" + slaveServer.getName() + "'" );
rep.save( slaveServer, Const.VERSION_COMMENT_EDIT_VERSION, null );
if ( !slaveName.equalsIgnoreCase( slaveServer.getName() ) ) {
refreshTree();
}
}
} catch ( KettleException e ) {
new ErrorDialog(
shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Slave.Edit.UnexpectedError.Title" ), BaseMessages
.getString( PKG, "RepositoryExplorerDialog.Slave.Edit.UnexpectedError.Message" )
+ slaveName + "]", e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void editCluster( String clusterName ) {
try {
ObjectId id = rep.getClusterID( clusterName );
ClusterSchema cluster = rep.loadClusterSchema( id, rep.getSlaveServers(), null ); // Load the last version
ClusterSchemaDialog dd = new ClusterSchemaDialog( shell, cluster, rep.getSlaveServers() );
if ( dd.open() ) {
rep.insertLogEntry( "Updating cluster '" + cluster.getName() + "'" );
rep.save( cluster, Const.VERSION_COMMENT_EDIT_VERSION, null );
if ( !clusterName.equalsIgnoreCase( cluster.getName() ) ) {
refreshTree();
}
}
} catch ( KettleException e ) {
//CHECKSTYLE:LineLength:OFF
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Cluster.Edit.UnexpectedError.Message" ) + clusterName + "]", e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void editPartitionSchema( String partitionSchemaName ) {
try {
ObjectId id = rep.getPartitionSchemaID( partitionSchemaName );
PartitionSchema partitionSchema = rep.loadPartitionSchema( id, null ); // Load the last version
PartitionSchemaDialog dd =
new PartitionSchemaDialog( shell, partitionSchema, rep.readDatabases(), variableSpace );
if ( dd.open() ) {
rep.insertLogEntry( "Updating partition schema '" + partitionSchema.getName() + "'" );
rep.save( partitionSchema, Const.VERSION_COMMENT_EDIT_VERSION, null );
if ( !partitionSchemaName.equalsIgnoreCase( partitionSchema.getName() ) ) {
refreshTree();
}
}
} catch ( KettleException e ) {
new ErrorDialog(
shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Edit.UnexpectedError.Message" )
+ partitionSchemaName + "]", e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void saveConnection( DatabaseMeta db, String versionComment ) {
// Also add to repository?
Repository rep = spoon.getRepository();
if ( rep != null ) {
if ( !rep.getSecurityProvider().isReadOnly() ) {
try {
if ( Utils.isEmpty( versionComment ) ) {
rep.insertLogEntry( "Saving database '" + db.getName() + "'" );
} else {
rep.insertLogEntry( "Save database : " + versionComment );
}
rep.save( db, versionComment, null );
spoon.getLog().logDetailed(
BaseMessages.getString( PKG, "Spoon.Log.SavedDatabaseConnection", db.getDatabaseName() ) );
db.setChanged( false );
} catch ( KettleException ke ) {
new ErrorDialog( spoon.getShell(),
BaseMessages.getString( PKG, "Spoon.Dialog.ErrorSavingConnection.Title" ),
BaseMessages.getString( PKG, "Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName() ), ke );
}
} else {
// This repository user is read-only!
//
new ErrorDialog(
spoon.getShell(), BaseMessages.getString( PKG, "Spoon.Dialog.UnableSave.Title" ), BaseMessages
.getString( PKG, "Spoon.Dialog.ErrorSavingConnection.Message", db.getDatabaseName() ),
new KettleException( BaseMessages.getString( PKG, "Spoon.Dialog.Exception.ReadOnlyRepositoryUser" ) ) );
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
if ( idRenamed == null || idRenamed.equals( idDatabase ) ) {
repository.insertLogEntry( BaseMessages.getString(
PKG, "ConnectionsController.Message.UpdatingDatabase", databaseMeta.getName() ) );
repository.save( databaseMeta, Const.VERSION_COMMENT_EDIT_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
public void editDatabase( String databasename ) {
try {
ObjectId idDatabase = rep.getDatabaseID( databasename );
DatabaseMeta databaseMeta = rep.loadDatabaseMeta( idDatabase, null ); // reads last version
getDatabaseDialog().setDatabaseMeta( databaseMeta );
String name = getDatabaseDialog().open();
if ( name != null ) {
if ( !readonly ) {
rep.insertLogEntry( "Updating database connection '"
+ getDatabaseDialog().getDatabaseMeta().getName() + "'" );
rep.save( databaseMeta, Const.VERSION_COMMENT_EDIT_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_WARNING | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.Connection.Edit.NotAllowed.Message" ) );
mb.setText( BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Edit.NotAllowed.Title" ) );
mb.open();
}
if ( !databasename.equalsIgnoreCase( name ) ) {
refreshTree();
}
}
} catch ( KettleException e ) {
new ErrorDialog(
shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Edit.UnexpectedError.Title" ), BaseMessages
.getString( PKG, "RepositoryExplorerDialog.Connection.Edit.UnexpectedError.Message" )
+ databasename + "]", e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
rep.insertLogEntry( "Renaming database connection '"
+ getDatabaseDialog().getDatabaseMeta().getName() + "'" );
rep.save( databaseMeta, Const.VERSION_COMMENT_EDIT_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
repository.insertLogEntry( BaseMessages.getString(
PKG, "ConnectionsController.Message.CreatingDatabase", getDatabaseDialog()
.getDatabaseMeta().getName() ) );
代码示例来源:origin: pentaho/pentaho-kettle
public void newSlaveServer() {
try {
SlaveServer slaveServer = new SlaveServer();
SlaveServerDialog dd = new SlaveServerDialog( shell, slaveServer, rep.getSlaveServers() );
if ( dd.open() ) {
// See if this slave server already exists...
ObjectId idSlave = rep.getSlaveID( slaveServer.getName() );
if ( idSlave == null ) {
rep.insertLogEntry( "Creating new slave server '" + slaveServer.getName() + "'" );
rep.save( slaveServer, Const.VERSION_COMMENT_INITIAL_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.Slave.Create.AlreadyExists.Message" ) );
mb.setText( BaseMessages.getString( PKG, "RepositoryExplorerDialog.Slave.Create.AlreadyExists.Title" ) );
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Message" ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void newCluster() {
try {
ClusterSchema cluster = new ClusterSchema();
ClusterSchemaDialog dd = new ClusterSchemaDialog( shell, cluster, rep.getSlaveServers() );
if ( dd.open() ) {
// See if this slave server already exists...
ObjectId idCluster = rep.getClusterID( cluster.getName() );
if ( idCluster == null ) {
rep.insertLogEntry( "Creating new cluster '" + cluster.getName() + "'" );
rep.save( cluster, Const.VERSION_COMMENT_INITIAL_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.Cluster.Create.AlreadyExists.Message" ) );
mb
.setText( BaseMessages
.getString( PKG, "RepositoryExplorerDialog.Cluster.Create.AlreadyExists.Title" ) );
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Cluster.Create.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Cluster.Create.UnexpectedError.Message" ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public void newPartitionSchema() {
try {
PartitionSchema partitionSchema = new PartitionSchema();
PartitionSchemaDialog dd =
new PartitionSchemaDialog( shell, partitionSchema, rep.readDatabases(), variableSpace );
if ( dd.open() ) {
// See if this slave server already exists...
ObjectId idPartitionSchema = rep.getPartitionSchemaID( partitionSchema.getName() );
if ( idPartitionSchema == null ) {
rep.insertLogEntry( "Creating new partition schema '" + partitionSchema.getName() + "'" );
rep.save( partitionSchema, Const.VERSION_COMMENT_INITIAL_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Message" ) );
mb.setText( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.PartitionSchema.Create.AlreadyExists.Title" ) );
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.PartitionSchema.Create.UnexpectedError.Message" ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
if ( ssd.open() ) {
if ( slaveServer.getName() != null && !slaveServer.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
PKG, "SlavesController.Message.UpdatingSlave", slaveServer.getName() ) );
repository.save( slaveServer, Const.VERSION_COMMENT_EDIT_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
if ( partitionDialog.open() ) {
if ( partitionSchema.getName() != null && !partitionSchema.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
RepositoryExplorer.class, "PartitionsController.Message.UpdatingPartition", partitionSchema
.getName() ) );
代码示例来源:origin: pentaho/pentaho-kettle
if ( csd.open() ) {
if ( clusterSchema.getName() != null && !clusterSchema.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
PKG, "ClusterController.Message.UpdatingCluster", clusterSchema.getName() ) );
repository.save( clusterSchema, Const.VERSION_COMMENT_EDIT_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
public void newDatabase() {
try {
DatabaseMeta databaseMeta = new DatabaseMeta();
databaseMeta.initializeVariablesFrom( null );
getDatabaseDialog().setDatabaseMeta( databaseMeta );
String name = getDatabaseDialog().open();
if ( name != null ) {
// See if this user already exists...
ObjectId idDatabase = rep.getDatabaseID( name );
if ( idDatabase == null ) {
rep.insertLogEntry( "Creating new database '" + databaseMeta.getName() + "'" );
rep.save( databaseMeta, Const.VERSION_COMMENT_INITIAL_VERSION, null );
} else {
MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.Connection.Create.AlreadyExists.Message" ) );
mb.setText( BaseMessages.getString(
PKG, "RepositoryExplorerDialog.Connection.Create.AlreadyExists.Title" ) );
mb.open();
}
// Refresh tree...
refreshTree();
}
} catch ( KettleException e ) {
new ErrorDialog( shell,
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Title" ),
BaseMessages.getString( PKG, "RepositoryExplorerDialog.Connection.Create.UnexpectedError.Message" ), e );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
if ( idPartition == null ) {
if ( partition.getName() != null && !partition.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
RepositoryExplorer.class, "PartitionsController.Message.CreatingPartition", partition.getName() ) );
repository.save( partition, Const.VERSION_COMMENT_INITIAL_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
if ( idCluster == null ) {
if ( cluster.getName() != null && !cluster.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
RepositoryExplorer.class, "ClusterController.Message.CreatingNewCluster", cluster.getName() ) );
repository.save( cluster, Const.VERSION_COMMENT_INITIAL_VERSION, null );
代码示例来源:origin: pentaho/pentaho-kettle
} else {
if ( slaveServer.getName() != null && !slaveServer.getName().equals( "" ) ) {
repository.insertLogEntry( BaseMessages.getString(
PKG, "SlavesController.Message.CreatingSlave", slaveServer.getName() ) );
repository.save( slaveServer, Const.VERSION_COMMENT_INITIAL_VERSION, null );
内容来源于网络,如有侵权,请联系作者删除!