1 | |
package org.apache.maven.scm.provider.clearcase; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.maven.scm.CommandParameters; |
23 | |
import org.apache.maven.scm.ScmException; |
24 | |
import org.apache.maven.scm.ScmFileSet; |
25 | |
import org.apache.maven.scm.command.blame.BlameScmResult; |
26 | |
import org.apache.maven.scm.command.changelog.ChangeLogScmResult; |
27 | |
import org.apache.maven.scm.command.checkin.CheckInScmResult; |
28 | |
import org.apache.maven.scm.command.checkout.CheckOutScmResult; |
29 | |
import org.apache.maven.scm.command.edit.EditScmResult; |
30 | |
import org.apache.maven.scm.command.status.StatusScmResult; |
31 | |
import org.apache.maven.scm.command.tag.TagScmResult; |
32 | |
import org.apache.maven.scm.command.update.UpdateScmResult; |
33 | |
import org.apache.maven.scm.provider.AbstractScmProvider; |
34 | |
import org.apache.maven.scm.provider.ScmProviderRepository; |
35 | |
import org.apache.maven.scm.provider.clearcase.command.blame.ClearCaseBlameCommand; |
36 | |
import org.apache.maven.scm.provider.clearcase.command.changelog.ClearCaseChangeLogCommand; |
37 | |
import org.apache.maven.scm.provider.clearcase.command.checkin.ClearCaseCheckInCommand; |
38 | |
import org.apache.maven.scm.provider.clearcase.command.checkout.ClearCaseCheckOutCommand; |
39 | |
import org.apache.maven.scm.provider.clearcase.command.edit.ClearCaseEditCommand; |
40 | |
import org.apache.maven.scm.provider.clearcase.command.status.ClearCaseStatusCommand; |
41 | |
import org.apache.maven.scm.provider.clearcase.command.tag.ClearCaseTagCommand; |
42 | |
import org.apache.maven.scm.provider.clearcase.command.update.ClearCaseUpdateCommand; |
43 | |
import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository; |
44 | |
import org.apache.maven.scm.provider.clearcase.util.ClearCaseUtil; |
45 | |
import org.apache.maven.scm.providers.clearcase.settings.Settings; |
46 | |
import org.apache.maven.scm.repository.ScmRepositoryException; |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
|
54 | |
|
55 | 0 | public class ClearCaseScmProvider |
56 | |
extends AbstractScmProvider |
57 | |
{ |
58 | |
|
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | |
private Settings settings; |
66 | |
|
67 | |
|
68 | |
public ScmProviderRepository makeProviderScmRepository( String scmSpecificUrl, char delimiter ) |
69 | |
throws ScmRepositoryException |
70 | |
{ |
71 | 0 | settings = ClearCaseUtil.getSettings(); |
72 | 0 | return new ClearCaseScmProviderRepository( getLogger(), scmSpecificUrl, settings ); |
73 | |
} |
74 | |
|
75 | |
|
76 | |
public String getScmType() |
77 | |
{ |
78 | 0 | return "clearcase"; |
79 | |
} |
80 | |
|
81 | |
|
82 | |
public boolean requiresEditMode() |
83 | |
{ |
84 | 0 | return true; |
85 | |
} |
86 | |
|
87 | |
|
88 | |
public ChangeLogScmResult changelog( ScmProviderRepository repository, ScmFileSet fileSet, |
89 | |
CommandParameters parameters ) |
90 | |
throws ScmException |
91 | |
{ |
92 | 0 | ClearCaseChangeLogCommand command = new ClearCaseChangeLogCommand(); |
93 | |
|
94 | 0 | command.setLogger( getLogger() ); |
95 | |
|
96 | 0 | return (ChangeLogScmResult) command.execute( repository, fileSet, parameters ); |
97 | |
} |
98 | |
|
99 | |
|
100 | |
public CheckInScmResult checkin( ScmProviderRepository repository, ScmFileSet fileSet, |
101 | |
CommandParameters parameters ) |
102 | |
throws ScmException |
103 | |
{ |
104 | 0 | ClearCaseCheckInCommand command = new ClearCaseCheckInCommand(); |
105 | |
|
106 | 0 | command.setLogger( getLogger() ); |
107 | |
|
108 | 0 | return (CheckInScmResult) command.execute( repository, fileSet, parameters ); |
109 | |
} |
110 | |
|
111 | |
|
112 | |
public CheckOutScmResult checkout( ScmProviderRepository repository, ScmFileSet fileSet, |
113 | |
CommandParameters parameters ) |
114 | |
throws ScmException |
115 | |
{ |
116 | 0 | ClearCaseCheckOutCommand command = new ClearCaseCheckOutCommand(); |
117 | |
|
118 | 0 | command.setLogger( getLogger() ); |
119 | 0 | command.setSettings( settings ); |
120 | |
|
121 | 0 | return (CheckOutScmResult) command.execute( repository, fileSet, parameters ); |
122 | |
} |
123 | |
|
124 | |
|
125 | |
protected UpdateScmResult update( ScmProviderRepository repository, ScmFileSet fileSet, |
126 | |
CommandParameters parameters ) |
127 | |
throws ScmException |
128 | |
{ |
129 | 0 | ClearCaseUpdateCommand command = new ClearCaseUpdateCommand(); |
130 | |
|
131 | 0 | command.setLogger( getLogger() ); |
132 | |
|
133 | 0 | return (UpdateScmResult) command.execute( repository, fileSet, parameters ); |
134 | |
} |
135 | |
|
136 | |
|
137 | |
public TagScmResult tag( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) |
138 | |
throws ScmException |
139 | |
{ |
140 | 0 | ClearCaseTagCommand command = new ClearCaseTagCommand(); |
141 | |
|
142 | 0 | command.setLogger( getLogger() ); |
143 | |
|
144 | 0 | return (TagScmResult) command.execute( repository, fileSet, parameters ); |
145 | |
} |
146 | |
|
147 | |
|
148 | |
protected StatusScmResult status( ScmProviderRepository repository, ScmFileSet fileSet, |
149 | |
CommandParameters parameters ) |
150 | |
throws ScmException |
151 | |
{ |
152 | 0 | ClearCaseStatusCommand command = new ClearCaseStatusCommand(); |
153 | |
|
154 | 0 | command.setLogger( getLogger() ); |
155 | |
|
156 | 0 | return (StatusScmResult) command.execute( repository, fileSet, parameters ); |
157 | |
} |
158 | |
|
159 | |
|
160 | |
protected EditScmResult edit( ScmProviderRepository repository, ScmFileSet fileSet, |
161 | |
CommandParameters parameters ) |
162 | |
throws ScmException |
163 | |
{ |
164 | 0 | ClearCaseEditCommand command = new ClearCaseEditCommand(); |
165 | |
|
166 | 0 | command.setLogger( getLogger() ); |
167 | |
|
168 | 0 | return (EditScmResult) command.execute( repository, fileSet, parameters ); |
169 | |
} |
170 | |
|
171 | |
|
172 | |
protected BlameScmResult blame( ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters ) |
173 | |
throws ScmException |
174 | |
{ |
175 | 0 | ClearCaseBlameCommand command = new ClearCaseBlameCommand(); |
176 | |
|
177 | 0 | command.setLogger( getLogger() ); |
178 | |
|
179 | 0 | return (BlameScmResult) command.execute( repository, fileSet, parameters ); |
180 | |
} |
181 | |
} |