public static ConfigObjectRecord createNew ( final ChaiEntry entry , final String attr , final String recordType , final String guid1 , final String guid2 ) { //Ensure the entry is not null if ( entry == null ) { throw new NullPointerException ( "entry can not be null" ) ; } //Ensure the record type is not null if ( recordType == null ) { throw new NullPointerException ( "recordType can not be null" ) ; } //Make sure the attr is not null if ( attr == null ) { throw new NullPointerException ( "attr can not be null" ) ; } // truncate record type to 4 chars. final String effectiveRecordType = recordType . length ( ) > 4 ? recordType . substring ( 0 , 4 ) : recordType ; final ConfigObjectRecord cor = new ConfigObjectRecord ( ) ; cor . objectEntry = entry ; cor . attr = attr ; cor . recordType = effectiveRecordType ; cor . guid1 = ( guid1 == null || guid1 . length ( ) < 1 ) ? EMPTY_RECORD_VALUE : guid1 ; cor . guid2 = ( guid2 == null || guid2 . length ( ) < 1 ) ? EMPTY_RECORD_VALUE : guid2 ; return cor ; }
Create a new config object record . This will only create a java object representing the config object record . It is up to the caller to call the updatePayload method which will actually commit the record to the directory .