001package org.apache.maven.scm.provider.integrity.repository; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import org.apache.maven.scm.log.ScmLogger; 023import org.apache.maven.scm.provider.ScmProviderRepositoryWithHost; 024import org.apache.maven.scm.provider.integrity.APISession; 025import org.apache.maven.scm.provider.integrity.Project; 026import org.apache.maven.scm.provider.integrity.Sandbox; 027 028/** 029 * MKS Integrity implementation of Maven's ScmProviderRepositoryWithHost 030 * <br>This class stores an abstraction of the MKS API Session, Project, and Sandbox 031 * 032 * @author <a href="mailto:cletus@mks.com">Cletus D'Souza</a> 033 * @since 1.6 034 */ 035public class IntegrityScmProviderRepository 036 extends ScmProviderRepositoryWithHost 037{ 038 // Configuration Path for the MKS Integrity SCM Project 039 private String configurationPath; 040 041 // MKS API Session 042 private APISession api; 043 044 // Encapsulation for our MKS Integrity SCM Project 045 private Project siProject; 046 047 // Encapsulation for our MKS Integrity SCM Sandbox 048 private Sandbox siSandbox; 049 050 /** 051 * IntegrityScmProviderRepository constructor 052 * 053 * @param host MKS Integrity Server hostname or ip address 054 * @param port MKS Integrity Server port number 055 * @param user MKS Integrity Server username 056 * @param paswd Password for MKS Integrity Server username 057 * @param configPath MKS Integrity SCM Project Configuration Path 058 * @param logger Maven ScmLogger object 059 */ 060 public IntegrityScmProviderRepository( String host, int port, String user, String paswd, String configPath, 061 ScmLogger logger ) 062 { 063 super(); 064 setHost( host ); 065 setPort( port ); 066 setUser( user ); 067 setPassword( paswd ); 068 configurationPath = configPath; 069 api = new APISession( logger ); 070 logger.debug( "Configuration Path: " + configurationPath ); 071 } 072 073 /** 074 * Returns the MKS Integrity SCM Project object for this SCM Provider 075 * 076 * @return MKS Integrity SCM Project object 077 */ 078 public Project getProject() 079 { 080 return siProject; 081 } 082 083 /** 084 * Sets the MKS Integrity SCM Project object for this SCM Provider 085 * 086 * @param project MKS Integrity SCM Project object 087 */ 088 public void setProject( Project project ) 089 { 090 siProject = project; 091 } 092 093 /** 094 * Returns the MKS Integrity SCM Sandbox object for this SCM Provider 095 * 096 * @return MKS Integrity SCM Sandbox object 097 */ 098 public Sandbox getSandbox() 099 { 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}