<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="newrelic-extension"
	elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:urn="newrelic-extension">

	<xs:element name="extension">
		<xs:annotation>
			<xs:documentation>
				An extension allows users to monitor specific
				methods without changing
				the code itself.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="urn:instrumentation" minOccurs="0"
					maxOccurs="1" />
			</xs:sequence>
			<xs:attribute name="name" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						This should be a descriptive name identifying
						this extension.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="enabled" type="xs:boolean" default="true">
				<xs:annotation>
					<xs:documentation>
						True means this extension will be used by the
						java agent to instrument
						the code on the next start up.
						False means
						this extension will be ignored by the java agent.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="version" type="xs:double" default="1.0">
				<xs:annotation>
					<xs:documentation>
						The version for this extension. It should be
						updated when the custom
						extension is updated. Only the latest
						version of each extension will be used by the agent.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>


	<xs:element name="instrumentation">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="urn:pointcut" minOccurs="0" maxOccurs="unbounded" />
			</xs:sequence>
			<xs:attribute name="metricPrefix" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						This is defaulted to CUSTOM if it is not set
						in the XML.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>

	<xs:element name="pointcut">
		<xs:annotation>
			<xs:documentation>
				A point cut matches a certain class and method
				signature combination.
				If a point cut is enabled and matches a class
				method signature, then
				that class method will be monitored by new
				relic.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="urn:className" minOccurs="1" maxOccurs="1" />
				<xs:element ref="urn:method" minOccurs="1" maxOccurs="unbounded" />
			</xs:sequence>

			<xs:attribute name="transactionStartPoint" type="xs:boolean"
				default="false">
				<xs:annotation>
					<xs:documentation>
						If a transaction is not already in progress when
						this
						point cut is reached, then a transaction will be started.
						If a
						transaction is already in progress, then that
						transaction will
						continue. A new transaction will not
						be created.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="metricNameFormat" type="xs:string">
				<xs:annotation>
					<xs:documentation>
						Name format to use for the metric. If not
						present, then the default is
						the class name with the metric name.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="excludeFromTransactionTrace" type="xs:boolean"
				default="false">
				<xs:annotation>
					<xs:documentation>
						When true the transaction trace will not be
						provided if this point cut initiates the transaction.
						If this point
						cut is reached in the middle of a transaction,
						then the transaction
						trace will still be present, but
						this method will be excluded from
						the call graph.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="ignoreTransaction" type="xs:boolean"
				default="false">
				<xs:annotation>
					<xs:documentation>
						When true the entire transaction will be ignored
						regardless
						of how much of the transaction has completed.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>

	<xs:element name="className" type="xs:string" nillable="false">
		<xs:annotation>
			<xs:documentation>
				This should be the name of the class to match. It
				should include the
				full package structure with dots between packages.
				This is case sensitive and so be sure to use the correct mixed case.
			</xs:documentation>
		</xs:annotation>
	</xs:element>

	<xs:element name="method">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="name" type="xs:string" minOccurs="1"
					maxOccurs="1" nillable="false">
					<xs:annotation>
						<xs:documentation>
							This should be the exact name of the method to
							match. This is case
							sensitive and so be sure to use the correct
							mixed case.
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element ref="urn:parameters" minOccurs="0" maxOccurs="1" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

	<xs:element name="parameters">
		<xs:annotation>
			<xs:documentation>
				Contains the list of method parameters. The
				parameters should be in order.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="type" type="xs:string" minOccurs="0"
					maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>
							Each parameter should put in a methodParameter
							tag. If the parameter
							is not a primitive,
							then it should include
							the full package structure of the object using
							dots between
							packages.
							This is case sensitive and so be sure to use the correct
							mixed case.
							It can be the parameter type as it
							appears in the
							signature. For example, a primitive int would be "int"
							and a java
							String would be "java.lang.String". If no parameterTypes
							are
							specified then it will be assumed that the method has
							0 input
							parameters.
						</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>

</xs:schema>