Skip to main content
summaryrefslogtreecommitdiffstats
blob: db97b47bc495d59a7203c451cd410ba24d0987c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*******************************************************************************
 * Copyright (c) 2012 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.transaction;

import java.io.InputStream;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.IArtifactToken;
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.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.TransactionReadable;

/**
 * @author Roberto E. Escobar
 */
public interface TransactionBuilder {

   Long getBranchId();

   Identifiable<String> getAuthor();

   String getComment();

   void setComment(String comment) throws OseeCoreException;

   /**
    * @return TransactionRecord or null of no changes made
    */
   TransactionReadable commit() throws OseeCoreException;

   boolean isCommitInProgress();

   // ARTIFACT

   ArtifactId createArtifact(IArtifactType artifactType, String name) throws OseeCoreException;

   ArtifactId createArtifact(IArtifactType artifactType, String name, String guid) throws OseeCoreException;

   ArtifactId createArtifact(IArtifactType artifactType, String name, String guid, long uuid) throws OseeCoreException;

   ArtifactId createArtifact(IArtifactToken configsFolder);

   void deleteArtifact(ArtifactId sourceArtifact) throws OseeCoreException;

   ArtifactId copyArtifact(ArtifactReadable sourceArtifact) throws OseeCoreException;

   ArtifactId copyArtifact(ArtifactReadable sourceArtifact, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException;

   ArtifactId copyArtifact(IOseeBranch fromBranch, ArtifactId sourceArtifact) throws OseeCoreException;

   ArtifactId copyArtifact(IOseeBranch fromBranch, ArtifactId sourceArtifact, Collection<? extends IAttributeType> attributesToDuplicate) throws OseeCoreException;

   ArtifactId introduceArtifact(IOseeBranch fromBranch, ArtifactId sourceArtifact) throws OseeCoreException;

   ArtifactId replaceWithVersion(ArtifactReadable sourceArtifact, ArtifactReadable destination) throws OseeCoreException;

   // ATTRIBUTE

   void setName(ArtifactId art, String value) throws OseeCoreException;

   AttributeId createAttribute(ArtifactId art, IAttributeType attributeType) throws OseeCoreException;

   <T> AttributeId createAttribute(ArtifactId art, IAttributeType attributeType, T value) throws OseeCoreException;

   AttributeId createAttributeFromString(ArtifactId art, IAttributeType attributeType, String value) throws OseeCoreException;

   <T> void setSoleAttributeValue(ArtifactId art, IAttributeType attributeType, T value) throws OseeCoreException;

   void setSoleAttributeFromStream(ArtifactId art, IAttributeType attributeType, InputStream stream) throws OseeCoreException;

   void setSoleAttributeFromString(ArtifactId art, IAttributeType attributeType, String value) throws OseeCoreException;

   <T> void setAttributesFromValues(ArtifactId art, IAttributeType attributeType, T... values) throws OseeCoreException;

   <T> void setAttributesFromValues(ArtifactId art, IAttributeType attributeType, Collection<T> values) throws OseeCoreException;

   void setAttributesFromStrings(ArtifactId art, IAttributeType attributeType, String... values) throws OseeCoreException;

   void setAttributesFromStrings(ArtifactId art, IAttributeType attributeType, Collection<String> values) throws OseeCoreException;

   <T> void setAttributeById(ArtifactId art, AttributeId attrId, T value) throws OseeCoreException;

   void setAttributeById(ArtifactId art, AttributeId attrId, String value) throws OseeCoreException;

   void setAttributeById(ArtifactId art, AttributeId attrId, InputStream stream) throws OseeCoreException;

   void deleteByAttributeId(ArtifactId art, AttributeId attrId) throws OseeCoreException;

   void deleteSoleAttribute(ArtifactId art, IAttributeType attributeType) throws OseeCoreException;

   void deleteAttributes(ArtifactId art, IAttributeType attributeType) throws OseeCoreException;

   void deleteAttributesWithValue(ArtifactId art, IAttributeType attributeType, Object value) throws OseeCoreException;

   /// TX

   void addChildren(ArtifactId artA, Iterable<? extends ArtifactId> children) throws OseeCoreException;

   void addChildren(ArtifactId artA, ArtifactId... children) throws OseeCoreException;

   void relate(ArtifactId artA, IRelationType relType, ArtifactId artB) throws OseeCoreException;

   void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale) throws OseeCoreException;

   void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, IRelationSorterId sortType) throws OseeCoreException;

   void relate(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale, IRelationSorterId sortType) throws OseeCoreException;

   void setRelations(ArtifactId artA, IRelationType relType, Iterable<? extends ArtifactId> artBs) throws OseeCoreException;

   void setRationale(ArtifactId artA, IRelationType relType, ArtifactId artB, String rationale) throws OseeCoreException;

   void unrelate(ArtifactId artA, IRelationType relType, ArtifactId artB) throws OseeCoreException;

   void unrelateFromAll(ArtifactId art) throws OseeCoreException;

   void unrelateFromAll(IRelationTypeSide typeSide, ArtifactId art) throws OseeCoreException;

}

Back to the top