http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/schemas/schema.xsd ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/schemas/schema.xsd b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/schemas/schema.xsd new file mode 100644 index 0000000..31a5887 --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/schemas/schema.xsd @@ -0,0 +1,249 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="tenantInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="admin" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="firstname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="lastname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="adminPassword" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="tenantDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="email" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="active" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="userInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="userName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="credential" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="role" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="firstName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="lastName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="profileName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="partition"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="autoscalePolicy"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="loadThresholds" minOccurs="1" maxOccurs="1" nillable="false"> + <xs:complexType> + <xs:all> + <xs:element name="requestsInFlight" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="memoryConsumption" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="loadAverage" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="deploymentPolicy"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="partitionGroup"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="partitionAlgo" minOccurs="1" maxOccurs="1" nillable="false"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="round-robin"/> + <xs:enumeration value="one-after-another"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="partition" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="partitionMax" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="partitionMin" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="cartridgeDefinitionBean"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="displayName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="defaultAutoscalingPolicy" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="multiTenant" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="portMapping" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="protocol" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="port" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="proxyPort" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + <xs:element name="iaasProvider" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="imageId" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="maxInstanceLimit" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + <xs:element name="networkInterfaces" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="networkUuid" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="loadBalancer" minOccurs="0" maxOccurs="1" nillable="true"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="persistence" minOccurs="0" maxOccurs="1" nillable="true"> + <xs:complexType> + <xs:sequence> + <xs:element name="isRequired" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="volume" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="device" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="mappingPath" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="size" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="cartridgeInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="repoURL" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="privateRepo" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="repoUsername" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="repoPassword" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="commitsEnabled" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalePolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="persistanceRequired" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="size" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + + <xs:element name="serviceDefinitionBean"> + <xs:complexType> + <xs:all> + <xs:element name="serviceName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalingPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="clusterDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="clusterSubDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="tenantRange" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="subscriptionDomainRequest"> + <xs:complexType> + <xs:sequence> + <xs:element name="domains" type="subscriptionDomain" minOccurs="1" maxOccurs="unbounded" nillable="false"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="subscriptionDomain"> + <xs:all> + <xs:element name="domainName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="applicationContext" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + </xs:all> + </xs:complexType> + + <xs:complexType name="thresholdValues"> + <xs:all> + <xs:element name="upperLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> + <xs:element name="lowerLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> + </xs:all> + </xs:complexType> +</xs:schema>
http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/web.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/web.xml new file mode 100644 index 0000000..7cef351 --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api-test/WEB-INF/web.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + --> + +<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee + http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + + <display-name>S2 Admin Endpoint</display-name> + + <servlet> + <servlet-name>StratosAdminEndpoint</servlet-name> + <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>StratosAdminEndpoint</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> + +</web-app> + http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/META-INF/webapp-classloading.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/META-INF/webapp-classloading.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/META-INF/webapp-classloading.xml new file mode 100644 index 0000000..c62912d --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/META-INF/webapp-classloading.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + --> + +<!-- + This file defines class loading policy of the whole container. But this behaviour can be overridden by individual webapps by putting this file into the META-INF/ directory. +--> +<Classloading xmlns="http://wso2.org/projects/as/classloading"> + + <!-- Parent-first or child-first. Default behaviour is child-first.--> + <ParentFirst>false</ParentFirst> + + <!-- + Default environments that contains provides to all the webapps. This can be overridden by individual webapps by specifing required environments + Tomcat environment is the default and every webapps gets it even if they didn't specify it. + e.g. If a webapps requires CXF, they will get both Tomcat and CXF. + --> + <Environments>CXF,Carbon</Environments> +</Classloading> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml new file mode 100644 index 0000000..df83e3b --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/cxf-servlet.xml @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + --> + +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:jaxrs="http://cxf.apache.org/jaxrs" + xmlns:util="http://www.springframework.org/schema/util" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd + http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> + + <jaxrs:server id="stratosApi" address="/"> + <jaxrs:serviceBeans> + <ref bean="stratosApiBeanV41"/> + </jaxrs:serviceBeans> + + <jaxrs:providers> + <ref bean="throwableExceptionHandler"/> + <ref bean="genericExceptionHandler"/> + <ref bean="badRequestExceptionHandler"/> + <ref bean="jsonProvider"/> + <ref bean="exceptionHandler"/> + <ref bean="basicAuthenticationFilter"/> + <ref bean="sessionAuthenticationFilter"/> + <ref bean="authorizationFilterV41"/> + </jaxrs:providers> + </jaxrs:server> + + <jaxrs:server id="stratosApiV40" address="/v4.0"> + <jaxrs:serviceBeans> + <ref bean="stratosApiBeanV40"/> + </jaxrs:serviceBeans> + + <jaxrs:providers> + <ref bean="throwableExceptionHandler"/> + <ref bean="genericExceptionHandler"/> + <ref bean="badRequestExceptionHandler"/> + <ref bean="jsonProvider"/> + <ref bean="exceptionHandler"/> + <ref bean="basicAuthenticationFilter"/> + <ref bean="sessionAuthenticationFilter"/> + <ref bean="authorizationFilterV40"/> + </jaxrs:providers> + </jaxrs:server> + + <jaxrs:server id="stratosApiV41" address="/v4.1"> + <jaxrs:serviceBeans> + <ref bean="stratosApiBeanV41"/> + </jaxrs:serviceBeans> + + <jaxrs:providers> + <ref bean="throwableExceptionHandler"/> + <ref bean="genericExceptionHandler"/> + <ref bean="badRequestExceptionHandler"/> + <ref bean="jsonProvider"/> + <ref bean="exceptionHandler"/> + <ref bean="basicAuthenticationFilter"/> + <ref bean="sessionAuthenticationFilter"/> + <ref bean="authorizationFilterV41"/> + </jaxrs:providers> + </jaxrs:server> + + <bean id="stratosApiBeanV40" class="org.apache.stratos.rest.endpoint.api.StratosApiV40"/> + <bean id="stratosApiBeanV41" class="org.apache.stratos.rest.endpoint.api.StratosApiV41"/> + <bean id="basicAuthenticationFilter" class="org.apache.stratos.rest.endpoint.handlers.StratosAuthenticationHandler"/> + <bean id="sessionAuthenticationFilter" class="org.apache.stratos.rest.endpoint.handlers.CookieBasedAuthenticationHandler"/> + <bean id="authorizationFilterV40" class="org.apache.stratos.rest.endpoint.handlers.StratosAuthorizingHandler"> + <property name="securedObject" ref="stratosApiBeanV40"/> + </bean> + <bean id="authorizationFilterV41" class="org.apache.stratos.rest.endpoint.handlers.StratosAuthorizingHandler"> + <property name="securedObject" ref="stratosApiBeanV41"/> + </bean> + <bean id="exceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomExceptionMapper"/> + <bean id="badRequestExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.BadRequestExceptionMapper"/> + <bean id="genericExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.GenericExceptionMapper"/> + <bean id="throwableExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomThrowableExceptionMapper"/> + <!--The below config enables OAuth based authentication/authorization for REST API--> + <bean id="OAuthFilter" class="org.apache.stratos.rest.endpoint.handlers.OAuthHandler"> + <property name="password" value="admin"/> + <property name="username" value="admin"/> + <property name="oauthValidationEndpoint" value="https://localhost:9443/services/"/> + </bean> + <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> + <!-- property name="schemaHandler" ref="schemaHolder"/--> + <property name="supportUnwrapped" value="true"/> + <property name="serializeAsArray" value="true"/> + <property name="arrayKeys"> + <list> + <value>partitions</value> + <value>property</value> + <value>hostNames</value> + <value>memberMap</value> + <value>portMap</value> + <value>partitionGroup</value> + <value>partition</value> + <value>member</value> + <value>hostNames</value> + <value>portMappings</value> + <value>volumes</value> + <value>domains</value> + <value>kubernetesHost</value> + </list> + </property> + </bean> + + <bean id="schemaHolder" class="org.apache.cxf.jaxrs.utils.schemas.SchemaHandler"> + <property name="schemas" ref="theSchemas"/> + </bean> + + <util:list id="theSchemas"> + <value>classpath:/WEB-INF/schemas/schema.xsd</value> + </util:list> + +</beans> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/schemas/schema.xsd ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/schemas/schema.xsd b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/schemas/schema.xsd new file mode 100644 index 0000000..ddae5c1 --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/schemas/schema.xsd @@ -0,0 +1,333 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:element name="tenantInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="admin" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="firstname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="lastname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="adminPassword" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="tenantDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="email" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="active" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="userInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="userName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="credential" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="role" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="firstName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="lastName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="profileName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="partition"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="autoscalePolicy"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="loadThresholds" minOccurs="1" maxOccurs="1" nillable="false"> + <xs:complexType> + <xs:all> + <xs:element name="requestsInFlight" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="memoryConsumption" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="loadAverage" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="deploymentPolicy"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="partitionGroup"> + <xs:complexType> + <xs:sequence> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="partitionAlgo" minOccurs="1" maxOccurs="1" nillable="false"> + <xs:simpleType> + <xs:restriction base="xs:string"> + <xs:enumeration value="round-robin"/> + <xs:enumeration value="one-after-another"/> + </xs:restriction> + </xs:simpleType> + </xs:element> + <xs:element name="partition" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + <xs:element name="partitionMax" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="partitionMin" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="cartridgeDefinitionBean"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="displayName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="defaultAutoscalingPolicy" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="multiTenant" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deployerType" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="portMapping" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="protocol" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> + <xs:element name="port" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="proxyPort" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + <xs:element name="iaasProvider" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="imageId" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="maxInstanceLimit" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + <xs:element name="networkInterfaces" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="networkUuid" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="container" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:sequence> + <xs:element name="imageName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="dockerfileRepo" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="loadBalancer" minOccurs="0" maxOccurs="1" nillable="true"> + <xs:complexType> + <xs:sequence> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="persistence" minOccurs="0" maxOccurs="1" nillable="true"> + <xs:complexType> + <xs:sequence> + <xs:element name="isRequired" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="volume" minOccurs="1" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="device" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="mappingPath" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="size" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> + <xs:complexType> + <xs:all> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="cartridgeInfoBean"> + <xs:complexType> + <xs:all> + <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="repoURL" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="privateRepo" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="repoUsername" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="repoPassword" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="commitsEnabled" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalePolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="persistanceRequired" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="size" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + + <xs:element name="serviceDefinitionBean"> + <xs:complexType> + <xs:all> + <xs:element name="serviceName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> + <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalingPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="clusterDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="clusterSubDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="tenantRange" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + </xs:element> + + <xs:element name="serviceGroup"> + <xs:complexType> + <xs:sequence> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="subGroups" type="xs:string" minOccurs="0" maxOccurs="unbounded" nillable="false"/> + <xs:element name="cartridges" type="xs:string" minOccurs="1" maxOccurs="unbounded" nillable="false"/> + <xs:element name="dependencies" type="tdependencies" minOccurs="0" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:element name="compositeAppDefinition"> + <xs:complexType> + <xs:sequence> + <xs:element name="applicationId" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="components" minOccurs="0" maxOccurs="1"> + <xs:complexType> + <xs:sequence> + <xs:element name="groups" type="tgroups" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="subscribables" type="tsubscribables" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="dependencies" type="tdependencies" minOccurs="0" maxOccurs="1"/> + </xs:sequence> + </xs:complexType> + </xs:element> + <xs:element name="subscribableInfo" type="tsubscribableInfo" minOccurs="0" maxOccurs="unbounded" nillable="false"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="tsubscribableInfo"> + <xs:all> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalingPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="repoURL" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="privateRepo" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="repoUsername" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="repoPassword" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + + <xs:complexType name="tdependencies"> + <xs:sequence> + <xs:element name="terminationBehaviour" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="startupOrders" type="xs:string" minOccurs="0" maxOccurs="unbounded" nillable="false"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="tgroups"> + <xs:sequence> + <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="deploymentPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="autoscalingPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="subscribables" type="tsubscribables" minOccurs="0" maxOccurs="unbounded"/> + <xs:element name="subGroups" type="tgroups" minOccurs="0" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="tsubscribables"> + <xs:all> + <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + </xs:all> + </xs:complexType> + + <xs:element name="subscriptionDomainRequest"> + <xs:complexType> + <xs:sequence> + <xs:element name="domains" type="subscriptionDomain" minOccurs="1" maxOccurs="unbounded" nillable="false"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + <xs:complexType name="subscriptionDomain"> + <xs:all> + <xs:element name="domainName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> + <xs:element name="applicationContext" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> + </xs:all> + </xs:complexType> + + <xs:complexType name="thresholdValues"> + <xs:all> + <xs:element name="upperLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> + <xs:element name="lowerLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> + </xs:all> + </xs:complexType> +</xs:schema> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/web.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/web.xml new file mode 100644 index 0000000..56ee1a4 --- /dev/null +++ b/components/org.apache.stratos.rest.endpoint/src/main/webapp/api/WEB-INF/web.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. + --> + +<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee + http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> + + <display-name>Stratos REST API</display-name> + + <servlet> + <servlet-name>StratosRestApi</servlet-name> + <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>StratosRestApi</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> +</web-app> + http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/META-INF/webapp-classloading.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/META-INF/webapp-classloading.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/META-INF/webapp-classloading.xml deleted file mode 100644 index c62912d..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/META-INF/webapp-classloading.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> - -<!-- - This file defines class loading policy of the whole container. But this behaviour can be overridden by individual webapps by putting this file into the META-INF/ directory. ---> -<Classloading xmlns="http://wso2.org/projects/as/classloading"> - - <!-- Parent-first or child-first. Default behaviour is child-first.--> - <ParentFirst>false</ParentFirst> - - <!-- - Default environments that contains provides to all the webapps. This can be overridden by individual webapps by specifing required environments - Tomcat environment is the default and every webapps gets it even if they didn't specify it. - e.g. If a webapps requires CXF, they will get both Tomcat and CXF. - --> - <Environments>CXF,Carbon</Environments> -</Classloading> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml deleted file mode 100644 index 7f326ab..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/cxf-servlet.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:jaxrs="http://cxf.apache.org/jaxrs" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd - http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> - - <jaxrs:server id="stratosAdmin" address="/"> - <jaxrs:serviceBeans> - <ref bean="stratosRestEndpointTestBean"/> - </jaxrs:serviceBeans> - - <jaxrs:providers> - <ref bean="throwableExceptionHandler"/> - <ref bean="genericExceptionHandler"/> - <ref bean="badRequestExceptionHandler"/> - <ref bean="jsonProvider"/> - <ref bean="throwableExceptionHandler"/> - <ref bean="basicAuthenticationFilter"/> - <bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> - <property name="dropRootElement" value="true"/> - <property name="supportUnwrapped" value="true"/> - </bean>> - <ref bean="exceptionHandler"/> - </jaxrs:providers> - </jaxrs:server> - - <bean id="stratosRestEndpointTestBean" class="org.apache.stratos.rest.endpoint.mock.StratosTestAdmin"/> - <bean id="basicAuthenticationFilter" class="org.apache.stratos.rest.endpoint.handlers.StratosMockHandler"/> - <bean id="exceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomExceptionMapper"/> - <bean id="badRequestExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.BadRequestExceptionMapper"/> - <bean id="genericExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.GenericExceptionMapper"/> - <bean id="throwableExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomThrowableExceptionMapper"/> - <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> - <property name="schemaHandler" ref="schemaHolder"/> - <property name="supportUnwrapped" value="true"/> - <property name="serializeAsArray" value="true"/> - <property name="arrayKeys"> - <list> - <value>partitions</value> - <value>property</value> - <value>hostNames</value> - <value>memberMap</value> - <value>portMap</value> - <value>partitionGroup</value> - <value>partition</value> - <value>member</value> - <value>hostNames</value> - <value>portMappings</value> - <value>volumes</value> - </list> - </property> - </bean> - - <bean id="schemaHolder" class="org.apache.cxf.jaxrs.utils.schemas.SchemaHandler"> - <property name="schemas" ref="theSchemas"/> - </bean> - - <util:list id="theSchemas"> - <value>classpath:/WEB-INF/schemas/schema.xsd</value> - </util:list> -</beans> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/schemas/schema.xsd ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/schemas/schema.xsd b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/schemas/schema.xsd deleted file mode 100644 index 31a5887..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/schemas/schema.xsd +++ /dev/null @@ -1,249 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> - <xs:element name="tenantInfoBean"> - <xs:complexType> - <xs:all> - <xs:element name="admin" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="firstname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="lastname" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="adminPassword" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="tenantDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="email" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="active" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - - <xs:element name="userInfoBean"> - <xs:complexType> - <xs:all> - <xs:element name="userName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="credential" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="role" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="firstName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="lastName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="email" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="profileName" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - - <xs:element name="partition"> - <xs:complexType> - <xs:sequence> - <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> - <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:element name="autoscalePolicy"> - <xs:complexType> - <xs:sequence> - <xs:element name="id" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> - <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="loadThresholds" minOccurs="1" maxOccurs="1" nillable="false"> - <xs:complexType> - <xs:all> - <xs:element name="requestsInFlight" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="memoryConsumption" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="loadAverage" type="thresholdValues" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:element name="deploymentPolicy"> - <xs:complexType> - <xs:sequence> - <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> - <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> - <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="partitionGroup"> - <xs:complexType> - <xs:sequence> - <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> - <xs:element name="partitionAlgo" minOccurs="1" maxOccurs="1" nillable="false"> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="round-robin"/> - <xs:enumeration value="one-after-another"/> - </xs:restriction> - </xs:simpleType> - </xs:element> - <xs:element name="partition" minOccurs="1" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="id" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> - <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> - <xs:element name="partitionMax" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="partitionMin" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:element name="cartridgeDefinitionBean"> - <xs:complexType> - <xs:sequence> - <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="provider" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="host" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="displayName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="version" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="defaultAutoscalingPolicy" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="multiTenant" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="portMapping" minOccurs="1" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="protocol" type="xs:string" maxOccurs="1" minOccurs="1" nillable="false"/> - <xs:element name="port" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="proxyPort" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - <xs:element name="iaasProvider" minOccurs="0" maxOccurs="unbounded"> - <xs:complexType> - <xs:sequence> - <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="imageId" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="maxInstanceLimit" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - <xs:element name="networkInterfaces" minOccurs="0" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="networkUuid" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="loadBalancer" minOccurs="0" maxOccurs="1" nillable="true"> - <xs:complexType> - <xs:sequence> - <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="property" minOccurs="1" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="persistence" minOccurs="0" maxOccurs="1" nillable="true"> - <xs:complexType> - <xs:sequence> - <xs:element name="isRequired" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="volume" minOccurs="1" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="device" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="mappingPath" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="size" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - <xs:element name="property" minOccurs="0" maxOccurs="unbounded"> - <xs:complexType> - <xs:all> - <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:element name="cartridgeInfoBean"> - <xs:complexType> - <xs:all> - <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="alias" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="repoURL" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="privateRepo" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="repoUsername" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="repoPassword" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="commitsEnabled" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="autoscalePolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="deploymentPolicy" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="persistanceRequired" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="size" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="removeOnTermination" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - - - <xs:element name="serviceDefinitionBean"> - <xs:complexType> - <xs:all> - <xs:element name="serviceName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="isPublic" type="xs:boolean" minOccurs="0" maxOccurs="1" nillable="false"/> - <xs:element name="cartridgeType" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="deploymentPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="autoscalingPolicyName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="clusterDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="clusterSubDomain" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="tenantRange" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - </xs:all> - </xs:complexType> - </xs:element> - - <xs:element name="subscriptionDomainRequest"> - <xs:complexType> - <xs:sequence> - <xs:element name="domains" type="subscriptionDomain" minOccurs="1" maxOccurs="unbounded" nillable="false"/> - </xs:sequence> - </xs:complexType> - </xs:element> - - <xs:complexType name="subscriptionDomain"> - <xs:all> - <xs:element name="domainName" type="xs:string" minOccurs="1" maxOccurs="1" nillable="false"/> - <xs:element name="applicationContext" type="xs:string" minOccurs="0" maxOccurs="1" nillable="true"/> - </xs:all> - </xs:complexType> - - <xs:complexType name="thresholdValues"> - <xs:all> - <xs:element name="upperLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> - <xs:element name="lowerLimit" type="xs:float" minOccurs="1" maxOccurs="1"/> - </xs:all> - </xs:complexType> -</xs:schema> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/web.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/web.xml deleted file mode 100644 index 7cef351..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos-test/WEB-INF/web.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> - -<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee - http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> - - <display-name>S2 Admin Endpoint</display-name> - - <servlet> - <servlet-name>StratosAdminEndpoint</servlet-name> - <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>StratosAdminEndpoint</servlet-name> - <url-pattern>/*</url-pattern> - </servlet-mapping> - -</web-app> - http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/META-INF/webapp-classloading.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/META-INF/webapp-classloading.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/META-INF/webapp-classloading.xml deleted file mode 100644 index c62912d..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/META-INF/webapp-classloading.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> - -<!-- - This file defines class loading policy of the whole container. But this behaviour can be overridden by individual webapps by putting this file into the META-INF/ directory. ---> -<Classloading xmlns="http://wso2.org/projects/as/classloading"> - - <!-- Parent-first or child-first. Default behaviour is child-first.--> - <ParentFirst>false</ParentFirst> - - <!-- - Default environments that contains provides to all the webapps. This can be overridden by individual webapps by specifing required environments - Tomcat environment is the default and every webapps gets it even if they didn't specify it. - e.g. If a webapps requires CXF, they will get both Tomcat and CXF. - --> - <Environments>CXF,Carbon</Environments> -</Classloading> http://git-wip-us.apache.org/repos/asf/stratos/blob/d1bddc40/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/WEB-INF/cxf-servlet.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/WEB-INF/cxf-servlet.xml b/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/WEB-INF/cxf-servlet.xml deleted file mode 100644 index 1d5bc80..0000000 --- a/components/org.apache.stratos.rest.endpoint/src/main/webapp/stratos/WEB-INF/cxf-servlet.xml +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> - -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:jaxrs="http://cxf.apache.org/jaxrs" - xmlns:util="http://www.springframework.org/schema/util" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd - http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> - - <jaxrs:server id="stratosAdmin" address="/"> - <jaxrs:serviceBeans> - <ref bean="stratosRestEndpointBean"/> - </jaxrs:serviceBeans> - - <jaxrs:providers> - <ref bean="throwableExceptionHandler"/> - <ref bean="genericExceptionHandler"/> - <ref bean="badRequestExceptionHandler"/> - <ref bean="jsonProvider"/> - <ref bean="exceptionHandler"/> - <ref bean="basicAuthenticationFilter"/> - <ref bean="sessionAuthenticationFilter"/> - <ref bean="authorizationFilter"/> - </jaxrs:providers> - </jaxrs:server> - - <bean id="stratosRestEndpointBean" class="org.apache.stratos.rest.endpoint.services.StratosAdmin"/> - <bean id="basicAuthenticationFilter" class="org.apache.stratos.rest.endpoint.handlers.StratosAuthenticationHandler"/> - <bean id="sessionAuthenticationFilter" class="org.apache.stratos.rest.endpoint.handlers.CookieBasedAuthenticationHandler"/> - <bean id="authorizationFilter" class="org.apache.stratos.rest.endpoint.handlers.StratosAuthorizingHandler"> - <property name="securedObject" ref="stratosRestEndpointBean"/> - </bean> - <bean id="exceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomExceptionMapper"/> - <bean id="badRequestExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.BadRequestExceptionMapper"/> - <bean id="genericExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.GenericExceptionMapper"/> - <bean id="throwableExceptionHandler" class="org.apache.stratos.rest.endpoint.handlers.CustomThrowableExceptionMapper"/> - <!--The below config enables OAuth based authentication/authorization for REST API--> - <bean id="OAuthFilter" class="org.apache.stratos.rest.endpoint.handlers.OAuthHandler"> - <property name="password" value="admin"/> - <property name="username" value="admin"/> - <property name="oauthValidationEndpoint" value="https://localhost:9443/services/"/> - </bean> - <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider"> - <!-- property name="schemaHandler" ref="schemaHolder"/--> - <property name="supportUnwrapped" value="true"/> - <property name="serializeAsArray" value="true"/> - <property name="arrayKeys"> - <list> - <value>partitions</value> - <value>property</value> - <value>hostNames</value> - <value>memberMap</value> - <value>portMap</value> - <value>partitionGroup</value> - <value>partition</value> - <value>member</value> - <value>hostNames</value> - <value>portMappings</value> - <value>volumes</value> - <value>domains</value> - <value>kubernetesHost</value> - </list> - </property> - </bean> - - <bean id="schemaHolder" class="org.apache.cxf.jaxrs.utils.schemas.SchemaHandler"> - <property name="schemas" ref="theSchemas"/> - </bean> - - <util:list id="theSchemas"> - <value>classpath:/WEB-INF/schemas/schema.xsd</value> - </util:list> - -</beans>
