Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2013-06-12 19:05:18 +0000
committerRoberto E. Escobar2013-07-02 22:39:58 +0000
commitd8b2035816503cf4d90e84e192df7f8d947d8aba (patch)
tree392cc96f51dc5426dae10b44bf8f140f8d018486 /plugins/org.eclipse.osee.orcs
parent37ba3e77ae13a6bd018d9b32570be704e461d902 (diff)
downloadorg.eclipse.osee-d8b2035816503cf4d90e84e192df7f8d947d8aba.tar.gz
org.eclipse.osee-d8b2035816503cf4d90e84e192df7f8d947d8aba.tar.xz
org.eclipse.osee-d8b2035816503cf4d90e84e192df7f8d947d8aba.zip
feature[ats_SF2V6]: Create new OrcsTypes API
Diffstat (limited to 'plugins/org.eclipse.osee.orcs')
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java6
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java40
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java50
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumEntry.java24
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumType.java32
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/IdentityCollection.java32
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/RelationTypes.java46
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/ObjectProvider.java22
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/Providers.java32
9 files changed, 281 insertions, 3 deletions
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
index 589ce7bd75c..69ffe2b9f74 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/OrcsTypes.java
@@ -29,10 +29,10 @@ public interface OrcsTypes {
void exportOseeTypes(OutputStream outputStream) throws OseeCoreException;
- Callable<?> purgeArtifactType(Collection<? extends IArtifactType> artifactTypes);
+ Callable<?> purgeArtifactsByArtifactType(Collection<? extends IArtifactType> artifactTypes);
- Callable<?> purgeAttributeType(Collection<? extends IAttributeType> attributeTypes);
+ Callable<?> purgeAttributesByAttributeType(Collection<? extends IAttributeType> attributeTypes);
- Callable<?> purgeRelationType(Collection<? extends IRelationType> relationTypes);
+ Callable<?> purgeRelationsByRelationType(Collection<? extends IRelationType> relationTypes);
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
new file mode 100644
index 00000000000..f9cc8b52030
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactTypes.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface ArtifactTypes extends IdentityCollection<Long, IArtifactType> {
+
+ boolean hasSuperArtifactTypes(IArtifactType artType) throws OseeCoreException;
+
+ Collection<? extends IArtifactType> getSuperArtifactTypes(IArtifactType artType) throws OseeCoreException;
+
+ Collection<? extends IArtifactType> getDescendantTypes(IArtifactType artType, int depth) throws OseeCoreException;
+
+ Collection<? extends IArtifactType> getAllDescendantTypes(IArtifactType artType) throws OseeCoreException;
+
+ boolean isValidAttributeType(IArtifactType artType, IOseeBranch branch, IAttributeType attributeType) throws OseeCoreException;
+
+ Collection<IAttributeType> getAttributeTypes(IArtifactType artType, IOseeBranch branch) throws OseeCoreException;
+
+ boolean isAbstract(IArtifactType artType) throws OseeCoreException;
+
+ boolean inheritsFrom(IArtifactType artType, IArtifactType... otherTypes) throws OseeCoreException;
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
new file mode 100644
index 00000000000..26cb8cd46ac
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/AttributeTypes.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface AttributeTypes extends IdentityCollection<Long, IAttributeType> {
+
+ Collection<? extends IAttributeType> getAllTaggable() throws OseeCoreException;
+
+ String getDescription(IAttributeType attrType) throws OseeCoreException;
+
+ String getBaseAttributeTypeId(IAttributeType attrType) throws OseeCoreException;
+
+ String getAttributeProviderId(IAttributeType attrType) throws OseeCoreException;
+
+ String getDefaultValue(IAttributeType attrType) throws OseeCoreException;
+
+ int getMaxOccurrences(IAttributeType attrType) throws OseeCoreException;
+
+ int getMinOccurrences(IAttributeType attrType) throws OseeCoreException;
+
+ EnumType getEnumType(IAttributeType attrType) throws OseeCoreException;
+
+ String getFileTypeExtension(IAttributeType attrType) throws OseeCoreException;
+
+ String getTaggerId(IAttributeType attrType) throws OseeCoreException;
+
+ boolean isTaggable(IAttributeType attrType) throws OseeCoreException;
+
+ boolean isEnumerated(IAttributeType attrType) throws OseeCoreException;
+
+ String getMediaType(IAttributeType attrType) throws OseeCoreException;
+
+ boolean hasMediaType(IAttributeType attrType) throws OseeCoreException;
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumEntry.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumEntry.java
new file mode 100644
index 00000000000..737b1402a5d
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumEntry.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import org.eclipse.osee.framework.core.data.FullyNamed;
+import org.eclipse.osee.framework.core.data.HasDescription;
+import org.eclipse.osee.framework.core.data.Identity;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface EnumEntry extends Identity<String>, FullyNamed, HasDescription {
+
+ int ordinal();
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumType.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumType.java
new file mode 100644
index 00000000000..3969a29e2a6
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/EnumType.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import java.util.Set;
+import org.eclipse.osee.framework.core.data.FullyNamed;
+import org.eclipse.osee.framework.core.data.Identity;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface EnumType extends Identity<Long>, FullyNamed {
+
+ EnumEntry[] values();
+
+ EnumEntry getEntryByGuid(String entryGuid);
+
+ Set<String> valuesAsOrderedStringSet();
+
+ EnumEntry valueOf(int ordinal) throws OseeCoreException;
+
+ EnumEntry valueOf(String entryName) throws OseeCoreException;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/IdentityCollection.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/IdentityCollection.java
new file mode 100644
index 00000000000..520f2ef45eb
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/IdentityCollection.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.core.data.Identity;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IdentityCollection<K, T extends Identity<K>> {
+
+ Collection<? extends T> getAll() throws OseeCoreException;
+
+ T getByUuid(K typeId) throws OseeCoreException;
+
+ boolean exists(T item) throws OseeCoreException;
+
+ boolean isEmpty() throws OseeCoreException;
+
+ int size() throws OseeCoreException;
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/RelationTypes.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/RelationTypes.java
new file mode 100644
index 00000000000..7625dc3fdfd
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/RelationTypes.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.data;
+
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.enums.RelationSide;
+import org.eclipse.osee.framework.core.enums.RelationTypeMultiplicity;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface RelationTypes extends IdentityCollection<Long, IRelationType> {
+
+ RelationTypeMultiplicity getMultiplicity(IRelationType relation) throws OseeCoreException;
+
+ IArtifactType getArtifactTypeSideA(IRelationType relation) throws OseeCoreException;
+
+ IArtifactType getArtifactTypeSideB(IRelationType relation) throws OseeCoreException;
+
+ IArtifactType getArtifactType(IRelationType relation, RelationSide relationSide) throws OseeCoreException;
+
+ String getSideName(IRelationType relation, RelationSide relationSide) throws OseeCoreException;
+
+ boolean isArtifactTypeAllowed(IRelationType relation, RelationSide relationSide, IArtifactType artifactType) throws OseeCoreException;
+
+ String getSideAName(IRelationType relation) throws OseeCoreException;
+
+ String getSideBName(IRelationType relation) throws OseeCoreException;
+
+ boolean isSideAName(IRelationType relation, String sideName) throws OseeArgumentException, OseeCoreException;
+
+ boolean isOrdered(IRelationType relation) throws OseeCoreException;
+
+ String getDefaultOrderTypeGuid(IRelationType relation) throws OseeCoreException;
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/ObjectProvider.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/ObjectProvider.java
new file mode 100644
index 00000000000..3968b8c0d8d
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/ObjectProvider.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.utility;
+
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface ObjectProvider<T> {
+
+ T get() throws OseeCoreException;
+
+}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/Providers.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/Providers.java
new file mode 100644
index 00000000000..3799e1e5e06
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/utility/Providers.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.orcs.utility;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class Providers {
+
+ private Providers() {
+ // utility class
+ }
+
+ public static <T> ObjectProvider<T> returning(final T object) {
+ return new ObjectProvider<T>() {
+
+ @Override
+ public T get() {
+ return object;
+ }
+ };
+ }
+
+}

Back to the top