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 * @version $Id: IntegrityScmProviderRepository.java 1.2 2011/08/22 13:06:43EDT Cletus D'Souza (dsouza) Exp $
34 * @since 1.6
35 */
36 public class IntegrityScmProviderRepository
37 extends ScmProviderRepositoryWithHost
38 {
39 // Configuration Path for the MKS Integrity SCM Project
40 private String configurationPath;
41
42 // MKS API Session
43 private APISession api;
44
45 // Encapsulation for our MKS Integrity SCM Project
46 private Project siProject;
47
48 // Encapsulation for our MKS Integrity SCM Sandbox
49 private Sandbox siSandbox;
50
51 /**
52 * IntegrityScmProviderRepository constructor
53 *
54 * @param host MKS Integrity Server hostname or ip address
55 * @param port MKS Integrity Server port number
56 * @param user MKS Integrity Server username
57 * @param paswd Password for MKS Integrity Server username
58 * @param configPath MKS Integrity SCM Project Configuration Path
59 * @param logger Maven ScmLogger object
60 */
61 public IntegrityScmProviderRepository( String host, int port, String user, String paswd, String configPath,
62 ScmLogger logger )
63 {
64 super();
65 setHost( host );
66 setPort( port );
67 setUser( user );
68 setPassword( paswd );
69 configurationPath = configPath;
70 api = new APISession( logger );
71 logger.debug( "Configuration Path: " + configurationPath );
72 }
73
74 /**
75 * Returns the MKS Integrity SCM Project object for this SCM Provider
76 *
77 * @return MKS Integrity SCM Project object
78 */
79 public Project getProject()
80 {
81 return siProject;
82 }
83
84 /**
85 * Sets the MKS Integrity SCM Project object for this SCM Provider
86 *
87 * @param project MKS Integrity SCM Project object
88 */
89 public void setProject( Project project )
90 {
91 siProject = project;
92 }
93
94 /**
95 * Returns the MKS Integrity SCM Sandbox object for this SCM Provider
96 *
97 * @return MKS Integrity SCM Sandbox object
98 */
99 public Sandbox getSandbox()
100 {
101 return siSandbox;
102 }
103
104 /**
105 * Sets the MKS Integrity SCM Sandbox object for this SCM Provider
106 *
107 * @param sandbox MKS Integrity SCM Sandbox object
108 */
109 public void setSandbox( Sandbox sandbox )
110 {
111 siSandbox = sandbox;
112 }
113
114 /**
115 * Returns the MKS Integrity API Session object for this SCM Provider
116 *
117 * @return MKS Integrity API Session
118 */
119 public APISession getAPISession()
120 {
121 return api;
122 }
123
124 /**
125 * Returns the MKS Integrity SCM Project Configuration Path
126 *
127 * @return MKS Integrity SCM Project Configuration Path
128 */
129 public String getConfigruationPath()
130 {
131 return configurationPath;
132 }
133 }