public class ConnectionHelper extends Object implements AutoCloseable
Constructor and Description |
---|
ConnectionHelper(hudson.model.ItemGroup context,
String credentialID,
hudson.model.TaskListener listener) |
ConnectionHelper(hudson.model.Item job,
String credentialID,
hudson.model.TaskListener listener) |
ConnectionHelper(P4BaseCredentials credential) |
ConnectionHelper(P4BaseCredentials credential,
hudson.model.TaskListener listener) |
ConnectionHelper(hudson.model.Run run,
String credentialID,
hudson.model.TaskListener listener) |
ConnectionHelper(String credentialID,
hudson.model.TaskListener listener)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
abort() |
boolean |
checkVersion(int min)
Checks the Perforce server version number and returns true if greater
than or equal to the min version.
|
void |
close() |
String |
counterToChange(String name)
Look for a counter and return a change or reference.
|
void |
deleteClient(String name)
Delete a client workspace
|
protected void |
disconnect()
Disconnect from the Perforce Server.
|
static P4BaseCredentials |
findCredential(String id)
Deprecated.
|
static P4BaseCredentials |
findCredential(String credentialsId,
hudson.model.Item item)
Finds a Perforce Credential based on credentials ID and
Item . |
static P4BaseCredentials |
findCredential(String credentialsId,
hudson.model.ItemGroup context)
Finds a Perforce Credential based on the String id.
|
static P4BaseCredentials |
findCredential(String credentialsId,
hudson.model.Run run)
Finds a Perforce Credential based on the String id and
Run . |
AuthorisationConfig |
getAuthorisationConfig() |
List<com.perforce.p4java.core.file.IFileSpec> |
getChangeFiles(long id,
int limit) |
com.perforce.p4java.core.IChangelistSummary |
getChangeSummary(long id) |
List<com.perforce.p4java.core.file.IFileSpec> |
getCommitFiles(String repo,
String sha) |
com.perforce.p4java.server.IOptionsServer |
getConnection() |
String |
getCounter(String id)
Get Perforce Counter
|
List<com.perforce.p4java.core.file.IFileSpec> |
getDirs(List<String> paths)
Gets a list of Dirs given a path (multi-branch?)
|
String |
getEmail(String userName) |
com.perforce.p4java.graph.ICommit |
getGraphCommit(String sha,
String repo) |
P4Ref |
getGraphHead(String repo)
Get the last SHA commited to the specified repo.
|
long |
getHead(String path)
Get the latest change on the given path
|
long |
getHeadLimit() |
List<com.perforce.p4java.core.IFix> |
getJobs(int id) |
com.perforce.p4java.impl.generic.core.Label |
getLabel(String id)
Get Perforce Label
|
List<com.perforce.p4java.core.file.IFileSpec> |
getLabelFiles(String id,
int limit)
Find all files within a label or change.
|
hudson.model.TaskListener |
getListener() |
long |
getLowestHead(String path,
String from,
String to)
Get the lowest change on the given path
|
protected int |
getMaxChangeLimit() |
PerforceScm.DescriptorImpl |
getP4SCM() |
String |
getPort() |
int |
getRetry() |
List<com.perforce.p4java.core.file.IFileSpec> |
getShelvedFiles(int id)
Find all files within a shelf.
|
List<com.perforce.p4java.core.IStreamSummary> |
getStreams(List<String> paths)
Gets a list of Dirs given a path (multi-stream?)
|
String |
getSwarm() |
String |
getTicket() |
String |
getTrust() |
String |
getUser() |
Validate |
getValidate() |
boolean |
hasAborted() |
boolean |
hasFile(String depotPath) |
boolean |
isClient(String name)
Test if given name is a client
|
boolean |
isConnected() |
boolean |
isCounter(String name)
Test if given name is a counter
|
boolean |
isLabel(String name)
Test if given name is a label
|
boolean |
isUnicode() |
String |
labelToChange(String name)
Look for a label and return a change or static label.
|
List<com.perforce.p4java.core.IRepo> |
listAllRepos()
List all Graph Repos
|
List<P4Ref> |
listCommits(List<P4Ref> fromRefs,
P4Ref to)
List graph Commits with in range of SHAs
|
List<com.perforce.p4java.core.IRepo> |
listRepos(String path)
List of Graph Repos based on a path
|
void |
log(String msg) |
boolean |
login() |
void |
logout() |
void |
setLabel(com.perforce.p4java.impl.generic.core.Label label)
Create/Update a Perforce Label
|
@Deprecated public ConnectionHelper(String credentialID, hudson.model.TaskListener listener) throws IOException
IOException
public ConnectionHelper(hudson.model.ItemGroup context, String credentialID, hudson.model.TaskListener listener) throws IOException
IOException
public ConnectionHelper(hudson.model.Item job, String credentialID, hudson.model.TaskListener listener) throws IOException
IOException
public ConnectionHelper(hudson.model.Run run, String credentialID, hudson.model.TaskListener listener) throws IOException
IOException
public ConnectionHelper(P4BaseCredentials credential, hudson.model.TaskListener listener) throws IOException
IOException
public ConnectionHelper(P4BaseCredentials credential) throws IOException
IOException
public hudson.model.TaskListener getListener()
public AuthorisationConfig getAuthorisationConfig()
public Validate getValidate()
public com.perforce.p4java.server.IOptionsServer getConnection()
public int getRetry()
public String getUser()
public String getPort()
public String getTicket()
public boolean isConnected()
public boolean isUnicode() throws com.perforce.p4java.exception.ConnectionException, com.perforce.p4java.exception.AccessException, com.perforce.p4java.exception.RequestException
com.perforce.p4java.exception.ConnectionException
com.perforce.p4java.exception.AccessException
com.perforce.p4java.exception.RequestException
public boolean checkVersion(int min)
min
- Minimum server versionpublic List<com.perforce.p4java.core.file.IFileSpec> getDirs(List<String> paths) throws Exception
paths
- list of paths to look for dirs (only takes * as wildcard)Exception
- push up stackpublic List<com.perforce.p4java.core.IStreamSummary> getStreams(List<String> paths) throws Exception
paths
- list of path to look for streams (takes ... or * as wildcard)Exception
- push up stackpublic com.perforce.p4java.core.IChangelistSummary getChangeSummary(long id) throws com.perforce.p4java.exception.P4JavaException
com.perforce.p4java.exception.P4JavaException
public List<com.perforce.p4java.core.IFix> getJobs(int id) throws com.perforce.p4java.exception.P4JavaException
com.perforce.p4java.exception.P4JavaException
public boolean isCounter(String name) throws Exception
name
- Couner nameException
- push up stackpublic String getCounter(String id) throws Exception
id
- Counter nameException
- push up stackpublic boolean isLabel(String name) throws Exception
name
- Label nameException
- push up stackpublic String labelToChange(String name)
name
- labelpublic String counterToChange(String name)
name
- counterpublic boolean isClient(String name) throws Exception
name
- Client nameException
- push up stackpublic void deleteClient(String name) throws Exception
name
- Client nameException
- push up stackpublic com.perforce.p4java.impl.generic.core.Label getLabel(String id) throws Exception
id
- Label nameException
- push up stackpublic void setLabel(com.perforce.p4java.impl.generic.core.Label label) throws Exception
label
- Label nameException
- push up stackpublic List<com.perforce.p4java.core.file.IFileSpec> getLabelFiles(String id, int limit) throws Exception
id
- Label name or change number (as string)limit
- Max results (-m value)Exception
- push up stackpublic List<com.perforce.p4java.core.file.IFileSpec> getChangeFiles(long id, int limit) throws Exception
Exception
public List<com.perforce.p4java.core.file.IFileSpec> getShelvedFiles(int id) throws Exception
id
- Shelf IDException
- push up stackpublic String getSwarm() throws com.perforce.p4java.exception.P4JavaException
com.perforce.p4java.exception.P4JavaException
public long getHead(String path) throws Exception
path
- Perforce depot path //foo/...Exception
- push up stackpublic long getLowestHead(String path, String from, String to) throws Exception
path
- Perforce depot path //foo/...from
- revision specifierto
- revision specifierException
- push up stackpublic com.perforce.p4java.graph.ICommit getGraphCommit(String sha, String repo) throws com.perforce.p4java.exception.P4JavaException
com.perforce.p4java.exception.P4JavaException
public List<com.perforce.p4java.core.file.IFileSpec> getCommitFiles(String repo, String sha) throws com.perforce.p4java.exception.P4JavaException
com.perforce.p4java.exception.P4JavaException
public P4Ref getGraphHead(String repo)
repo
- a graph repopublic List<P4Ref> listCommits(List<P4Ref> fromRefs, P4Ref to) throws Exception
fromRefs
- Array of potential SHAs (include other repos)to
- The last SHA to list commitsException
- push up stackpublic List<com.perforce.p4java.core.IRepo> listAllRepos() throws Exception
Exception
- push up stackpublic List<com.perforce.p4java.core.IRepo> listRepos(String path) throws Exception
path
- Path filterException
- push up stackprotected void disconnect()
@Deprecated public static P4BaseCredentials findCredential(String id)
findCredential(String, ItemGroup)
or findCredential(String, Item)
id
- Credential IDpublic static P4BaseCredentials findCredential(String credentialsId, hudson.model.ItemGroup context)
credentialsId
- Credential IDcontext
- The contextpublic static P4BaseCredentials findCredential(String credentialsId, hudson.model.Item item)
Item
.
This also tracks usage of the credentials.credentialsId
- Credential IDitem
- The Item
public static P4BaseCredentials findCredential(String credentialsId, hudson.model.Run run)
Run
.credentialsId
- Credential IDrun
- The Run
protected int getMaxChangeLimit()
public long getHeadLimit()
public PerforceScm.DescriptorImpl getP4SCM()
public void log(String msg)
public boolean hasAborted()
public void abort()
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2016–2019. All rights reserved.