Add policy.

@param name   the name
@param policy the policy
162549
public void addPolicy(final Enum name, final ExpirationPolicy policy) {
        LOGGER.trace("Adding expiration policy [{}] with name [{}]", policy, name);
        addPolicy(name.name(), policy);
    }
1006806
public void setPolicyAttributes(java.util.Collection<PolicyAttribute> policyAttributes) {
        if (policyAttributes == null) {
            this.policyAttributes = null;
            return;
        }

        this.policyAttributes = new com.amazonaws.internal.SdkInternalList<PolicyAttribute>(policyAttributes);
    }
1327562
@Override
    public void addPolicy(String sec, String ptype, List<String> rule) {
        throw new Error("not implemented");
    }
59933
public AcceptableUsagePolicyStatus addProperty(final String name, final Object value) {
        this.properties.put(name, value);
        return this;
    }
1216365
public void setPolicies(java.util.Collection<String> policies) {
        if (policies == null) {
            this.policies = null;
            return;
        }

        this.policies = new java.util.ArrayList<String>(policies);
    }
807786
public static void setPolicy(Policy policy) {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Setting Hadoop security policy");
    }
    Policy.setPolicy(policy);
  }
200635
public void addFilter(String name, String value)
    {
        if(this.filters == null)
            this.filters = new HashMap<String,String>();
        this.filters.put(name, value);
    }
760071
public final void setUndoManagerPolicy(UndoManagerPolicy policy) throws NullPointerException {
		if (policy == null) {
			throw new NullPointerException("The policy must not be null.");
		}
		
		if (this.policy == policy) {
			return;
		}

		final UndoManagerPolicy oldPolicy = this.policy;
		this.policy = policy;
		
		if (oldPolicy == UndoManagerPolicy.DEFAULT) {
			this.textComponent.removePropertyChangeListener("editable", this);
			this.textComponent.removePropertyChangeListener("enabled", this);
		}

		if (this.policy == UndoManagerPolicy.DEFAULT) {
			this.textComponent.addPropertyChangeListener("editable", this);
			this.textComponent.addPropertyChangeListener("enabled", this);
		}

		handleUndoManagerPolicy();
	}
783305
def set_policy(self, policy, headers=None):
        
        response = self.connection.make_request('PUT', self.name,
                                                data=policy,
                                                query_args='policy',
                                                headers=headers)
        body = response.read()
        if response.status >= 200 and response.status <= 204:
            return True
        else:
            raise self.connection.provider.storage_response_error(
                response.status, response.reason, body)
1137447
public function addRule($name, callable $rule)
    {
        if (isset($this[self::rule($name)])) {
            throw new \RuntimeException("rule '$name' already exists'");
        }
        $this[self::rule($name)] = $this->protect($rule);
    }
877839
def add_policy(self, scaling_group, name, policy_type, cooldown,
            change=None, is_percent=False, desired_capacity=None, args=None):
        
        uri = "/%s/%s/policies" % (self.uri_base, utils.get_id(scaling_group))
        body = self._create_policy_body(name, policy_type, cooldown,
                change=change, is_percent=is_percent,
                desired_capacity=desired_capacity, args=args)
        # "body" needs to be a list
        body = [body]
        resp, resp_body = self.api.method_post(uri, body=body)
        pol_info = resp_body.get("policies")[0]
        return AutoScalePolicy(self, pol_info, scaling_group)
108479
public void addState(String name, Runnable enter)
    {
        addState(name, (S) new AdhocState(name, enter, null, null));
    }
635723
@Override
    public boolean deletePolicy(String name) throws PolicyIndexException {
        log.debug("Deleting document: " + name);

        DbXmlManager.writeLock.lock();
        try {
            m_dbXmlManager.container.deleteDocument(name, m_dbXmlManager.updateContext);
            setLastUpdate(System.currentTimeMillis());
        } catch (XmlException xe) {
            // safe delete - only warn if not found
            if (xe.getDbError() == XmlException.DOCUMENT_NOT_FOUND){
                log.warn("Error deleting document: " + name + " - document does not exist");
            } else {
                throw new PolicyIndexException("Error deleting document: " + name + xe.getMessage(), xe);
            }
        } finally {
            DbXmlManager.writeLock.unlock();
        }
        return true;
    }
221429
void addParameter(String name, String value) {
        params.add(new Parameter(name, value));
    }
1094485
public Rule addRule(String name, Node condition) {
		Rule rule = new Rule(name, condition);
		rules.put(name, rule);
		return rule;
	}
1183176
def add_stream(self, policy):
        
        _srtp_assert(lib.srtp_add_stream(self._srtp[0], policy._policy))
777716
@NonNull
  public RequestCreator memoryPolicy(@NonNull MemoryPolicy policy,
      @NonNull MemoryPolicy... additional) {
    data.memoryPolicy(policy, additional);
    return this;
  }