diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-21 07:03:47 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-21 07:03:47 +0000 |
commit | ab6904bc2f622129bc548391745b08eb0c219e57 (patch) | |
tree | 5c7599119182bfa8e65c0d6605e933396aedffd2 /java/sca/modules/policy | |
parent | 8d70ef6d556ad29b93d5d40e91c4c9304638c9e9 (diff) |
Fix svn:eol-style and svn:keywords properties for java/xml files
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@796166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/policy')
4 files changed, 213 insertions, 213 deletions
diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java index 53c6684d11..1a2a9c5bad 100644 --- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java +++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/BindingTypeImpl.java @@ -1,38 +1,38 @@ -/*
- * 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.policy.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.BindingType;
-
-/**
- * Concrete implementation for a BindingType
- *
- * @version $Rev$ $Date$
- */
-public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType {
- protected BindingTypeImpl() {
- super();
- }
-
- public QName getBaseType() {
- return BINDING_BASE;
- }
-}
+/* + * 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.policy.impl; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.policy.BindingType; + +/** + * Concrete implementation for a BindingType + * + * @version $Rev$ $Date$ + */ +public class BindingTypeImpl extends ExtensionTypeImpl implements BindingType { + protected BindingTypeImpl() { + super(); + } + + public QName getBaseType() { + return BINDING_BASE; + } +} diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java index 169ca29833..5c285e4d95 100644 --- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java +++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/impl/ImplementationTypeImpl.java @@ -1,39 +1,39 @@ -/*
- * 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.policy.impl;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tuscany.sca.policy.ImplementationType;
-
-/**
- * Concrete implementation for a Implementation Type
- *
- * @version $Rev$ $Date$
- */
-public class ImplementationTypeImpl extends ExtensionTypeImpl implements ImplementationType {
- protected ImplementationTypeImpl() {
- super();
- }
-
- public QName getBaseType() {
- return IMPLEMENTATION_BASE;
- }
-
-}
+/* + * 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.policy.impl; + +import javax.xml.namespace.QName; + +import org.apache.tuscany.sca.policy.ImplementationType; + +/** + * Concrete implementation for a Implementation Type + * + * @version $Rev$ $Date$ + */ +public class ImplementationTypeImpl extends ExtensionTypeImpl implements ImplementationType { + protected ImplementationTypeImpl() { + super(); + } + + public QName getBaseType() { + return IMPLEMENTATION_BASE; + } + +} diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java index eb97818042..3ed4eac5a2 100644 --- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java +++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationException.java @@ -1,38 +1,38 @@ -/*
- * 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.policy.util;
-
-/**
- * Exception to be throw for invalid policy intents / policysets
- *
- * @version $Rev$ $Date$
- */
-public class PolicyValidationException extends Exception {
- private static final long serialVersionUID = 506979037642587755L;
-
- public PolicyValidationException(String message) {
- super(message);
- }
-
- public PolicyValidationException(Throwable e) {
- super(e);
- }
-
-}
+/* + * 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.policy.util; + +/** + * Exception to be throw for invalid policy intents / policysets + * + * @version $Rev$ $Date$ + */ +public class PolicyValidationException extends Exception { + private static final long serialVersionUID = 506979037642587755L; + + public PolicyValidationException(String message) { + super(message); + } + + public PolicyValidationException(Throwable e) { + super(e); + } + +} diff --git a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java index c8fe89f364..616eab5737 100644 --- a/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java +++ b/java/sca/modules/policy/src/main/java/org/apache/tuscany/sca/policy/util/PolicyValidationUtils.java @@ -1,98 +1,98 @@ -/*
- * 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.policy.util;
-
-import java.util.List;
-
-import org.apache.tuscany.sca.policy.ExtensionType;
-import org.apache.tuscany.sca.policy.Intent;
-import org.apache.tuscany.sca.policy.PolicySet;
-import org.apache.tuscany.sca.policy.PolicySubject;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PolicyValidationUtils {
-
- public static boolean isConstrained(ExtensionType constrained, ExtensionType attachPointType) {
- return (attachPointType != null
- && (attachPointType.equals(constrained)) || (attachPointType.getBaseType().equals(constrained)));
- }
-
- public static void validateIntents(PolicySubject attachPoint, ExtensionType attachPointType)
- throws PolicyValidationException {
- boolean found = false;
- if (attachPointType != null) {
- // validate intents specified against the parent (binding /
- // implementation)
- found = false;
- for (Intent intent : attachPoint.getRequiredIntents()) {
- if (!intent.isUnresolved()) {
- for (ExtensionType constrained : intent.getConstrainedTypes()) {
- if (isConstrained(constrained, attachPointType)) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' does not constrain extension type "
- + attachPointType.getType());
- }
- } else {
- throw new PolicyValidationException("Policy Intent '" + intent.getName()
- + "' is not defined in this domain ");
- }
- }
- }
- }
-
- public static void validatePolicySets(PolicySubject subject) throws PolicyValidationException {
- // validatePolicySets(subject, subject.getType(), subject.getAttachedPolicySets());
- }
-
- public static void validatePolicySets(PolicySubject subject, ExtensionType attachPointType)
- throws PolicyValidationException {
- validatePolicySets(subject, attachPointType, subject.getPolicySets());
- }
-
- public static void validatePolicySets(PolicySubject subject,
- ExtensionType attachPointType,
- List<PolicySet> applicablePolicySets) throws PolicyValidationException {
- // Since the applicablePolicySets in a subject will already
- // have the list of policysets that might ever be applicable to this attachPoint,
- // just check if the defined policysets feature in the list of applicable
- // policysets
- for (PolicySet definedPolicySet : subject.getPolicySets()) {
- if (!definedPolicySet.isUnresolved()) {
- if (!applicablePolicySets.contains(definedPolicySet)) {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
- + "' does not apply to extension type "
- + attachPointType.getType());
- }
- } else {
- throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName()
- + "' is not defined in this domain ");
-
- }
- }
- }
-}
+/* + * 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.policy.util; + +import java.util.List; + +import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; +import org.apache.tuscany.sca.policy.PolicySet; +import org.apache.tuscany.sca.policy.PolicySubject; + +/** + * @version $Rev$ $Date$ + */ +public class PolicyValidationUtils { + + public static boolean isConstrained(ExtensionType constrained, ExtensionType attachPointType) { + return (attachPointType != null + && (attachPointType.equals(constrained)) || (attachPointType.getBaseType().equals(constrained))); + } + + public static void validateIntents(PolicySubject attachPoint, ExtensionType attachPointType) + throws PolicyValidationException { + boolean found = false; + if (attachPointType != null) { + // validate intents specified against the parent (binding / + // implementation) + found = false; + for (Intent intent : attachPoint.getRequiredIntents()) { + if (!intent.isUnresolved()) { + for (ExtensionType constrained : intent.getConstrainedTypes()) { + if (isConstrained(constrained, attachPointType)) { + found = true; + break; + } + } + + if (!found) { + throw new PolicyValidationException("Policy Intent '" + intent.getName() + + "' does not constrain extension type " + + attachPointType.getType()); + } + } else { + throw new PolicyValidationException("Policy Intent '" + intent.getName() + + "' is not defined in this domain "); + } + } + } + } + + public static void validatePolicySets(PolicySubject subject) throws PolicyValidationException { + // validatePolicySets(subject, subject.getType(), subject.getAttachedPolicySets()); + } + + public static void validatePolicySets(PolicySubject subject, ExtensionType attachPointType) + throws PolicyValidationException { + validatePolicySets(subject, attachPointType, subject.getPolicySets()); + } + + public static void validatePolicySets(PolicySubject subject, + ExtensionType attachPointType, + List<PolicySet> applicablePolicySets) throws PolicyValidationException { + // Since the applicablePolicySets in a subject will already + // have the list of policysets that might ever be applicable to this attachPoint, + // just check if the defined policysets feature in the list of applicable + // policysets + for (PolicySet definedPolicySet : subject.getPolicySets()) { + if (!definedPolicySet.isUnresolved()) { + if (!applicablePolicySets.contains(definedPolicySet)) { + throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName() + + "' does not apply to extension type " + + attachPointType.getType()); + } + } else { + throw new PolicyValidationException("Policy Set '" + definedPolicySet.getName() + + "' is not defined in this domain "); + + } + } + } +} |