summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/binding-http/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-11-19 05:27:58 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2008-11-19 05:27:58 +0000
commit5f3869c451e46aadc943d00087d6847877dd1c50 (patch)
treee22baaff1fb9ea42606b7d04af52e032e3bc03bc /java/sca/modules/binding-http/src
parent60744a36aae604ac3c4499ed54f1082ab8f5947d (diff)
Merging the 1.x delta on top of the equinox based modules
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@718858 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/binding-http/src')
-rw-r--r--java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java (renamed from java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java)6
-rw-r--r--java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPHeader.java51
-rw-r--r--java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java49
3 files changed, 98 insertions, 8 deletions
diff --git a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java
index aa80b7a40b..023423f0eb 100644
--- a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/CacheContext.java
+++ b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPCacheContext.java
@@ -36,7 +36,7 @@ import javax.servlet.http.HttpServletRequest;
* If-Modified-Since, If-Unmodified-Since, If-Range.
*/
-public class CacheContext {
+public class HTTPCacheContext {
public static final SimpleDateFormat RFC822DateFormat = new SimpleDateFormat( "EEE, dd MMM yyyy HH:mm:ss Z" ); // RFC 822 date time
public boolean enabled;
@@ -211,8 +211,8 @@ public class CacheContext {
* @param request
* @return
*/
- public static CacheContext getCacheContextFromRequest( HttpServletRequest request ) throws java.text.ParseException {
- CacheContext context = new CacheContext();
+ public static HTTPCacheContext getCacheContextFromRequest( HttpServletRequest request ) throws java.text.ParseException {
+ HTTPCacheContext context = new HTTPCacheContext();
String eTag = request.getHeader( "If-Match" );
if ( eTag != null ) {
diff --git a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPHeader.java b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPHeader.java
new file mode 100644
index 0000000000..69e44cf35c
--- /dev/null
+++ b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/HTTPHeader.java
@@ -0,0 +1,51 @@
+/*
+ * 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.tuscany.sca.binding.http;
+
+public class HTTPHeader {
+ private String name;
+ private Object value;
+
+ public HTTPHeader() {
+
+ }
+
+ public HTTPHeader(String name, Object value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+}
diff --git a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
index 69d2bd7d25..6d4bf92adc 100644
--- a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
+++ b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
@@ -19,11 +19,14 @@
package org.apache.tuscany.sca.binding.http.impl;
-import org.apache.tuscany.sca.assembly.Binding;
-import org.apache.tuscany.sca.assembly.Component;
-import org.apache.tuscany.sca.assembly.ComponentService;
-import org.apache.tuscany.sca.assembly.OptimizableBinding;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.tuscany.sca.binding.http.HTTPBinding;
+import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentAttachPointType;
+import org.apache.tuscany.sca.policy.PolicySet;
+import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
/**
@@ -31,10 +34,16 @@ import org.apache.tuscany.sca.binding.http.HTTPBinding;
*
* @version $Rev$ $Date$
*/
-class HTTPBindingImpl implements HTTPBinding {
+class HTTPBindingImpl implements HTTPBinding, PolicySetAttachPoint {
private String name;
private String uri;
+
+ private List<Intent> requiredIntents = new ArrayList<Intent>();
+ private List<PolicySet> policySets = new ArrayList<PolicySet>();
+ private IntentAttachPointType intentAttachPointType;
+ private List<PolicySet> applicablePolicySets = new ArrayList<PolicySet>();
+
public String getName() {
return name;
@@ -60,7 +69,37 @@ class HTTPBindingImpl implements HTTPBinding {
public void setUnresolved(boolean unresolved) {
// The sample binding is always resolved
}
+
+ //Policy related getters/setters
+
+ public List<PolicySet> getPolicySets() {
+ return policySets;
+ }
+
+ public List<Intent> getRequiredIntents() {
+ return requiredIntents;
+ }
+ public IntentAttachPointType getType() {
+ return intentAttachPointType;
+ }
+
+ public void setType(IntentAttachPointType intentAttachPointType) {
+ this.intentAttachPointType = intentAttachPointType;
+ }
+
+ public void setPolicySets(List<PolicySet> policySets) {
+ this.policySets = policySets;
+ }
+
+ public void setRequiredIntents(List<Intent> intents) {
+ this.requiredIntents = intents;
+ }
+
+ public List<PolicySet> getApplicablePolicySets() {
+ return applicablePolicySets;
+ }
+
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();