@Override public Repository connect( String repositoryName ) throws KettleException { IPentahoSession session = PentahoSessionHolder.getSession(); if ( session == null ) { logger.debug( "No active Pentaho Session, attempting to load PDI repository unauthenticated." ); throw new KettleException( "Attempting to create PDI Repository with no Active PentahoSession. " + "This is not allowed." ); } ICacheManager cacheManager = PentahoSystem.getCacheManager( session ); String sessionName = session.getName(); Repository repository = (Repository) cacheManager.getFromRegionCache( REGION, sessionName ); if ( repository == null ) { logger.debug( "Repository not cached for user: " + sessionName + ". Creating new Repository." ); repository = delegate.connect( repositoryName ); if ( !cacheManager.cacheEnabled( REGION ) ) { cacheManager.addCacheRegion( REGION ); } cacheManager.putInRegionCache( REGION, sessionName, repository ); } else { logger.debug( "Repository was cached for user: " + sessionName ); } return repository; } }
public static boolean inProcess() { boolean inProcess = false; boolean remoteDiServer = BooleanUtils.toBoolean( PentahoSystem.getSystemSetting( REMOTE_DI_SERVER_INSTANCE, "false" ) ); //$NON-NLS-1$ if ( "true".equals( PentahoSystem.getSystemSetting( SINGLE_DI_SERVER_INSTANCE, "true" ) ) ) { //$NON-NLS-1$ //$NON-NLS-2$ inProcess = true; } else if ( !remoteDiServer && PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() != null ) { inProcess = true; } return inProcess; } }
+ "<description>" + SINGLE_DI_SERVER_INSTANCE + "</description>" //$NON-NLS-1$ //$NON-NLS-2$ + "<repository_location_url>" + PentahoSystem.getApplicationContext().getFullyQualifiedServerURL() + "</repository_location_url>" //$NON-NLS-1$ //$NON-NLS-2$ + "<version_comment_mandatory>N</version_comment_mandatory>" //$NON-NLS-1$ repository.connect( PentahoSessionHolder.getSession().getName(), "password" );
&& PentahoSessionHolder.getSession().isAuthenticated() ) { if ( inProcess() ) { log.logDebug( BaseMessages.getString( PKG, "PurRepositoryConnector.ConnectInProgress.Begin" ) ); String name = PentahoSessionHolder.getSession().getName(); user1 = new EEUserInfo(); user1.setLogin( name ); result.setSuccess( true ); result.getUser().setAdmin( PentahoSystem.get( IAuthorizationPolicy.class ).isAllowed( IAbsSecurityProvider.ADMINISTER_SECURITY_ACTION ) );
public static String getSystemSetting( final String path, final String settingName, final String defaultValue ) { if ( PentahoSystem.systemSettingsService == null ) { return defaultValue; } return PentahoSystem.systemSettingsService.getSystemSetting( path, settingName, defaultValue ); }
protected void createFeedbackParameter( final String fieldName, final String displayName, final String hint, final String defaultValue, final boolean visible, boolean optional ) { runtimeContext.createFeedbackParameter( fieldName, displayName, hint, defaultValue, visible, optional ); if ( !optional ) { runtimeContext.promptNeeded(); } }
private void setCurrentValues() { lastMessages = serverStatusProvider.getStatusMessages(); lastServerStatus = serverStatusProvider.getStatus(); } }
/** * */ public void dispose() { if ( context != null ) { context.dispose(); } }
/** * This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be * removed from the cache. * */ public void clearCache() { cacheManager.removeRegionCache( IDBDatasourceService.JDBC_DATASOURCE ); }
public static void systemEntryPoint() { if ( PentahoSystem.applicationContext != null ) { PentahoSystem.applicationContext.invokeEntryPoints(); } }
public static void systemExitPoint() { if ( PentahoSystem.applicationContext != null ) { PentahoSystem.applicationContext.invokeExitPoints(); } }
public void setStatusMessages( String[] messages ) { if ( this.messages != messages ) { this.messages = messages; fireOnChange(); } }
public synchronized void clearCaches() { if ( cacheManager != null ) { cacheManager.clearRegionCache( ROLE_CACHE_REGION ); cacheManager.clearRegionCache( USER_CACHE_REGION ); } }
@SuppressWarnings( "nls" ) public void printActionExecutionStack( PrintWriter s ) { if ( actionDefinition != null ) { _printStack( actionDefinition, s, "" ); } }
/** * This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be * removed from the cache. * */ public void clearDataSource( String dsName ) { cacheManager.removeFromRegionCache( IDBDatasourceService.JDBC_DATASOURCE, dsName ); }
private void fireOnChange() { for ( IServerStatusChangeListener listener : listeners ) { listener.onStatusChange(); } }
/** * Sets an IPentahoRequestContext for the current thread * * @param requestContext */ public static void setRequestContext( IPentahoRequestContext requestContext ) { strategy.setRequestContext( requestContext ); }
/** * Removes the IPentahoRequestContext for the current thread. It is important that the framework calls this to * prevent RequestContext bleed- through between requests as threads are re-used by the server. */ public static void removeRequestContext() { strategy.removeRequestContext(); }
public static String getSystemSetting( final String settingName, final String defaultValue ) { // TODO make this more efficient using caching if ( PentahoSystem.systemSettingsService == null ) { return defaultValue; } return PentahoSystem.systemSettingsService.getSystemSetting( settingName, defaultValue ); }
public void createFeedbackParameter( final String fieldName, final String displayName, final String hint, final Object defaultValues, final List values, final Map dispNames, final String displayStyle ) { runtimeContext.createFeedbackParameter( fieldName, displayName, hint, defaultValues, values, dispNames, displayStyle ); runtimeContext.promptNeeded(); }