/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
@Test public void testCreateIndexedRecord() throws ResourceException { ConnectionFactory connectionFactory = mock(ConnectionFactory.class); RecordFactory recordFactory = mock(RecordFactory.class); IndexedRecord indexedRecord = mock(IndexedRecord.class); given(connectionFactory.getRecordFactory()).willReturn(recordFactory); given(recordFactory.createIndexedRecord("name")).willReturn(indexedRecord); CciTemplate ct = new CciTemplate(connectionFactory); ct.createIndexedRecord("name"); verify(recordFactory).createIndexedRecord("name"); }
/** * Allow the platform to handle the creation of the DOM record. * Creates an indexed record (mapped records are not supported). */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createIndexedRecord(recordName); } catch (ResourceException exception) { throw EISException.createException(exception); } }
/** * Allow the platform to handle the creation of the DOM record. * Creates an indexed record (mapped records are not supported). */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createIndexedRecord(recordName); } catch (ResourceException exception) { throw EISException.createException(exception); } }
private void createIndexedRecord(String name) throws Exception { mockFactory.getMockConnectionFactory().getRecordFactory().createIndexedRecord(name); }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
@Override public Message handle(Exchange exchange, Connection conn, Interaction interact) throws Exception { IndexedRecord record = getRecordFactory().createIndexedRecord(IndexedRecordHandler.class.getName()); IndexedRecord outRecord = (IndexedRecord) interact.execute(getInteractionSpec(), getMessageComposer(IndexedRecordBindingData.class).decompose(exchange, new IndexedRecordBindingData(record)).getRecord()); return _composer.compose(new IndexedRecordBindingData(outRecord), exchange); } }
spec.setCatalog(null); RecordFactory recordFactory = connectionFactory.getRecordFactory(); IndexedRecord inputRecord = recordFactory.createIndexedRecord("Input");