Skip to content
Permalink
Browse files
NOJIRA whitespace and some minor refactoring of private methods in ju…
…ddi-client
  • Loading branch information
spyhunter99 committed Nov 25, 2018
1 parent c24d641 commit 78470bcf03bf65592bdcfd5e6e1b56c827236c19
Showing 3 changed files with 18 additions and 18 deletions.
@@ -510,77 +510,77 @@ public static BindingTemplate addSOAPtModels(BindingTemplate bt) {
bt.setTModelInstanceDetails(new TModelInstanceDetails());
}
TModelInstanceInfo tModelInstanceInfo;
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SOAP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SOAP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_SOAP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}

if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("http:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_HTTP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_HTTP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_HTTP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("jms:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_JMS)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_JMS)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_JMS);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("rmi:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_RMI)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_RMI)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_RMI);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("udp:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_UDP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_UDP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_UDP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("amqp:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_AMQP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_AMQP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_AMQP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("mailto:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_EMAIL)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_EMAIL)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_EMAIL);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("ftp:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_FTP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_FTP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_FTP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("https:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_SSLv3);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("ftps:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_SSLv3);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("jndi:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_JNDI_RMI)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_JNDI_RMI)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_JNDI_RMI);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
@@ -601,21 +601,21 @@ public static BindingTemplate addRESTtModels(BindingTemplate bt) {
bt.setTModelInstanceDetails(new TModelInstanceDetails());
}
TModelInstanceInfo tModelInstanceInfo;
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_REST)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_REST)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_REST);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}

if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("http:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_HTTP)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.TRANSPORT_HTTP)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_HTTP);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
}
}
if (bt.getAccessPoint() != null && bt.getAccessPoint().getValue().startsWith("https:")) {
if (!Exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
if (!exists(bt.getTModelInstanceDetails().getTModelInstanceInfo(), UDDIConstants.PROTOCOL_SSLv3)) {
tModelInstanceInfo = new TModelInstanceInfo();
tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_SSLv3);
bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
@@ -624,7 +624,7 @@ public static BindingTemplate addRESTtModels(BindingTemplate bt) {
return bt;
}

private static boolean Exists(List<TModelInstanceInfo> items, String key) {
private static boolean exists(List<TModelInstanceInfo> items, String key) {
for (int i = 0; i < items.size(); i++) {
if (items.get(i).getTModelKey() != null
&& items.get(i).getTModelKey().equalsIgnoreCase(key)) {
@@ -81,7 +81,7 @@ public UDDIInquiryPortType getUDDIInquiryService(String endpointURL) throws Tran
Map<String, Object> requestContext = ((BindingProvider) inquiryService).getRequestContext();
if (endpointURL != null) {

requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
}
setCredentials(requestContext);
} catch (Exception e) {
@@ -127,7 +127,7 @@ public UDDIPublicationPortType getUDDIPublishService(String endpointURL) throws
}
Map<String, Object> requestContext = ((BindingProvider) publishService).getRequestContext();
if (endpointURL != null)
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL);
setCredentials(requestContext);
} catch (Exception e) {
throw new TransportException(e.getMessage(), e);
@@ -41,7 +41,7 @@ public HelloWorld() {
// a UddiClient can be a client to multiple UDDI nodes, so
// supply the nodeName (defined in your uddi.xml.
// The transport can be WS, inVM, RMI etc which is defined in the uddi.xml
Transport transport = uddiClient.getTransport();
Transport transport = uddiClient.getTransport("default");
// Now you create a reference to the UDDI API
security = transport.getUDDISecurityService();
} catch (Exception e) {

0 comments on commit 78470bc

Please sign in to comment.