Package org.apache.ambari.server.controller.ivory

Examples of org.apache.ambari.server.controller.ivory.Cluster$Interface


    Set<String>   requestedIds = getRequestPropertyIds(request, predicate);
    Set<Resource> resources    = new HashSet<Resource>();

    for (String clusterName : clusterNames ) {

      Cluster cluster = service.getCluster(clusterName);

      Resource resource = new ResourceImpl(Resource.Type.DRTargetCluster);
      setResourceProperty(resource, CLUSTER_NAME_PROPERTY_ID,
          cluster.getName(), requestedIds);
      setResourceProperty(resource, CLUSTER_COLO_PROPERTY_ID,
          cluster.getColo(), requestedIds);
      setResourceProperty(resource, CLUSTER_INTERFACES_PROPERTY_ID,
          cluster.getInterfaces(), requestedIds);
      setResourceProperty(resource, CLUSTER_LOCATIONS_PROPERTY_ID,
          cluster.getLocations(), requestedIds);
      setResourceProperty(resource, CLUSTER_PROPERTIES_PROPERTY_ID,
          cluster.getProperties(), requestedIds);

      if (predicate == null || predicate.evaluate(resource)) {
        resources.add(resource);
      }
    }
View Full Code Here


      if (category.equals(CLUSTER_PROPERTIES_PROPERTY_ID)) {
        properties.put(PropertyHelper.getPropertyName(property), (String) entry.getValue());
      }
    }

    return new Cluster(
        clusterName,
        (String) propertyMap.get(CLUSTER_COLO_PROPERTY_ID),
        getInterfaces((Set<Map<String, Object>>) propertyMap.get(CLUSTER_INTERFACES_PROPERTY_ID)),
        getLocations((Set<Map<String, Object>>) propertyMap.get(CLUSTER_LOCATIONS_PROPERTY_ID)),
        properties);
View Full Code Here

    targetClusterNames.add("Cluster3");

    Cluster.Interface interface1 = new Cluster.Interface("type", "endpoint", "version");
    Cluster.Location  location1  = new Cluster.Location("name", "path");

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));
    Cluster targetCluster2 = new Cluster("Cluster2", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));
    Cluster targetCluster3 = new Cluster("Cluster3", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

    targetClusterNames.add("Cluster1");

    Set<Cluster.Interface> interfaceSet = Collections.singleton(interface1);
    Set<Cluster.Location>  locationSet  = Collections.singleton(location1);

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", interfaceSet,
        locationSet, Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

    targetClusterNames.add("Cluster1");

    Cluster.Interface interface1 = new Cluster.Interface("type", "endpoint", "version");
    Cluster.Location  location1  = new Cluster.Location("name", "path");

    Cluster targetCluster1 = new Cluster("Cluster1", "Colo", Collections.singleton(interface1),
        Collections.singleton(location1), Collections.singletonMap("P1", "V1"));

    // set expectations
    expect(service.getClusterNames()).andReturn(targetClusterNames);
View Full Code Here

    }

    private static Binding<?> createWsdl2HttpBinding(Endpoint wsdlEndpoint) {
        Wsdl2HttpBindingImpl binding = new Wsdl2HttpBindingImpl();
        binding.setLocation(wsdlEndpoint.getAddress().toString());
        Interface wsdlInterface = wsdlEndpoint.getBinding().getInterface();
        InterfaceOperation[] wsdlOperations = wsdlInterface.getInterfaceOperations();
        for (int i = 0; i < wsdlOperations.length; i++) {
            // Retrieve binding and extension
            InterfaceOperation wsdlOperation = wsdlOperations[i];
            BindingOperation wsdlBindingOperation = findBindingOperation(wsdlEndpoint.getBinding(), wsdlOperation);
            HTTPBindingOperationExtensions opExt = wsdlBindingOperation != null ? (HTTPBindingOperationExtensions) wsdlBindingOperation.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) : null;
            // Create operation
            Wsdl2HttpOperationImpl operation = new Wsdl2HttpOperationImpl();
            // Standard WSDL2 attributes
            operation.setName(wsdlOperation.getName());
            operation.setMep(wsdlOperation.getMessageExchangePattern());
            operation.setStyle(new HashSet<URI>(Arrays.asList(wsdlOperation.getStyle())));
            // HTTP extensions
            if (opExt != null) {
                operation.setHttpInputSerialization(opExt.getHttpInputSerialization());
                operation.setHttpOutputSerialization(opExt.getHttpOutputSerialization());
                operation.setHttpFaultSerialization(opExt.getHttpFaultSerialization());
                operation.setHttpLocation(extractLocation(wsdlBindingOperation));
                operation.setHttpMethod(opExt.getHttpMethod());
                operation.setHttpTransferCodingDefault(opExt.getHttpTransferCodingDefault());
                operation.setHttpLocationIgnoreUncited(opExt.isHttpLocationIgnoreUncited());
            }
            // Messages
            InterfaceMessageReference[] iMsgRefs = wsdlOperation.getInterfaceMessageReferences();
            for (int j = 0; j < iMsgRefs.length; j++) {
                // Retrieve binding and extension
                InterfaceMessageReference iMsgRef = iMsgRefs[j];
                BindingMessageReference bMsgRef = findBindingMessage(wsdlBindingOperation, iMsgRef);
                HTTPBindingMessageReferenceExtensions msgExt = bMsgRef != null ? (HTTPBindingMessageReferenceExtensions) bMsgRef.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP) : null;
                // Create message
                Wsdl2HttpMessageImpl message = new Wsdl2HttpMessageImpl();
                // Standard WSDL2 attributes
                message.setContentModel(ContentModel.parse(iMsgRef.getMessageContentModel()));
                message.setElementName(iMsgRef.getElementDeclaration().getName());
                if (!XSD_2001_SYSTEM.equals(iMsgRef.getElementDeclaration().getSystem())) {
                    throw new IllegalStateException("Unsupported type system: " + iMsgRef.getElementDeclaration().getSystem());
                }
                if (Constants.API_APACHE_WS_XS.equals(iMsgRef.getElementDeclaration().getContentModel())) {
                    XmlSchemaElement xsEl = (XmlSchemaElement) iMsgRef.getElementDeclaration().getContent();
                    message.setElementDeclaration(xsEl);
                }
                // HTTP extensions
                if (msgExt != null) {
                    message.setHttpTransferCoding(msgExt.getHttpTransferCoding());
                    HTTPHeader[] headers = msgExt.getHttpHeaders();
                    for (int k = 0; k < headers.length; k++) {
                        Wsdl2HttpHeaderImpl h = new Wsdl2HttpHeaderImpl();
                        h.setName(headers[k].getName());
                        h.setRequired(headers[k].isRequired() ? headers[k].isRequired().booleanValue() : false);
                        if (!XSD_2001_SYSTEM.equals(headers[k].getTypeDefinition().getSystem())) {
                            throw new IllegalStateException("Unsupported type system: " + headers[k].getTypeDefinition().getSystem());
                        }
                        h.setType(headers[k].getTypeDefinition().getName());
                        message.addHttpHeader(h);
                    }
                }
                // Add the message
                if (iMsgRef.getDirection() == Direction.IN) {
                    operation.setInput(message);
                } else if (iMsgRef.getDirection() == Direction.OUT) {
                    operation.setOutput(message);
                } else {
                    throw new IllegalStateException("Unsupported message direction: " + iMsgRef.getDirection());
                }
            }
            // Faults
            InterfaceFaultReference[] faults = wsdlOperation.getInterfaceFaultReferences();
            for (int j = 0; j < faults.length; j++) {
                // TODO: handle interface faults references
            }
            // Add the operation
            binding.addOperation(operation);
        }
        // Faults
        InterfaceFault[] faults = wsdlInterface.getInterfaceFaults();
        for (int i = 0; i < faults.length; i++) {
            // TODO: handle interface faults
        }
        // Return the complete binding
        return binding;
View Full Code Here

        } else {
           wsdlService = services[0];
        }

        axisService.setName(wsdlService.getName().getLocalPart());
        Interface serviceInterface = wsdlService.getInterface();
        axisService.addParameter(new Parameter(WSDL2Constants.INTERFACE_LOCAL_NAME, serviceInterface.getName().getLocalPart()));
        processInterface(serviceInterface);
        if (isCodegen) {
            axisService.setOperationsNameList(operationNames);
        }
        processEndpoints(serviceInterface);
View Full Code Here

            operationNames.add(interfaceOperations[i].getName());
        }

        Interface[] extendedInterfaces = serviceInterface.getExtendedInterfaces();
        for (int i = 0; i < extendedInterfaces.length; i++) {
            Interface extendedInterface = extendedInterfaces[i];
            processInterface(extendedInterface);
        }

    }
View Full Code Here

     * @see org.apache.woden.wsdl20.InterfaceFaultReference#getInterfaceFault()
     */
    public InterfaceFault getInterfaceFault()
    {
        InterfaceOperation oper = (InterfaceOperation)getParent();
        Interface interfac = (Interface)oper.getParent();
        InterfaceFault intFault = interfac.getFromAllInterfaceFaults(fRef);
        return intFault;
    }
View Full Code Here

     * @see org.apache.woden.wsdl20.WSDLComponent#getFragmentIdentifier()
     */
    public FragmentIdentifier getFragmentIdentifier() {
        //Find parent components.
        InterfaceOperation interfaceOperationComp = (InterfaceOperation)getParent();
        Interface interfaceComp = (Interface)interfaceOperationComp.getParent();
        //Get needed properties.
        NCName interfaceName = new NCName(interfaceComp.getName().getLocalPart());
        NCName interfaceOperation = new NCName(interfaceOperationComp.getName().getLocalPart());
        //Return a new FragmentIdentifier.
        return new FragmentIdentifier(new InterfaceFaultReferencePart(interfaceName, interfaceOperation, fMessageLabel, fRef));
    }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.ivory.Cluster$Interface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.