2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.cvsSupport2
.connections
.pserver
;
18 import com
.intellij
.cvsSupport2
.config
.CvsApplicationLevelConfiguration
;
19 import com
.intellij
.cvsSupport2
.config
.CvsRootConfiguration
;
20 import com
.intellij
.cvsSupport2
.connections
.CvsConnectionSettings
;
21 import com
.intellij
.cvsSupport2
.connections
.CvsConnectionUtil
;
22 import com
.intellij
.cvsSupport2
.connections
.login
.CvsLoginWorker
;
23 import com
.intellij
.cvsSupport2
.cvsExecution
.ModalityContext
;
24 import com
.intellij
.cvsSupport2
.errorHandling
.ErrorRegistry
;
25 import com
.intellij
.openapi
.project
.Project
;
26 import org
.netbeans
.lib
.cvsclient
.command
.CommandException
;
27 import org
.netbeans
.lib
.cvsclient
.connection
.IConnection
;
32 public class PServerCvsSettings
extends CvsConnectionSettings
{
34 public PServerCvsSettings(CvsRootConfiguration cvsRootConfiguration
) {
35 super(cvsRootConfiguration
);
36 PORT
= CvsConnectionUtil
.DEFAULT_PSERVER_PORT
;
39 protected IConnection
createOriginalConnection(ErrorRegistry errorRegistry
, CvsRootConfiguration cvsRootConfiguration
) {
40 if (PASSWORD
== null) {
41 PASSWORD
= PServerLoginProvider
.getInstance().getScrambledPasswordForCvsRoot(myStringRepsentation
);
44 return CvsConnectionUtil
.createPServerConnection(this, cvsRootConfiguration
.PROXY_SETTINGS
, getTimeoutMillis());
47 public static int getTimeoutMillis() {
48 return CvsApplicationLevelConfiguration
.getInstance().TIMEOUT
* 1000;
51 public int getDefaultPort() {
52 return CvsConnectionUtil
.DEFAULT_PSERVER_PORT
;
55 public CvsLoginWorker
getLoginWorker(ModalityContext executor
, Project project
) {
56 return PServerLoginProvider
.getInstance().getLoginWorker(executor
, project
, this);
59 public void releasePassword() {
63 public void storePassword(String password
) {
67 public CommandException
processException(CommandException t
) {