com.microsoft.tfs.core.pendingcheckin
Class StandardPendingCheckinPolicies

java.lang.Object
  extended by com.microsoft.tfs.core.pendingcheckin.StandardPendingCheckinPolicies
All Implemented Interfaces:
PendingCheckinPolicies

public class StandardPendingCheckinPolicies
extends java.lang.Object
implements PendingCheckinPolicies

Standard implementation of PendingCheckinPolicies that uses a PolicyEvaluator to contain and evaluate policies. A constructor exists to allow you to specify an existing PolicyEvaluator.

Since:
TEE-SDK-10.1
Thread-safety:
thread-safe

Constructor Summary
StandardPendingCheckinPolicies(PendingCheckin pendingCheckin, VersionControlClient client, PolicyEvaluator evaluator)
          Constructs a @ StandardPendingCheckinPolicies} for the given pending checkin and client, using an existing PolicyEvaluator and the PolicyLoader it was configured with.
 
Method Summary
 PolicyFailure[] evaluate(PolicyContext policyContext)
          Evaluates checkin policies.
 PolicyEvaluatorState getPolicyEvaluatorState()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardPendingCheckinPolicies

public StandardPendingCheckinPolicies(PendingCheckin pendingCheckin,
                                      VersionControlClient client,
                                      PolicyEvaluator evaluator)
Constructs a @ StandardPendingCheckinPolicies} for the given pending checkin and client, using an existing PolicyEvaluator and the PolicyLoader it was configured with. The evalutor's PolicyEvaluator.setPendingCheckin(PendingCheckin) method is called immediately to configure the checkin, then other methods are called later by this object.

This construction option is available so clients can manage a single evaluator object that will be used for all evaluation tasks, simplifying event management and increasing the efficiency of policy instance caching.

Parameters:
pendingCheckin - the pending checkin (must not be null)
client - the version control client in use (must not be null)
evaluator - the existing policy evaluator object to use (may be null)
Method Detail

evaluate

public PolicyFailure[] evaluate(PolicyContext policyContext)
                         throws PolicyEvaluationCancelledException
Evaluates checkin policies.

Specified by:
evaluate in interface PendingCheckinPolicies
Parameters:
policyContext - contextual settings that may include information about the user interface, etc. (must not be null)
Returns:
any failures detected.
Throws:
PolicyEvaluationCancelledException - if the user canceled the policy evaluation.

getPolicyEvaluatorState

public PolicyEvaluatorState getPolicyEvaluatorState()

Specified by:
getPolicyEvaluatorState in interface PendingCheckinPolicies
Returns:
the state of a policy evaluator.


© 2015 Microsoft. All rights reserved.