commonj.connector.metadata.build
Interface FunctionBuilder


public interface FunctionBuilder

Represents a builder of inbound or outbound FunctionDescriptions, for the specified connection.

Since:
1.1

Method Summary
 FunctionType[] getFunctionTypes()
          For the applied operation kind return the possible function signatures.
 PropertyGroup getOperationKinds()
          Returns a PropertyGroup showing possible operation kinds for the connection.
 String[] getRecordInterfaces()
          Returns interface that Record must implement to be consumed by adapter.
 void initialize(FunctionDescription functionDescription)
          If the function has already been built and the tool supports iterative development then this method can be called to initialize the FunctionBuilder for further editing.
 FunctionDescription postUpdateFunctionDescription(FunctionDescription description)
          After the user has finished working with the function this method is called to allow the adapter to make any final updates to the FunctionDescription.
 void setOperationKind(PropertyGroup operationKind)
          Apply the operationKind selected in the Property group returned from getOperationKinds().
 FunctionDescription updateFunctionDescription(FunctionDescription description)
          Based on the possible FunctionType, tooling creates the corresponding FunctionDescription.
 

Method Detail

initialize

void initialize(FunctionDescription functionDescription)
If the function has already been built and the tool supports iterative development then this method can be called to initialize the FunctionBuilder for further editing.

Parameters:
functionDescription - the build.tool.InboundFunctionDescription or build.tool.OutboundFunctionDescription to edit.

getOperationKinds

PropertyGroup getOperationKinds()
Returns a PropertyGroup showing possible operation kinds for the connection. An operation kind can affect the signature of a function. For example, a "create" operation may only have an input DataDescription. A "retrieve" or "update" operation may have an input and output DataDescription.

Returns:
A PropertyGroup containing operation kinds or null if no specific operation kind is supported.

setOperationKind

void setOperationKind(PropertyGroup operationKind)
Apply the operationKind selected in the Property group returned from getOperationKinds().

Parameters:
operationKind - applies the selected operation kind.

getFunctionTypes

FunctionType[] getFunctionTypes()
For the applied operation kind return the possible function signatures. If there are no restrictions then all defined FunctionTypes are returned.

Returns:
an array of the possible FunctionType.

updateFunctionDescription

FunctionDescription updateFunctionDescription(FunctionDescription description)
Based on the possible FunctionType, tooling creates the corresponding FunctionDescription. If the FunctionType specified is FunctionType.INPUT_ONLY then the FunctionDescription should only have an input DataDescription. If more than one FunctionType was specified then the tool should start with the minimum specified and allow the user to build any of the possibile FunctionTypes.

Parameters:
description - the minimum specified FunctionDescription.
Returns:
the FunctionDescription updated. For example, the InteractionSpec or a DataDescription may be updated based on the selected operationKind.

postUpdateFunctionDescription

FunctionDescription postUpdateFunctionDescription(FunctionDescription description)
After the user has finished working with the function this method is called to allow the adapter to make any final updates to the FunctionDescription.

Parameters:
description - the FunctionDescription updated from the user.
Returns:
the FunctionDescription updated. For example, the InteractionSpec or a DataDescription may be updated based on user input. User input must not be affected.

getRecordInterfaces

String[] getRecordInterfaces()
Returns interface that Record must implement to be consumed by adapter. For example, it may be javax.resource.cci.Streamable.

Returns:
Returns array of Strings, where each one lists the interface a possible input record must implement. Return null if no input record is supported. If there are no constraints then return an empty String.