/** * * @param format * the format. * @return this. * @throws IllegalArgumentException * if format is invalid. */ public FastloadControlBuilder setRecordFormat( final String format ) throws IllegalArgumentException { Assert.assertNotBlank( format, "Format must not be blank" ); return line( "SET RECORD " + format ); }
/** * Append log on. Connection string must be in form [DBHOST]/[USER],[PASSWORD], e.g. localtd/user,pass; * * @param connectionString * the connection string. * @return this. * @throws IllegalArgumentException * if connection string is blank. */ public FastloadControlBuilder logon( final String connectionString ) throws IllegalArgumentException { Assert.assertNotBlank( connectionString, "Connection must not be blank" ); this.builder.append( "LOGON " ).append( connectionString ); return this.newline(); }
/** * Factory method. * * @param packageName * package name. * @return messages. * @throws IllegalArgumentException * if package name is blank. */ public static PluginMessages getMessages( final String packageName ) throws IllegalArgumentException { Assert.assertNotBlank( packageName, "Package name cannot be blank" ); PluginMessages pm = MESSAGES_MAP.get( packageName ); if ( pm == null ) { return MESSAGES_MAP.putIfAbsent( packageName, new PluginMessages( packageName ) ); } return pm; }
/** * Append log on. * * @param dbhost * DB host, e.g localtd * @param user * the user. * @param password * the password. * @return this * @throws IllegalArgumentException * if input is invalid. */ public FastloadControlBuilder logon( final String dbhost, final String user, final String password ) throws IllegalArgumentException { Assert.assertNotBlank( dbhost, "DB host must not be blank" ); Assert.assertNotBlank( user, "User must not be blank" ); Assert.assertNotNull( password, "Password must not be null" ); this.builder.append( "LOGON " ); this.builder.append( dbhost ); this.builder.append( '/' ); this.builder.append( user ); this.builder.append( ',' ); this.builder.append( password ); return this.newline(); }
/** * Issue begin loading with default error tables. * * @param table * the target table. * @return this. * @throws IllegalArgumentException * if table is invalid. */ public FastloadControlBuilder beginLoading( final String schemaName, final String table ) throws IllegalArgumentException { Assert.assertNotBlank( table ); this.builder.append( "BEGIN LOADING " ); this.builder.append( table ); this.builder.append( " ERRORFILES " ); if ( !Utils.isEmpty( schemaName ) ) { this.builder.append( schemaName ); this.builder.append( "." ); this.builder.append( DEFAULT_ERROR_TABLE1 ); this.builder.append( "," ); this.builder.append( schemaName ); this.builder.append( "." ); this.builder.append( DEFAULT_ERROR_TABLE2 ); } else { this.builder.append( DEFAULT_ERROR_TABLE1 ); this.builder.append( "," ); this.builder.append( DEFAULT_ERROR_TABLE2 ); } return this.newline(); }
public GoogleAnalyticsApiFacade( HttpTransport httpTransport, JsonFactory jsonFactory, String application, String oathServiceEmail, File keyFile ) throws IOException, GeneralSecurityException { Assert.assertNotNull( httpTransport, "HttpTransport cannot be null" ); Assert.assertNotNull( jsonFactory, "JsonFactory cannot be null" ); Assert.assertNotBlank( application, "Application name cannot be empty" ); Assert.assertNotBlank( oathServiceEmail, "OAuth Service Email name cannot be empty" ); Assert.assertNotNull( keyFile, "OAuth secret key file cannot be null" ); this.httpTransport = httpTransport; Credential credential = new GoogleCredential.Builder() .setTransport( httpTransport ) .setJsonFactory( jsonFactory ) .setServiceAccountScopes( AnalyticsScopes.all() ) .setServiceAccountId( oathServiceEmail ) .setServiceAccountPrivateKeyFromP12File( keyFile ) .build(); analytics = new Analytics.Builder( httpTransport, jsonFactory, credential ) .setApplicationName( application ) .build(); }