public ScanAndSignMessage( OperationRequestType operationRequestType, Guid packageValidationId, Uri blobUri) { if (operationRequestType == OperationRequestType.Sign) { throw new ArgumentException($"{nameof(OperationRequestType.Sign)} messages require a V3 service index URL and a list of owners"); } OperationRequestType = operationRequestType; PackageValidationId = packageValidationId; BlobUri = blobUri ?? throw new ArgumentNullException(nameof(blobUri)); }
public ScanAndSignMessage( OperationRequestType operationRequestType, Guid packageValidationId, Uri blobUri, string v3ServiceIndexUrl, IReadOnlyList <string> owners) { OperationRequestType = operationRequestType; PackageValidationId = packageValidationId; BlobUri = blobUri ?? throw new ArgumentNullException(nameof(blobUri)); if (operationRequestType == OperationRequestType.Sign) { V3ServiceIndexUrl = v3ServiceIndexUrl ?? throw new ArgumentNullException(nameof(v3ServiceIndexUrl)); Owners = owners ?? throw new ArgumentNullException(nameof(owners)); } }
public object Invoke(ObjectName name, string operationName, object[] arguments) { var request = new OperationRequestType { Input = arguments.Select(x => new ParameterType(null, x)).ToArray(), name = operationName, Signature = null }; var responseMessage = _soapClient.BuildMessage() .WithAction(Schema.InvokeAction) .WithSelectors(name.CreateSelectorSet()) .WithResourceUri(Schema.DynamicMBeanResourceUri) .AddBody(new InvokeMessage(request)) .SendAndGetResponse(); var payload = responseMessage.GetPayload <InvokeResponseMessage>(); return(payload.ManagedResourceOperationResult.Deserialize()); }
public object Invoke(ObjectName name, string operationName, object[] arguments) { var request = new OperationRequestType { Input = arguments.Select(x => new ParameterType(null, x)).ToArray(), name = operationName, Signature = null }; var responseMessage = _soapClient.BuildMessage() .WithAction(Schema.InvokeAction) .WithSelectors(name.CreateSelectorSet()) .WithResourceUri(Schema.DynamicMBeanResourceUri) .AddBody(new InvokeMessage(request)) .SendAndGetResponse(); var payload = responseMessage.GetPayload<InvokeResponseMessage>(); return payload.ManagedResourceOperationResult.Deserialize(); }