1 package org.apache.maven.scm.provider.integrity.repository;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 import org.apache.maven.scm.log.ScmLogger;
23 import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost;
24 import org.apache.maven.scm.provider.integrity.APISession;
25 import org.apache.maven.scm.provider.integrity.Project;
26 import org.apache.maven.scm.provider.integrity.Sandbox;
27
28 /**
29 * MKS Integrity implementation of Maven's ScmProviderRepositoryWithHost
30 * <br>This class stores an abstraction of the MKS API Session, Project, and Sandbox
31 *
32 * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a>
33 * @since 1.6
34 */
35 public class IntegrityScmProviderRepository
36 extends ScmProviderRepositoryWithHost
37 {
38 // Configuration Path for the MKS Integrity SCM Project
39 private String configurationPath;
40
41 // MKS API Session
42 private APISession api;
43
44 // Encapsulation for our MKS Integrity SCM Project
45 private Project siProject;
46
47 // Encapsulation for our MKS Integrity SCM Sandbox
48 private Sandbox siSandbox;
49
50 /**
51 * IntegrityScmProviderRepository constructor
52 *
53 * @param host MKS Integrity Server hostname or ip address
54 * @param port MKS Integrity Server port number
55 * @param user MKS Integrity Server username
56 * @param paswd Password for MKS Integrity Server username
57 * @param configPath MKS Integrity SCM Project Configuration Path
58 * @param logger Maven ScmLogger object
59 */
60 public IntegrityScmProviderRepository( String host, int port, String user, String paswd, String configPath,
61 ScmLogger logger )
62 {
63 super();
64 setHost( host );
65 setPort( port );
66 setUser( user );
67 setPassword( paswd );
68 configurationPath = configPath;
69 api = new APISession( logger );
70 logger.debug( "Configuration Path: " + configurationPath );
71 }
72
73 /**
74 * Returns the MKS Integrity SCM Project object for this SCM Provider
75 *
76 * @return MKS Integrity SCM Project object
77 */
78 public Project getProject()
79 {
80 return siProject;
81 }
82
83 /**
84 * Sets the MKS Integrity SCM Project object for this SCM Provider
85 *
86 * @param project MKS Integrity SCM Project object
87 */
88 public void setProject( Project project )
89 {
90 siProject = project;
91 }
92
93 /**
94 * Returns the MKS Integrity SCM Sandbox object for this SCM Provider
95 *
96 * @return MKS Integrity SCM Sandbox object
97 */
98 public Sandbox getSandbox()
99 {
100 return siSandbox;
101 }
102
103 /**
104 * Sets the MKS Integrity SCM Sandbox object for this SCM Provider
105 *
106 * @param sandbox MKS Integrity SCM Sandbox object
107 */
108 public void setSandbox( Sandbox sandbox )
109 {
110 siSandbox = sandbox;
111 }
112
113 /**
114 * Returns the MKS Integrity API Session object for this SCM Provider
115 *
116 * @return MKS Integrity API Session
117 */
118 public APISession getAPISession()
119 {
120 return api;
121 }
122
123 /**
124 * Returns the MKS Integrity SCM Project Configuration Path
125 *
126 * @return MKS Integrity SCM Project Configuration Path
127 */
128 public String getConfigruationPath()
129 {
130 return configurationPath;
131 }
132 }