Exemple #1
0
        /// <summary>
        /// Creates resource detail and inserts it into the manifest.
        /// </summary>
        /// <param name="resources">The resources.</param>
        /// <param name="manifest">The manifest.</param>
        internal override void AddToManifest(Collection <VirtualResource> resources, SystemManifest manifest)
        {
            // There is one Load Tester per VM, so there should only be one
            // resource embedded in this manifest.
            var resource = resources.First();

            // First determine if the resource already exists in the Resource collection.  If not, then
            // have VirtualResource create it, then update it with other data and add it to the list.
            var detail = manifest.Resources.GetResource <LoadTesterDetail>(resource.VirtualResourceId);

            if (detail == null)
            {
                detail = CreateDetail(resource);
                detail.CommandPortOffset = 40000;

                manifest.Resources.Add(detail);
            }

            // Use the system settings Administrator credentials for the AdminWorker
            var userCredential = new OfficeWorkerCredential();

            userCredential.UserName           = GlobalSettings.Items[Setting.DomainAdminUserName];
            userCredential.Password           = GlobalSettings.Items[Setting.DomainAdminPassword];
            userCredential.Domain             = GlobalSettings.Items[Setting.Domain];
            userCredential.Port               = detail.CommandPortOffset;
            userCredential.ResourceInstanceId = SystemManifestAgent.CreateUniqueId(userCredential.UserName);

            detail.UserCredentials.Add(userCredential);
        }
Exemple #2
0
        internal override OfficeWorkerCredential AddCredential(VirtualResource resource, OfficeWorkerDetail detail)
        {
            SolutionTester tester = resource as SolutionTester;

            OfficeWorkerCredential credential = null;

            switch (tester.AccountType)
            {
            case SolutionTesterCredentialType.AccountPool:
                credential = ManifestAgent.UserAccounts.NextUserCredential(((OfficeWorker)resource).UserPool);
                credential.ResourceInstanceId = credential.UserName;
                //credential.ResourceInstanceId = SystemManifestAgent.CreateUniqueId(credential.UserName);
                break;

            case SolutionTesterCredentialType.DefaultDesktop:
                credential                    = new OfficeWorkerCredential();
                credential.Domain             = Environment.UserDomainName;
                credential.UserName           = Environment.UserName;
                credential.Password           = string.Empty;
                credential.ResourceInstanceId = SystemManifestAgent.CreateUniqueId(Environment.UserName);
                break;

            case SolutionTesterCredentialType.ManuallyEntered:
                credential                    = new OfficeWorkerCredential();
                credential.Domain             = tester.Domain;
                credential.UserName           = tester.UserName;
                credential.Password           = tester.Password;
                credential.ResourceInstanceId = SystemManifestAgent.CreateUniqueId(tester.UserName);
                break;
            }

            return(credential);
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ResourceMap"/> class.
        /// </summary>
        /// <param name="agent">The system manifest data.</param>
        public ResourceMap(SystemManifestAgent agent)
            : base(agent, ElementType.Workers, "Resources")
        {
            Hosts = new Collection <ResourceHost>();
            MapElement.ElementSubtype = "VirtualResource";

            _resourcePool = new ManagedMachineResourcePool(agent);
        }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SolutionTesterDetailBuilder"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="resourcePacker">The resource packer.</param>
 public SolutionTesterDetailBuilder(SystemManifestAgent config, VirtualResourcePacker resourcePacker)
     : base(config, resourcePacker, VirtualResourceType.SolutionTester)
 {
 }
Exemple #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionMapObject"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="type">The type.</param>
 /// <param name="elementName">Name of the element.</param>
 public SessionMapObject(SystemManifestAgent config, ElementType type, string elementName)
 {
     Configuration = config;
     MapElement    = new SessionMapElement(elementName, type);
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionMapObject"/> class.
 /// </summary>
 /// <param name="config">The system manifest information.</param>
 /// <param name="type">The type of element, used by the <see cref="SessionMapElement"/>.</param>
 public SessionMapObject(SystemManifestAgent config, ElementType type)
 {
     Configuration = config;
     MapElement    = new SessionMapElement(type.ToString(), type);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EventLogCollectorDetailBuilder"/> class.
 /// </summary>
 /// <param name="config">The builder.</param>
 /// <param name="resourcePacker">The resource packer.</param>
 public EventLogCollectorDetailBuilder(SystemManifestAgent config, VirtualResourcePacker resourcePacker)
     : base(config, resourcePacker, VirtualResourceType.EventLogCollector)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RemotePrintQueueMap"/> class
 /// </summary>
 /// <param name="config">The system manifest data.</param>
 public RemotePrintQueueMap(SystemManifestAgent config)
     : base(config, ElementType.RemotePrintQueues)
 {
     RemotePrintQueueElements  = new Collection <RemotePrintQueueElement>();
     MapElement.ElementSubtype = "Remote Print Queue";
 }
Exemple #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DetailBuilderBase"/> class.
 /// </summary>
 /// <param name="config">The builder.</param>
 /// <param name="packer">The packer.</param>
 /// <param name="type">The type.</param>
 public DetailBuilderBase(SystemManifestAgent config, VirtualResourcePacker packer, VirtualResourceType type)
 {
     ManifestAgent  = config;
     ResourcePacker = packer;
     ResourceType   = type;
 }
Exemple #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssetMap"/> class.
 /// </summary>
 /// <param name="config">The system manifest data.</param>
 public AssetMap(SystemManifestAgent config)
     : base(config, ElementType.Assets)
 {
     Hosts = new Collection <AssetHost>();
     MapElement.ElementSubtype = "Asset";
 }
Exemple #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OfficeWorkerDetailBuilder"/> class.
 /// </summary>
 /// <param name="config">The builder.</param>
 /// <param name="resourcePacker">The resource packer.</param>
 /// <param name="resourceType">Type of the resource.</param>
 public OfficeWorkerDetailBuilder(SystemManifestAgent config, VirtualResourcePacker resourcePacker, VirtualResourceType resourceType)
     : base(config, resourcePacker, resourceType)
 {
 }
Exemple #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MachineReservationDetailBuilder"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="resourcePacker">The resource packer.</param>
 public MachineReservationDetailBuilder(SystemManifestAgent config, VirtualResourcePacker resourcePacker)
     : base(config, resourcePacker, VirtualResourceType.MachineReservation)
 {
 }
        internal static DetailBuilderBase CreateDetailBuilder(VirtualResourceType resourceType, SystemManifestAgent systemManifestAgent, VirtualResourcePacker packer)
        {
            string className = "{0}.{1}DetailBuilder".FormatWith(typeof(SystemManifestAgent).Namespace, resourceType);

            return(Activator.CreateInstance(Type.GetType(className), systemManifestAgent, packer) as DetailBuilderBase);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AdminWorkerDetailBuilder"/> class.
 /// </summary>
 /// <param name="config">The builder.</param>
 /// <param name="resourcePacker">The resource packer.</param>
 public AdminWorkerDetailBuilder(SystemManifestAgent config, VirtualResourcePacker resourcePacker)
     : base(config, resourcePacker, VirtualResourceType.AdminWorker)
 {
 }
 public ManagedMachineResourcePool(SystemManifestAgent agent)
     : base()
 {
     _manifestAgent = agent;
 }