/* Myrtille: A native HTML4/5 Remote Desktop Protocol client. Copyright(c) 2014-2021 Cedric Coste Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System; namespace Myrtille.Services.Contracts { public interface IConnectionService { /// /// Gets a connection identifier to initiate a connection with Myrtille /// /// /// /// this method is called by the portal mock to acquire a connection identifier for each iframe in the page /// /// Guid GetConnectionId(ConnectionInfo connectionInfo); /// /// Gets the ConnectionInfo by ConnectionId that is passed in the Myrtille Url query string. /// /// The ConnectionId to return ConnectionInfo for. /// ConnectionInfo or returns null if not found. ConnectionInfo GetConnectionInfo(Guid connectionId); /// /// Determines whether the given user is allowed to connect to the given server /// /// the user domain /// the username /// the server /// the vm guid /// /// Provide either ipAddress or vmGuid /// /// True if the user can connect, false if not bool IsUserAllowedToConnectHost(string domain, string userName, string hostIPAddress, Guid vmGuid); /// /// Sets the connection state of a Myrtille session /// /// connection id session - note this will be ignored /// ip address for the session /// the vm guid /// state to set /// /// connectionId is unused, please ensure you set either ipAddress or vmGuid /// /// True if the set was successful, false if not bool SetConnectionState(Guid connectionId, string IPAddress, Guid vmGuid, RemoteSessionState state); /// /// Sets the remote session exit code for the given Ip Address. /// /// The connection id to set the exit code for - note this will be ignored /// ip address for the session /// the vm guid /// The WFreeRdp exit code to set for the remote session - note this will be an integer value if not defined into the enum (the list is not exhaustive!) /// /// connectionId is unused, please ensure you set either ipAddress or vmGuid /// /// True if the exit code was set and false if this failed. bool SetConnectionExitCode(Guid connectionId, string IPAddress, Guid vmGuid, RemoteSessionExitCode exitCode); } }