001: package com.bostechcorp.cbesb.common.util.custcomponent;
002:
003: import java.util.Properties;
004:
005: /**
006: * The interface class that the Custom Component must implment to be used in Flow Editor.
007: *
008: * If useDefaultDeploy is true:
009: *
010: * Users can implement SetComponentURI to supply component URI.
011: *
012: * if useDefaultWSDLGenerator=false,
013: *
014: * Users can implement SetComponentProperies to selectively decide which properties
015: * go to the WSDL config tag.
016: * And also implement genDeploymentArtificats to generate the additional optional config files.
017: *
018: *
019: * If useDefaultDeploy is false:
020: *
021: * Users can implement getServiceName to set ServiceName for specified role.
022: * And also implement getEndpointName to set endpoint name for specified role.
023: *
024: * Users can implement genDeploymentArtificats to generate the deployment
025: * artifacts required for the custom component
026: *
027: *
028: * @author elu
029: *
030: */
031: public interface ICustComponent {
032:
033: /**
034: * The JBI role for a component.
035: *
036: * @author elu
037: *
038: */
039: public enum Role {
040: CONSUMER, PROVIDER, BOTH
041: }
042:
043: /**
044: * The Default Message Exchange Pattern (MEP) for a component endpoint.
045: * @author elu
046: *
047: */
048: public enum DefaultMEP {
049: IN_ONLY, IN_OUT, RELIABLE_IN
050: }
051:
052: /**
053: *
054: * @return the name the custom component
055: */
056: public String getName();
057:
058: /**
059: * such as "ChainBuilderESB-BC-Email"
060: * @return
061: */
062: public String getComponentName();
063:
064: /**
065: *
066: * @return the description of the custom component
067: */
068: public String getDescription();
069:
070: /**
071: *
072: * @return the vendor who produces this custom component
073: */
074: public String getVendor();
075:
076: /**
077: *
078: * @return the version of the custom component
079: */
080: public String getVersion();
081:
082: /**
083: * This one is used in the Custom Component wizard to display a list of custom component.
084: * @return the resource location of the small icon for custom component.
085: */
086: public String getSmallIconResourceLocation();
087:
088: /**
089: * This one is used in the canvas when a custom component is dragged
090: * @return the resource location of the big icon for custom component
091: */
092: public String getBigIconResourceLocation();
093:
094: /**
095: *
096: * @return the role of custom component
097: */
098: public Role getRole();
099:
100: /**
101: *
102: * @return whether the Use CCSL is supported
103: */
104: public boolean getUseCCSL();
105:
106: /**
107: *
108: * @param role
109: * @return the DefaultMEP for the role
110: */
111: public DefaultMEP getDefaultMep(Role role);
112:
113: /**
114: *
115: * @return the all IWizardPage objects for specified role
116: */
117: public IWizardPage[] getWizardPages(Role role);
118:
119: /**
120: * It returns true for ChainBuilder ESB style custom component.
121: * @return whether the default deployment descriptor is used
122: */
123: public boolean useDefaultDeployment();
124:
125: /**
126: * If return true, the generated WSDL files will be followed ChainBuilder ESB deployment descriptor design pattern.
127: *
128: * @return whether to use the default WSDL generator in ChainBuilder ESB
129: */
130: public boolean useDefaultWSDLGenerator();
131:
132: /**
133: *
134: * When useDefaultDeploy() return true, users can implement this method to supply component URI.
135: * revision required on the utility of this method.
136: * the namespace cretaion is:
137: * vendorNameSpace+"/wsdl/"+componentType+"/"version
138: * default vendorNamespace="http://cbesb.bostechcorp.com"
139: * @param uri - the component URI, e.g, "http://cbesb.bostechcorp.com/wsdl/email/1.0"
140: */
141: //TODO : revision required on the utility of this method.
142: // the namespace cretaion is vendorNamespace+"/wsdl/"+componentType+"/"version
143: public String getComponentURI();
144:
145: /**
146: * When seDefaultDeploy() return true and useDefaultWSDLGenerator() return false,
147: * users can implement this component to selectively decide which properties
148: * go to the WSDL config tag.
149: *
150: * @param properties - a Properties object to be serialized into the WSDL config tag.
151: */
152: public void setComponentProperties(Properties properties);
153:
154: /**
155: *
156: * if useDefaultDeploy=true and useDefaultWSDLGenerator=false,
157: *
158: * Users can implement genDeploymentArtificats to generate the additional optional config files.
159: *
160: *
161: * If useDefaultDeploy is false:
162: *
163: * Users can implement genDeploymentArtificats to generate the deployment
164: * artifacts required for the custom component
165: */
166: public void genDeploymentArtifacts(IServiceUnitContext context);
167:
168: /**
169: * This API is used when useDefaultDeployment() return false
170: * @param role
171: * @return the ServiceName for specified role
172: */
173: public String getServiceName(Role role, IServiceUnitContext context);
174:
175: /**
176: * This API is used when useDefaultDeployment() return false
177: * @param role
178: * @return the EndpointName for specified role
179: */
180: public String getEndpointName(Role role, IServiceUnitContext context);
181:
182: /**
183: * get a property def by property' name and role
184: * @param propertyName
185: * @param role
186: * @return
187: */
188: public IProperty getPropertyByName(String propertyName, Role role);
189:
190: /**
191: * @return if the consumer should support schedule function
192: */
193: public boolean isConsumerScheduleable();
194: }
|