Enumeration DirectorySessionInterfaceSignal

The DirectorySessionInterfaceSignal lists all the signals that may be sent by the DirectorySessionInterface.

These signals are emitted by the DirectorySessionInterface when

  • The authentication mechanism has succeeded (LoginSuccess).
  • The authentication mechanism has failed (LoginFailed).
  • The DirectorySessionInterface has been disconnected (LoggedOff).
  • The build list available from the directory has been refreshed (after a call to refreshAccessRightsInfo) (AccessRightsRefreshed).
  • The build list available from the directory could not be refreshed (after a call to refreshAccessRightsInfo) (AccessRightsRefreshFailed).
/** 
* Sample to illustrate the DirectorySessionInterface signals handling.
*/
import { DirectorySessionInterface, DirectorySessionInterfaceSignal, tListenerCallback, ConnectionData, InfiniteEvent } from 'generated/documentation/appinfiniteapi';

// directory session has been created previously
let lDirectorySession : DirectorySessionInterface;
// not relevant at the moment
let onLoginFailed : tListenerCallback;
// not relevant at the moment
let onSignOut : tListenerCallback;
// not relevant at the moment
let onRefreshAccessRightsFailed : tListenerCallback;

// parse the build list and user infos
const onLoginSuccess = (pEvent: InfiniteEvent, _pCallbackData: Object | undefined) : void =>
{
// Get the Attachment
const lAttachments: ConnectionData = pEvent.attachments;

// iterate over project and output project info
for (const lProjectId in lAttachments.projects) {
const lProjectInfo = lAttachments.projects[lProjectId];
console.log('project name : ' + lProjectInfo.projectname + ' project id :' + lProjectInfo.projectid);
console.log(JSON.stringify(lProjectInfo.builds));
}
// output user infos
console.log('user logged in : ' + lAttachments.user.name);
console.log('user teams : ' + lAttachments.teams);
}

// connect to signals
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoginSuccess, onLoginSuccess);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoginFailed, onLoginFailed);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.LoggedOff, onSignOut);
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.AccessRightsRefreshed, onLoginSuccess)
lDirectorySession.addEventListener(DirectorySessionInterfaceSignal.AccessRightsRefreshFailed, onRefreshAccessRightsFailed);

Please refer to [DirectorySessionInterface](../interfaces/DirectorySessionInterface.html) for more information.
Events

See

DirectorySessionInterface

Enumeration Members

AccessRightsRefreshFailed: "accessRightsRefreshFailed"

Signal sent by the DirectorySessionInterface when the refresh access rights procedure has failed after a call to refreshAccessRightsInfo.

The attachment for events of this type is an object that contains the field message ( typescript { "message": "description of the error"}).

AccessRightsRefreshed: "accessRightsRefreshed"

Signal sent by the DirectorySessionInterface when the list of available builds and projects have been refreshed i.e. after a call to refreshAccessRightsInfo.

The attachment for events of this type is a ConnectionData.

LoggedOff: "loggedOff"

Signal sent by the DirectorySessionInterface when the user has effectively logged off i.e. after a call to closeDirectorySession.

No attachment for events of this type.

LoginFailed: "loginFailed"

Signal sent by the DirectorySessionInterface when the login procedure has failed after a call to getPopupBasedAuthenticationUrl.

The attachment for events of this type is an object that contains the field message ( typescript { "message": "description of the error"}).

LoginSuccess: "loginSuccess"

Signal sent by the DirectorySessionInterface when the user has been logged in after a call to getPopupBasedAuthenticationUrl.

The attachment for events of this type is a ConnectionData.