You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by su...@apache.org on 2015/02/12 17:22:05 UTC
[23/41] knox git commit: KNOX-483 initial commit for loading service
definitions
KNOX-483 initial commit for loading service definitions
Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/21d9a17e
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/21d9a17e
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/21d9a17e
Branch: refs/heads/KNOX-481
Commit: 21d9a17e80cb22c0868062b8846f2b723e4bfc3f
Parents: ef2439b
Author: Sumit Gupta <su...@apache.org>
Authored: Tue Jan 6 12:07:29 2015 -0500
Committer: Sumit Gupta <su...@apache.org>
Committed: Wed Feb 11 15:38:09 2015 -0500
----------------------------------------------------------------------
.../gateway/config/impl/GatewayConfigImpl.java | 5 ++
.../service/definition/PolicyBinding.java | 21 +++++++++
.../service/definition/RewriteFilter.java | 47 +++++++++++++++++++
.../gateway/service/definition/UrlBinding.java | 49 ++++++++++++++++++++
4 files changed, 122 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/knox/blob/21d9a17e/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
index 4241856..cfbec54 100644
--- a/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
+++ b/gateway-server/src/main/java/org/apache/hadoop/gateway/config/impl/GatewayConfigImpl.java
@@ -174,6 +174,11 @@ public class GatewayConfigImpl extends Configuration implements GatewayConfig {
}
@Override
+ public String getGatewayStacksDir() {
+ return getVar( GATEWAY_DATA_HOME_VAR, getGatewayHomeDir() + File.separator + "stacks" );
+ }
+
+ @Override
public String getHadoopConfDir() {
return get( HADOOP_CONF_DIR );
}
http://git-wip-us.apache.org/repos/asf/knox/blob/21d9a17e/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
new file mode 100644
index 0000000..ad6b0a6
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/PolicyBinding.java
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.gateway.service.definition;
+
+public class PolicyBinding {
+}
http://git-wip-us.apache.org/repos/asf/knox/blob/21d9a17e/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
new file mode 100644
index 0000000..4b0dccc
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/RewriteFilter.java
@@ -0,0 +1,47 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.gateway.service.definition;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType(name = "rewrite-filter")
+public class RewriteFilter {
+
+ private String ref;
+
+ private String applyTo;
+
+ @XmlAttribute
+ public String getRef() {
+ return ref;
+ }
+
+ public void setRef(String ref) {
+ this.ref = ref;
+ }
+
+ @XmlAttribute(name = "apply-to")
+ public String getApplyTo() {
+ return applyTo;
+ }
+
+ public void setApplyTo(String applyTo) {
+ this.applyTo = applyTo;
+ }
+}
http://git-wip-us.apache.org/repos/asf/knox/blob/21d9a17e/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
----------------------------------------------------------------------
diff --git a/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
new file mode 100644
index 0000000..3630ebf
--- /dev/null
+++ b/gateway-service-definitions/src/main/java/org/apache/hadoop/gateway/service/definition/UrlBinding.java
@@ -0,0 +1,49 @@
+/**
+ * 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.
+ */
+package org.apache.hadoop.gateway.service.definition;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import java.util.List;
+
+@XmlType(name = "url")
+public class UrlBinding {
+
+ private String pattern;
+
+ private List<RewriteFilter> rewriteFilters;
+
+ @XmlAttribute
+ public String getPattern() {
+ return pattern;
+ }
+
+ public void setPattern(String pattern) {
+ this.pattern = pattern;
+ }
+
+ @XmlElement(name = "rewrite-filter")
+ public List<RewriteFilter> getRewriteFilters() {
+ return rewriteFilters;
+ }
+
+ public void setRewriteFilters(List<RewriteFilter> rewriteFilters) {
+ this.rewriteFilters = rewriteFilters;
+ }
+}