<xsd:schema targetNamespace="http://schemas.ggf.org/bes/2006/08/bes-factory" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:bes-factory="http://schemas.ggf.org/bes/2006/08/bes-factory" xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hpcbp-ac="http://schemas.ogf.org/hpcp/2007/11/ac" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="./soap.xsd" />
  <xsd:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="./ws-addr.xsd" />
  <xsd:import namespace="http://schemas.ggf.org/jsdl/2005/11/jsdl" schemaLocation="./jsdl.xsd" />
  
  <!-- Attribute Document Types -->
  <xsd:complexType name="BasicResourceAttributesDocumentType">
    <xsd:sequence>
      <xsd:element name="ResourceName" type="xsd:string" minOccurs="0" />
      <xsd:element name="OperatingSystem" type="jsdl:OperatingSystem_Type" minOccurs="0" />
      <xsd:element name="CPUArchitecture" type="jsdl:CPUArchitecture_Type" minOccurs="0" />
      <xsd:element name="CPUCount" type="xsd:double" minOccurs="0" />
      <xsd:element name="CPUSpeed" type="xsd:double" minOccurs="0" />
      <xsd:element name="PhysicalMemory" type="xsd:double" minOccurs="0" />
      <xsd:element name="VirtualMemory" type="xsd:double" minOccurs="0" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <xsd:complexType name="FactoryResourceAttributesDocumentType">
    <xsd:sequence>
      <xsd:element ref="bes-factory:BasicResourceAttributesDocument" minOccurs="0" />
      <xsd:element name="IsAcceptingNewActivities" type="xsd:boolean" />
      <xsd:element name="CommonName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="LongDescription" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="TotalNumberOfActivities" type="xsd:long" />
      <xsd:element name="ActivityReference" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="TotalNumberOfContainedResources" type="xsd:long" />
      <xsd:element name="ContainedResource" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="NamingProfile" type="xsd:anyURI" maxOccurs="unbounded" />
      <xsd:element name="BESExtension" type="xsd:anyURI" minOccurs="0" maxOccurs="unbounded" />
      <xsd:element name="LocalResourceManagerType" type="xsd:anyURI" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <!-- Message Helper Types -->
  <xsd:complexType name="ActivityDocumentType">
    <xsd:sequence>
      <xsd:element ref="jsdl:JobDefinition" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <xsd:simpleType name="ActivityStateEnumeration">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="Pending" />
      <xsd:enumeration value="Running" />
      <xsd:enumeration value="Cancelled" />
      <xsd:enumeration value="Failed" />
      <xsd:enumeration value="Finished" />
    </xsd:restriction>
  </xsd:simpleType>
  <xsd:complexType name="ActivityStatusType">
    <xsd:sequence>
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:attribute name="state" type="bes-factory:ActivityStateEnumeration" use="required" />
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <xsd:complexType name="GetActivityStatusResponseType">
    <xsd:sequence>
      <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" />
      <xsd:element ref="bes-factory:ActivityStatus" minOccurs="0" />
      <xsd:element name="Fault" type="soap:Fault" minOccurs="0" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <xsd:complexType name="GetActivityDocumentResponseType">
    <xsd:sequence>
      <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" />
      <xsd:element name="JobDefinition" type="jsdl:JobDefinition_Type" minOccurs="0" />
      <xsd:element name="Fault" type="soap:Fault" minOccurs="0" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <xsd:complexType name="TerminateActivityResponseType">
    <xsd:sequence>
      <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" />
      <xsd:element name="Terminated" type="xsd:boolean" />
      <xsd:element name="Fault" type="soap:Fault" minOccurs="0" />
      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    <xsd:anyAttribute namespace="##other" processContents="lax" />
  </xsd:complexType>
  <!-- Message Helper Elements -->
  <xsd:element name="BasicResourceAttributesDocument" type="bes-factory:BasicResourceAttributesDocumentType" />
  <xsd:element name="FactoryResourceAttributesDocument" type="bes-factory:FactoryResourceAttributesDocumentType" />
  <xsd:element name="ActivityDocument" type="bes-factory:ActivityDocumentType" />
  <xsd:element name="ActivityStatus" type="bes-factory:ActivityStatusType" />
</xsd:schema>