@Test public void testSetCalendarEndNull() throws KettleException { SalesforceConnection connection = new SalesforceConnection( logInterface, url, username, password ); GregorianCalendar startDate = new GregorianCalendar( 2000, 2, 10 ); try { connection.setCalendar( recordsFilter, startDate, null ); fail(); } catch ( KettleException expected ) { } }
public void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ) throws KettleException { this.startDate = startDate; this.endDate = endDate; this.recordsFilter = recordsFilter; if ( this.startDate == null || this.endDate == null ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.EmptyStartDateOrEndDate" ) ); } if ( this.startDate.getTime().compareTo( this.endDate.getTime() ) >= 0 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.WrongDates" ) ); } long diffDays = ( this.endDate.getTime().getTime() - this.startDate.getTime().getTime() ) / ( 24 * 60 * 60 * 1000 ); if ( diffDays > 30 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.StartDateTooOlder" ) ); } }
SalesforceConnection { public void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ) throws KettleException { this.startDate = startDate; this.endDate = endDate; this.recordsFilter = recordsFilter; if ( this.startDate == null || this.endDate == null ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.EmptyStartDateOrEndDate" ) ); } if ( this.startDate.getTime().compareTo( this.endDate.getTime() ) >= 0 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.WrongDates" ) ); } long diffDays = ( this.endDate.getTime().getTime() - this.startDate.getTime().getTime() ) / ( 24 * 60 * 60 * 1000 ); if ( diffDays > 30 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.StartDateTooOlder" ) ); } } }
SalesforceConnection { public void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ) throws KettleException { this.startDate = startDate; this.endDate = endDate; this.recordsFilter = recordsFilter; if ( this.startDate == null || this.endDate == null ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.EmptyStartDateOrEndDate" ) ); } if ( this.startDate.getTime().compareTo( this.endDate.getTime() ) >= 0 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.WrongDates" ) ); } long diffDays = ( this.endDate.getTime().getTime() - this.startDate.getTime().getTime() ) / ( 24 * 60 * 60 * 1000 ); if ( diffDays > 30 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.StartDateTooOlder" ) ); } } SalesforceConnection( LogChannelInterface logInterface, String url, String username, String password ); }
SalesforceConnection { public void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ) throws KettleException { this.startDate = startDate; this.endDate = endDate; this.recordsFilter = recordsFilter; if ( this.startDate == null || this.endDate == null ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.EmptyStartDateOrEndDate" ) ); } if ( this.startDate.getTime().compareTo( this.endDate.getTime() ) >= 0 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.WrongDates" ) ); } long diffDays = ( this.endDate.getTime().getTime() - this.startDate.getTime().getTime() ) / ( 24 * 60 * 60 * 1000 ); if ( diffDays > 30 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.StartDateTooOlder" ) ); } } SalesforceConnection( LogChannelInterface logInterface, String url, String username, String password ); boolean isRollbackAllChangesOnError(); @Deprecated void rollbackAllChangesOnError( boolean value ); void setRollbackAllChangesOnError( boolean value ); boolean isQueryAll(); @Deprecated void queryAll( boolean value ); void setQueryAll( boolean value ); void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ); void setSQL( String sql ); void setFieldsList( String fieldsList ); void setModule( String module ); String getURL(); String getSQL(); Date getServerTimestamp(); String getModule(); QueryResult getQueryResult(); PartnerConnection createBinding( ConnectorConfig config ); PartnerConnection getBinding(); void setTimeOut( int timeout ); int getTimeOut(); boolean isUsingCompression(); void setUsingCompression( boolean useCompression ); String getUsername(); void setUsername( String value ); String getPassword(); void setPassword( String value ); void connect(); void query( boolean specifyQuery ); void close(); int getQueryResultSize(); int getRecordsCount(); SalesforceRecordValue getRecord( int recordIndex ); String getRecordValue( SObject con, String fieldname ); XmlObject[] getElements(); boolean queryMore(); String[] getAllAvailableObjects( boolean OnlyQueryableObjects ); Field[] getObjectFields( String objectName ); Field[] getObjectFields( String objectName, boolean excludeNonUpdatableFields ); String[] getFields( String objectName ); String[] getFields( String objectName, boolean excludeNonUpdatableFields ); String[] getFields( Field[] fields ); String[] getFields( Field[] fields, boolean excludeNonUpdatableFields ); UpsertResult[] upsert( String upsertField, SObject[] sfBuffer ); SaveResult[] insert( SObject[] sfBuffer ); SaveResult[] update( SObject[] sfBuffer ); DeleteResult[] delete( String[] id ); static XmlObject createMessageElement( String name, Object value, boolean useExternalKey ); static XmlObject fromTemplateElement( String name, Object value, boolean setValue ); static XmlObject[] getChildren( SObject object ); }
SalesforceConnection { public void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ) throws KettleException { this.startDate = startDate; this.endDate = endDate; this.recordsFilter = recordsFilter; if ( this.startDate == null || this.endDate == null ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.EmptyStartDateOrEndDate" ) ); } if ( this.startDate.getTime().compareTo( this.endDate.getTime() ) >= 0 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.WrongDates" ) ); } long diffDays = ( this.endDate.getTime().getTime() - this.startDate.getTime().getTime() ) / ( 24 * 60 * 60 * 1000 ); if ( diffDays > 30 ) { throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.StartDateTooOlder" ) ); } } SalesforceConnection( LogChannelInterface logInterface, String url, String username, String password ); boolean isRollbackAllChangesOnError(); @Deprecated void rollbackAllChangesOnError( boolean value ); void setRollbackAllChangesOnError( boolean value ); boolean isQueryAll(); @Deprecated void queryAll( boolean value ); void setQueryAll( boolean value ); void setCalendar( int recordsFilter, GregorianCalendar startDate, GregorianCalendar endDate ); void setSQL( String sql ); void setFieldsList( String fieldsList ); void setModule( String module ); String getURL(); String getSQL(); Date getServerTimestamp(); String getModule(); QueryResult getQueryResult(); PartnerConnection createBinding( ConnectorConfig config ); PartnerConnection getBinding(); void setTimeOut( int timeout ); int getTimeOut(); boolean isUsingCompression(); void setUsingCompression( boolean useCompression ); String getUsername(); void setUsername( String value ); String getPassword(); void setPassword( String value ); void connect(); void query( boolean specifyQuery ); void close(); int getQueryResultSize(); int getRecordsCount(); SalesforceRecordValue getRecord( int recordIndex ); String getRecordValue( SObject con, String fieldname ); XmlObject[] getElements(); boolean queryMore(); String[] getAllAvailableObjects( boolean OnlyQueryableObjects ); Field[] getObjectFields( String objectName ); Field[] getObjectFields( String objectName, boolean excludeNonUpdatableFields ); String[] getFields( String objectName ); String[] getFields( String objectName, boolean excludeNonUpdatableFields ); String[] getFields( Field[] fields ); String[] getFields( Field[] fields, boolean excludeNonUpdatableFields ); UpsertResult[] upsert( String upsertField, SObject[] sfBuffer ); SaveResult[] insert( SObject[] sfBuffer ); SaveResult[] update( SObject[] sfBuffer ); DeleteResult[] delete( String[] id ); static XmlObject createMessageElement( String name, Object value, boolean useExternalKey ); static XmlObject fromTemplateElement( String name, Object value, boolean setValue ); static XmlObject[] getChildren( SObject object );  }