org.pentaho.di.repository.Repository.getUserInfo()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.1k)|赞(0)|评价(0)|浏览(138)

本文整理了Java中org.pentaho.di.repository.Repository.getUserInfo方法的一些代码示例,展示了Repository.getUserInfo的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.getUserInfo方法的具体详情如下:
包路径:org.pentaho.di.repository.Repository
类名称:Repository
方法名:getUserInfo

Repository.getUserInfo介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public String getUsername() {
 if ( rep == null || rep.getUserInfo() == null ) {
  return "";
 }
 return rep.getUserInfo().getLogin();
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public IUser getUserInfo() {
 return getDelegate().getUserInfo();
}

代码示例来源:origin: pentaho/pentaho-kettle

private String getLogin() {
 String login = "file_repository_no_login";
 if ( getSpoon().rep.getUserInfo() != null ) {
  login = getSpoon().rep.getUserInfo().getLogin();
 }
 return login;
}

代码示例来源:origin: pentaho/pentaho-kettle

public SchedulerRequest build() {
 baseUrl = getRepositoryServiceBaseUrl();
 httpPost = new HttpPost( baseUrl + API_SCHEDULER_JOB );
 httpPost.setHeader( CONTENT_TYPE, APPLICATION_XML );
 String username = repository.getUserInfo().getName();
 String password = repository.getUserInfo().getPassword();
 if ( username != null && password != null ) {
  byte[] encoding;
  try {
   String userPass = username + ":" + password;
   encoding = Base64.getEncoder().encode( userPass.getBytes( UTF_8 ) );
   httpPost.setHeader( AUTHORIZATION, "Basic " + new String( encoding ) );
  } catch ( UnsupportedEncodingException e ) {
   e.printStackTrace();
  }
 }
 return new SchedulerRequest( this );
}

代码示例来源:origin: pentaho/pentaho-kettle

private Boolean isAdmin() {
  return getRepository().getUserInfo().isAdmin();
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Sets the executor's user and Server information
 */
public static void setExecutionInformation( ExecutorInterface executor, Repository repository ) {
 // Capture the executing user and server name...
 executor.setExecutingUser( System.getProperty( "user.name" ) );
 if ( repository != null ) {
  IUser userInfo = repository.getUserInfo();
  if ( userInfo != null ) {
   executor.setExecutingUser( userInfo.getLogin() );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

protected void saveJobMeta( JobMeta jobMeta ) throws KettleException {
 // Keep info on who & when this transformation was created...
 if ( jobMeta.getCreatedUser() == null || jobMeta.getCreatedUser().equals( "-" ) ) {
  jobMeta.setCreatedDate( new Date() );
  if ( rep.getUserInfo() != null ) {
   jobMeta.setCreatedUser( rep.getUserInfo().getLogin() );
  } else {
   jobMeta.setCreatedUser( null );
  }
 }
 rep.save( jobMeta, versionComment, null, overwrite );
}

代码示例来源:origin: pentaho/pentaho-kettle

private Principal getActingPrincipal( TransMeta transMeta ) {
  if ( transMeta.getRepository() == null || transMeta.getRepository().getUserInfo() == null ) {
   return ActingPrincipal.ANONYMOUS;
  }
  return new ActingPrincipal( transMeta.getRepository().getUserInfo().getName() );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public Boolean sourceToTarget( List<UIRepositoryObject> selectedRepoObjects ) {
 boolean result = false;
 try {
  if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof UIRepositoryDirectory ) {
   return true;
  } else if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof ILockObject ) {
   final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get( 0 );
   if ( ( (ILockObject) contentToLock ).isLocked() ) {
    if ( repository instanceof PurRepository
        //repository can be Proxy of repository and first part condition will fail
        || repository.getRepositoryMeta() instanceof PurRepositoryMeta ) {
     result = service.canUnlockFileById( contentToLock.getObjectId() );
    } else {
     result =
       ( (ILockObject) contentToLock ).getRepositoryLock().getLogin().equalsIgnoreCase(
         repository.getUserInfo().getLogin() );
    }
   } else {
    // Content is not locked, permit locking
    result = true;
   }
  }
 } catch ( Exception e ) {
  throw new RuntimeException( e );
 }
 return result;
}

代码示例来源:origin: pentaho/pentaho-kettle

public void update() {
 Rectangle rect = toolBar.getBounds();
 if ( connectDropdown != null && !connectDropdown.isDisposed() ) {
  if ( spoon.rep != null ) {
   StringBuilder connectionLabel = new StringBuilder();
   if ( spoon.rep.getUserInfo() != null ) {
    connectionLabel.append( spoon.rep.getUserInfo().getLogin() );
    connectionLabel.append( "  |  " );
   }
   StringBuilder connectionLabelTip = new StringBuilder( connectionLabel.toString() );
   if ( repoConnectController != null && repoConnectController.getConnectedRepository() != null ) {
    connectionLabel.append( truncateName( spoon.getRepositoryName() ) );
    connectionLabelTip.append( spoon.getRepositoryName() );
   }
   connectDropdown.setText( connectionLabel.toString() );
   connectDropdown.setToolTipText( connectionLabelTip.toString() );
  } else {
   connectDropdown.setText( BaseMessages.getString( PKG, "RepositoryConnectMenu.Connect" ) );
  }
 }
 // This fixes some SWT goofiness
 toolBar.pack();
 toolBar.setBounds( rect );
}

代码示例来源:origin: pentaho/pentaho-kettle

xml.append( XMLHandler.addTagValue( "name", repository.getName() ) );
if ( repository.getUserInfo() != null ) {
 xml.append( XMLHandler.addTagValue( "login", repository.getUserInfo().getLogin() ) );
 xml.append( XMLHandler.addTagValue( "password", Encr.encryptPassword( repository
  .getUserInfo().getPassword() ) ) );

代码示例来源:origin: pentaho/pentaho-kettle

IUser userInfo = Spoon.getInstance().rep.getUserInfo();
String repoAndUser = Spoon.getInstance().rep.getName() + ":" + ( userInfo != null ? userInfo.getLogin() : "" );
List<LastUsedFile> lastUsedFiles =

代码示例来源:origin: pentaho/pentaho-kettle

result =
  ( (ILockObject) contentToLock ).getRepositoryLock().getLogin().equalsIgnoreCase(
    repository.getUserInfo().getLogin() );

代码示例来源:origin: pentaho/pentaho-kettle

protected void doCreateBindings() {
 deck = (XulDeck) document.getElementById( "browse-tab-right-panel-deck" ); //$NON-NLS-1$
 trashFileTable = selectDeletedFileTable( repository.getUserInfo().isAdmin() );
 deleteButton = (XulButton) document.getElementById( "delete-button" ); //$NON-NLS-1$
 undeleteButton = (XulButton) document.getElementById( "undelete-button" ); //$NON-NLS-1$
 bf.setBindingType( Binding.Type.ONE_WAY );
 BindingConvertor<List<UIDeletedObject>, Boolean>
  buttonConverter =
  new BindingConvertor<List<UIDeletedObject>, Boolean>() {
   @Override public Boolean sourceToTarget( List<UIDeletedObject> value ) {
    if ( value != null && value.size() > 0 ) {
     return true;
    }
    return false;
   }
   @Override public List<UIDeletedObject> targetToSource( Boolean value ) {
    return null;
   }
  };
 createTrashTableBindings( buttonConverter, trashFileTable );
}

代码示例来源:origin: pentaho/pentaho-kettle

if ( job.getRep().getUserInfo() != null ) {
 job.getRep().connect( job.getRep().getUserInfo().getLogin(), job.getRep().getUserInfo().getPassword() );
} else {
 job.getRep().connect( null, null );

代码示例来源:origin: pentaho/pentaho-kettle

@Override public void callExtensionPoint( LogChannelInterface logChannelInterface, Object o ) throws KettleException {
 FileDialogOperation fileDialogOperation = (FileDialogOperation) o;
 PropsUI propsUI = propsUISupplier.get();
 String startingDir = null;
 if ( fileDialogOperation.getRepository() == null ) {
  String username = getRepository().getUserInfo() != null ? getRepository().getUserInfo().getLogin() : "";
  String repoAndUser = getRepository().getName() + ":" + username;
  List<LastUsedFile> lastUsedFileList =
   propsUI.getLastUsedRepoFiles().getOrDefault( repoAndUser, Collections.emptyList() );
  startingDir = getStartingDir( fileDialogOperation, lastUsedFileList );
 } else {
  startingDir = fileDialogOperation.getStartDir();
 }
 RepositoryOpenSaveDialog repositoryOpenSaveDialog =
  new RepositoryOpenSaveDialog( spoonSupplier.get().getShell(), WIDTH, HEIGHT );
 repositoryOpenSaveDialog.open( fileDialogOperation.getRepository(), startingDir, fileDialogOperation.getCommand(),
  fileDialogOperation.getTitle(), fileDialogOperation.getFilter(), fileDialogOperation.getOrigin(),
  fileDialogOperation.getFilename(), fileDialogOperation.getFileType() );
 if ( !Utils.isEmpty( repositoryOpenSaveDialog.getObjectName() ) ) {
  RepositoryObject repositoryObject = new RepositoryObject();
  repositoryObject.setObjectId( repositoryOpenSaveDialog::getObjectId );
  repositoryObject.setName( repositoryOpenSaveDialog.getObjectName() );
  repositoryObject
   .setRepositoryDirectory( getRepository().findDirectory( repositoryOpenSaveDialog.getObjectDirectory() ) );
  repositoryObject.setObjectType(
   repositoryOpenSaveDialog.getObjectType().equals( TRANSFORMATION ) ? RepositoryObjectType.TRANSFORMATION
    : RepositoryObjectType.JOB );
  fileDialogOperation.setRepositoryObject( repositoryObject );
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

&& !realUsername.equals( rep.getSecurityProvider().getUserInfo().getLogin() ) ) {
logError( BaseMessages.getString( PKG, "JobEntryConnectedToRepository.Error.DiffUser", rep
 .getUserInfo().getLogin(), realUsername ) );
return result;
.getUserInfo() != null ? rep.getUserInfo().getLogin() : "" ) );

代码示例来源:origin: pentaho/pentaho-kettle

.isTrue( repository.getUserInfo().isAdmin() ), false, false );

代码示例来源:origin: pentaho/pentaho-kettle

} else {
 setLockingAllowed( repoLock.getLogin().equalsIgnoreCase(
   Spoon.getInstance().getRepository().getUserInfo().getLogin() ) );

代码示例来源:origin: pentaho/pentaho-kettle

MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );
mb.setMessage( BaseMessages.getString( PKG, "SelectDirectoryDialog.Dialog.PermissionDenied.Message1" )
  + ( rep.getUserInfo() == null ? "" : rep.getUserInfo().getLogin() )
  + BaseMessages.getString( PKG, "SelectDirectoryDialog.Dialog.PermissionDenied.Message2" ) );
mb.setText( BaseMessages.getString( PKG, "SelectDirectoryDialog.Dialog.PermissionDenied.Title" ) );

相关文章

Repository类方法