diff options
Diffstat (limited to 'winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids')
10 files changed, 291 insertions, 0 deletions
diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/IdNames.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/IdNames.java new file mode 100644 index 0000000..f06c917 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/IdNames.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids; + +/** + * This class is the brother of {@link org.eclipse.winery.common.id.IdNames} + * + * It includes all id names used additionally in the local ids + */ +public class IdNames { + + // the files belonging to one artifact template are nested in the sub + // directory "files" + public static final String ARTIFACTTEMPLATEDIRECTORY = "files"; + + public static final String CONSTRAINTTYPES = "constrainttypes"; + public static final String NAMESPACES = "namespaces"; + public static final String PLANLANGUAGES = "planlanguages"; + public static final String PLANTYPES = "plantypes"; + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/AdminId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/AdminId.java new file mode 100644 index 0000000..3a31b05 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/AdminId.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.GenericId; +import org.eclipse.winery.common.ids.XMLId; + +/** + * The Id for the single admin resource holding administrative things such as + * the prefixes of namespaces + */ +public abstract class AdminId extends GenericId { + + protected AdminId(XMLId xmlId) { + super(xmlId); + } + + @Override + public int compareTo(GenericId o) { + if (o instanceof AdminId) { + return this.getXmlId().compareTo(o.getXmlId()); + } else { + throw new IllegalStateException(); + } + } + + @Override + public GenericId getParent() { + return null; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof AdminId) { + return this.getXmlId().equals(((AdminId) obj).getXmlId()); + } else { + return false; + } + } + + @Override + public int hashCode() { + return this.getXmlId().hashCode(); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/ConstraintTypesId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/ConstraintTypesId.java new file mode 100644 index 0000000..210a2c7 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/ConstraintTypesId.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.repository.datatypes.ids.IdNames; + +public class ConstraintTypesId extends TypesId { + + private final static XMLId xmlId = new XMLId(IdNames.CONSTRAINTTYPES, false); + + + public ConstraintTypesId() { + super(ConstraintTypesId.xmlId); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/NamespacesId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/NamespacesId.java new file mode 100644 index 0000000..4bdb233 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/NamespacesId.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.repository.datatypes.ids.IdNames; + +public class NamespacesId extends AdminId { + + private final static XMLId xmlId = new XMLId(IdNames.NAMESPACES, false); + + + public NamespacesId() { + super(NamespacesId.xmlId); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanLanguagesId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanLanguagesId.java new file mode 100644 index 0000000..7ebfb7d --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanLanguagesId.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.repository.datatypes.ids.IdNames; + +public class PlanLanguagesId extends TypesId { + + private final static XMLId xmlId = new XMLId(IdNames.PLANLANGUAGES, false); + + + public PlanLanguagesId() { + super(PlanLanguagesId.xmlId); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanTypesId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanTypesId.java new file mode 100644 index 0000000..e44cd2b --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/PlanTypesId.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.repository.datatypes.ids.IdNames; + +public class PlanTypesId extends TypesId { + + private final static XMLId xmlId = new XMLId(IdNames.PLANTYPES, false); + + + public PlanTypesId() { + super(PlanTypesId.xmlId); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/TypesId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/TypesId.java new file mode 100644 index 0000000..db40780 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/admin/TypesId.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.admin; + +import org.eclipse.winery.common.ids.XMLId; + +public abstract class TypesId extends AdminId { + + protected TypesId(XMLId xmlId) { + super(xmlId); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/ArtifactTemplateDirectoryId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/ArtifactTemplateDirectoryId.java new file mode 100644 index 0000000..cce2d53 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/ArtifactTemplateDirectoryId.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.elements; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.common.ids.definitions.ArtifactTemplateId; +import org.eclipse.winery.common.ids.elements.TOSCAElementId; +import org.eclipse.winery.repository.datatypes.ids.IdNames; + +public class ArtifactTemplateDirectoryId extends TOSCAElementId { + + private final static XMLId xmlID = new XMLId(IdNames.ARTIFACTTEMPLATEDIRECTORY, false); + + + public ArtifactTemplateDirectoryId(ArtifactTemplateId parent) { + super(parent, ArtifactTemplateDirectoryId.xmlID); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/SelfServiceMetaDataId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/SelfServiceMetaDataId.java new file mode 100644 index 0000000..6bd5db8 --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/SelfServiceMetaDataId.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.elements; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.common.ids.definitions.ServiceTemplateId; +import org.eclipse.winery.common.ids.elements.TOSCAElementId; + +public class SelfServiceMetaDataId extends TOSCAElementId { + + public SelfServiceMetaDataId(ServiceTemplateId parent) { + super(parent, new XMLId("SELFSERVICE-Metadata", true)); + } + +} diff --git a/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/VisualAppearanceId.java b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/VisualAppearanceId.java new file mode 100644 index 0000000..9b7784f --- /dev/null +++ b/winery/org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/datatypes/ids/elements/VisualAppearanceId.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2012-2013 University of Stuttgart. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * and the Apache License 2.0 which both accompany this distribution, + * and are available at http://www.eclipse.org/legal/epl-v10.html + * and http://www.apache.org/licenses/LICENSE-2.0 + * + * Contributors: + * Oliver Kopp - initial API and implementation + *******************************************************************************/ +package org.eclipse.winery.repository.datatypes.ids.elements; + +import org.eclipse.winery.common.ids.XMLId; +import org.eclipse.winery.common.ids.definitions.TopologyGraphElementEntityTypeId; +import org.eclipse.winery.common.ids.elements.TOSCAElementId; + +/** + * ID for a pseudo-TOSCA-Element holding the data for the visual appearance + * (e.g., icons for node types) + */ +public class VisualAppearanceId extends TOSCAElementId { + + public VisualAppearanceId(TopologyGraphElementEntityTypeId parent) { + super(parent, new XMLId("appearance", true)); + } + +} |