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

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

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

Repository.hasService介绍

[英]Checks whether a given repository service is available or not
[中]检查给定的存储库服务是否可用

代码示例

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

private boolean supportsLocking( Repository repository ) throws KettleException {
 return repository.hasService( ILockService.class );
}

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

private void initializeService( Repository rep ) {
 try {
  if ( rep.hasService( IAclService.class ) ) {
   aclService = (IAclService) rep.getService( IAclService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

private ILockService getService( Repository repository ) throws KettleException {
 if ( service == null ) {
  if ( repository != null && repository.hasService( ILockService.class ) ) {
   return (ILockService) repository.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
 } else {
  return service;
 }
}

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

protected boolean initService() {
 try {
  // Get the service from the repository
  if ( repository != null && repository.hasService( RepositorySecurityManager.class ) ) {
   service = (RepositorySecurityManager) repository.getService( RepositorySecurityManager.class );
   return true;
  } else {
   return false;
  }
 } catch ( Exception e ) {
  throw new RuntimeException( e );
 }
}

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

private ILockService getService( Repository repository ) throws KettleException {
  if ( repository.hasService( ILockService.class ) ) {
   return (ILockService) repository.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
 }
}

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

private void initializeService( Repository rep ) {
 try {
  if ( rep.hasService( IAclService.class ) ) {
   aclService = (IAclService) rep.getService( IAclService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

@Override
protected boolean initService() {
 try {
  if ( repository.hasService( IRoleSupportSecurityManager.class ) ) {
   service = (RepositorySecurityManager) repository.getService( IRoleSupportSecurityManager.class );
  } else {
   return false;
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

@Override
public boolean hasService( Class<? extends IRepositoryService> aClass ) throws KettleException {
 return getDelegate().hasService( aClass );
}

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

public UIEEJob( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent, Repository rep ) {
 super( rc, parent, rep );
 if ( !( rc instanceof EERepositoryObject ) ) {
  throw new IllegalArgumentException();
 }
 repObj = (EERepositoryObject) rc;
 try {
  if ( rep.hasService( ILockService.class ) ) {
   lockService = (ILockService) rep.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
  if ( rep.hasService( IRevisionService.class ) ) {
   revisionService = (IRevisionService) rep.getService( IRevisionService.class );
  } else {
   throw new IllegalStateException();
  }
  if ( rep.hasService( IAclService.class ) ) {
   aclService = (IAclService) rep.getService( IAclService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

public SpoonEEJobDelegate( Spoon spoon ) {
 super( spoon );
 Repository repository = spoon.getRepository();
 try {
  if ( repository.hasService( ILockService.class ) ) {
   service = (ILockService) repository.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

public SpoonEETransformationDelegate( Spoon spoon ) {
 super( spoon );
 Repository repository = spoon.getRepository();
 try {
  if ( repository.hasService( ILockService.class ) ) {
   service = (ILockService) repository.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

public UIEETransformation( RepositoryElementMetaInterface rc, UIRepositoryDirectory parent, Repository rep ) {
 super( rc, parent, rep );
 if ( !( rc instanceof EERepositoryObject ) ) {
  throw new IllegalArgumentException();
 }
 repObj = (EERepositoryObject) rc;
 try {
  if ( rep.hasService( ILockService.class ) ) {
   lockService = (ILockService) rep.getService( ILockService.class );
  } else {
   throw new IllegalStateException();
  }
  if ( rep.hasService( IRevisionService.class ) ) {
   revisionService = (IRevisionService) rep.getService( IRevisionService.class );
  } else {
   throw new IllegalStateException();
  }
  if ( rep.hasService( IAclService.class ) ) {
   aclService = (IAclService) rep.getService( IAclService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
}

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

@Override
protected boolean initService() {
 try {
  if ( repository.hasService( IAbsSecurityManager.class ) ) {
   service = (RepositorySecurityManager) repository.getService( IAbsSecurityManager.class );
   String localeValue = null;
   try {
    localeValue = GlobalMessageUtil.getLocale().getDisplayName();
   } catch ( MissingResourceException e ) {
    localeValue = GlobalMessageUtil.FAILOVER_LOCALE.toString();
   }
   ( (IAbsSecurityManager) service ).initialize( localeValue );
  } else {
   return false;
  }
 } catch ( Exception e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

@Override
protected boolean doLazyInit() {
 boolean superSucceeded = super.doLazyInit();
 if ( !superSucceeded ) {
  return false;
 }
 try {
  if ( repository.hasService( IAbsSecurityProvider.class ) ) {
   service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class );
   setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) );
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

@Override
protected boolean doLazyInit() {
 boolean superSucceeded = super.doLazyInit();
 if ( !superSucceeded ) {
  return false;
 }
 try {
  if ( repository.hasService( IAbsSecurityProvider.class ) ) {
   service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class );
   setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) );
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

@Override
protected boolean doLazyInit() {
 boolean superSucceeded = super.doLazyInit();
 if ( !superSucceeded ) {
  return false;
 }
 try {
  if ( repository.hasService( IAbsSecurityProvider.class ) ) {
   service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class );
   setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) );
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

@Override
protected boolean doLazyInit() {
 boolean superSucceeded = super.doLazyInit();
 if ( !superSucceeded ) {
  return false;
 }
 try {
  if ( repository.hasService( IAbsSecurityProvider.class ) ) {
   service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class );
   setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) );
  }
 } catch ( KettleException e ) {
  throw new RuntimeException( e );
 }
 return true;
}

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

public PurRepositoryRevisionBrowserDialog( Shell parent, int style, Repository repository,
  RepositoryElementInterface element ) {
 this.display = parent.getDisplay();
 this.props = PropsUI.getInstance();
 this.repository = repository;
 this.element = element;
 try {
  if ( repository.hasService( IRevisionService.class ) ) {
   revisionService = (IRevisionService) repository.getService( IRevisionService.class );
  } else {
   throw new IllegalStateException();
  }
 } catch ( KettleException e ) {
  throw new IllegalStateException( e );
 }
 String name = element.getRepositoryElementType().toString() + " " + element.getRepositoryDirectory().getPath();
 if ( !name.endsWith( "/" ) )
  name += "/";
 name += element.getName();
 this.elementDescription = name;
 shell = new Shell( display, style | SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
 shell.setText( BaseMessages.getString( PKG, "PurRepositoryRevisionBrowserDialog.Dialog.Main.Title" ) ); //$NON-NLS-1$
}

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

public void init( Repository repository ) throws ControllerInitializationException {
 try {
  if ( repository.hasService( IAbsSecurityProvider.class ) ) {
   service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class );
   bf = new DefaultBindingFactory();
   bf.setDocument( this.getXulDomContainer().getDocumentRoot() );
   if ( bf != null ) {
    createBindings();
   }
   setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) );
  }
 } catch ( KettleException e ) {
  throw new ControllerInitializationException( e );
 }
}

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

protected void init( Repository rep ) throws Exception {
 if ( rep != null && rep.hasService( RepositorySecurityProvider.class ) ) {
  service = (RepositorySecurityProvider) rep.getService( RepositorySecurityProvider.class );
 } else {
  throw new ControllerInitializationException( BaseMessages.getString( PKG,
    "PermissionsController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", RepositorySecurityManager.class ) ); //$NON-NLS-1$
 }
 messageBox = (XulMessageBox) document.createElement( "messagebox" );//$NON-NLS-1$ 
 viewAclsModel = new UIRepositoryObjectAcls();
 manageAclsModel = new UIRepositoryObjectAclModel( viewAclsModel );
 bf = new DefaultBindingFactory();
 bf.setDocument( this.getXulDomContainer().getDocumentRoot() );
 mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" );
 confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );//$NON-NLS-1$
 confirmBox.setTitle( BaseMessages.getString( PKG, "PermissionsController.RemoveAclWarning" ) ); //$NON-NLS-1$
 confirmBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.RemoveAclWarningText" ) ); //$NON-NLS-1$
 confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
 confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) ); //$NON-NLS-1$
 confirmBox.addDialogCallback( new XulDialogCallback<Object>() {
  public void onClose( XulComponent sender, Status returnCode, Object retVal ) {
   if ( returnCode == Status.ACCEPT ) {
    viewAclsModel.removeSelectedAcls();
   }
  }
  public void onError( XulComponent sender, Throwable t ) {
  }
 } );
}

相关文章

Repository类方法