Package hudson.scm.api.session
Class APISession
java.lang.Object
hudson.scm.api.session.APISession
- All Implemented Interfaces:
ISession,AutoCloseable
This class represents an Integration Point to a server. It also contains a
Session object
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose()static ISessioncreate(IntegrityConfigurable settings) Creates an authenticated API Session against the Integrity Serverstatic ISessionCreates a local integration pointfindOAuthCredentialById(String credentialsId) Returns the Integrity User for this APISessionvoidping()voidcom.mks.api.response.ResponserunCommand(com.mks.api.Command cmd) This function executes a generic API/CLI Commandcom.mks.api.response.ResponserunCommandAs(com.mks.api.Command cmd, String impersonateUser) This function executes a generic API/CLI Command impersonating another usercom.mks.api.response.ResponserunCommandWithInterim(com.mks.api.Command cmd) This function executes a generic API/CLI Command with interimbooleanTerminate the API Session and Integration PointtoString()
-
Field Details
-
VERSION
- See Also:
-
MAJOR_VERSION
public static final int MAJOR_VERSION- See Also:
-
MINOR_VERSION
public static final int MINOR_VERSION- See Also:
-
PLUGIN_VERSION_PREFIX
- See Also:
-
-
Method Details
-
create
Creates an authenticated API Session against the Integrity Server- Returns:
- An authenticated API Session
-
createLocalIntegrationPoint
Creates a local integration point- Parameters:
settings-- Returns:
-
findOAuthCredentialById
-
ping
public void ping() throws com.mks.api.response.APIException -
runCommand
public com.mks.api.response.Response runCommand(com.mks.api.Command cmd) throws com.mks.api.response.APIException This function executes a generic API/CLI Command- Specified by:
runCommandin interfaceISession- Parameters:
cmd- Integrity API Command Object representing a CLI command- Returns:
- Integrity API Response Object
- Throws:
com.mks.api.response.APIException
-
runCommandWithInterim
public com.mks.api.response.Response runCommandWithInterim(com.mks.api.Command cmd) throws com.mks.api.response.APIException This function executes a generic API/CLI Command with interim- Specified by:
runCommandWithInterimin interfaceISession- Parameters:
cmd- Integrity API Command Object representing a CLI command- Returns:
- Integrity API Response Object
- Throws:
com.mks.api.response.APIException
-
runCommandAs
public com.mks.api.response.Response runCommandAs(com.mks.api.Command cmd, String impersonateUser) throws com.mks.api.response.APIException This function executes a generic API/CLI Command impersonating another user- Parameters:
cmd- Integrity API Command Object representing a CLI commandimpersonateUser- The user to impersonate- Returns:
- Integrity API Response Object
- Throws:
com.mks.api.response.APIException
-
refreshAPISession
public void refreshAPISession() throws com.mks.api.response.APIException- Specified by:
refreshAPISessionin interfaceISession- Throws:
com.mks.api.response.APIException
-
terminate
public boolean terminate()Terminate the API Session and Integration Point -
getUserName
Returns the Integrity User for this APISession- Specified by:
getUserNamein interfaceISession- Returns:
-
toString
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
checkifAlive
public void checkifAlive() throws com.mks.api.response.APIException- Specified by:
checkifAlivein interfaceISession- Throws:
com.mks.api.response.APIException
-