public Task <ServerResponse> New(Action <PolicyTarget> policy, Action <PolicyCharacteristics> characteristics, Action <VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var characteristicsImpl = new PolicyCharacteristicsImpl(); characteristics(characteristicsImpl); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo( string.Format("Sent request to RabbitMQ server to create a new policy '{0}' on virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return(base.Put(url, characteristicsImpl, cancellationToken).Response <ServerResponse>(cancellationToken)); }
public void Targeting(Action <PolicyTarget> target) { var impl = new PolicyTargetImpl(); target(impl); _vhost = impl.VirtualHostName; }
public Task<ServerResponse> Delete(Action<PolicyTarget> policy, Action<VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo(string.Format("Sent request to RabbitMQ server to delete policy '{0}' from virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return base.Delete(url, cancellationToken).Response<ServerResponse>(cancellationToken); }
public Task <ServerResponse> Delete(Action <PolicyTarget> policy, Action <VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo(string.Format("Sent request to RabbitMQ server to delete policy '{0}' from virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return(base.Delete(url, cancellationToken).Response <ServerResponse>(cancellationToken)); }
public Task<Policy> Get(Action<PolicyTarget> policy, Action<VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo( string.Format( "Sent request to RabbitMQ server to return policy information pertaining to policy '{0}' belonging to virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return base.Get(url, cancellationToken).As<Policy>(cancellationToken); }
public Task <Policy> Get(Action <PolicyTarget> policy, Action <VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo( string.Format( "Sent request to RabbitMQ server to return policy information pertaining to policy '{0}' belonging to virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return(base.Get(url, cancellationToken).As <Policy>(cancellationToken)); }
public Task<ServerResponse> New(Action<PolicyTarget> policy, Action<PolicyCharacteristics> characteristics, Action<VirtualHostTarget> virtualHost, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.RequestCanceled(LogInfo); var characteristicsImpl = new PolicyCharacteristicsImpl(); characteristics(characteristicsImpl); var policyTargetImpl = new PolicyTargetImpl(); policy(policyTargetImpl); var virtualHostTargetImpl = new VirtualHostTargetImpl(); virtualHost(virtualHostTargetImpl); LogInfo( string.Format("Sent request to RabbitMQ server to create a new policy '{0}' on virtual host '{1}'.", policyTargetImpl.Target, virtualHostTargetImpl.Target)); string url = string.Format("api/policies/{0}/{1}", virtualHostTargetImpl.Target.SanitizeVirtualHostName(), policyTargetImpl.Target); return base.Put(url, characteristicsImpl, cancellationToken).Response<ServerResponse>(cancellationToken); }