com.microsoft.tfs.core.checkinpolicies
Class PolicyType

java.lang.Object
  extended by com.microsoft.tfs.core.checkinpolicies.PolicyType

public class PolicyType
extends java.lang.Object

Defines a kind of check-in policy. Policy implementations (classes on disk that implement PolicyInstance) must declare their policy type, and each type is identified by the type ID.

Implementations whose policy types have equal IDs are considered compatible: they should read and write each others' configuration information and evaluate the same rules during check-in.

Policies configured on Team Projects ("defined") indicate the associated policy type so they can be loaded by clients (using the ID to find implementations).

PolicyLoader is responsible for loading implementations given appropriate type information.

Since:
TEE-SDK-10.1
Thread-safety:
immutable

Constructor Summary
PolicyType(java.lang.String id, java.lang.String name, java.lang.String shortDescription, java.lang.String longDescription, java.lang.String installationInstructions)
          Constructs a fully-specified policy type.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 java.lang.String getID()
           
 java.lang.String getInstallationInstructions()
           
 java.lang.String getLongDescription()
           
 java.lang.String getName()
           
 java.lang.String getShortDescription()
           
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolicyType

public PolicyType(java.lang.String id,
                  java.lang.String name,
                  java.lang.String shortDescription,
                  java.lang.String longDescription,
                  java.lang.String installationInstructions)
Constructs a fully-specified policy type.

Parameters:
id - a free-form string that uniquely identifies a kind of check-in policy. All configuration-compatible policy implementations that enforce the same set of check-in rules can be given the same type ID, so they can read each others configuration data. It's a good idea to include some kind of version identifier in a type ID, but it is not required. (must not be null or empty)
name - the name of this policy (e.g. "Work Items"). This text is presented to the user in space-constrained places like lists and tables. (must not be null or empty)
shortDescription - a short description of what this type of checkin policy does (e.g. "Require associated work items."). This text is presented to the user when he chooses a check-in policy type to define for a team project, or configures an existing definition. (must not be null or empty)
longDescription - a longer description of what this type of checkin policy does (e.g. "This policy requires that one or more work items be associated with every check-in."). This text is shown to the user when selecting a policy implementation for definition on a team project. (must not be null)
installationInstructions - instructions on how to install this policy implementation. This is shown to users when this type of policy is defined on a team project, but a client program cannot find an implementation. (must not be null)
Method Detail

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getID

public java.lang.String getID()
Returns:
a string that uniquely identifies a specific type of check-in policy. (never null or empty)
See Also:
PolicyType(String, String, String, String, String)

getName

public java.lang.String getName()
Returns:
the name of the policy (e.g. "Work Items"). (never null or empty)
See Also:
PolicyType(String, String, String, String, String)

getShortDescription

public java.lang.String getShortDescription()
Returns:
a short description of what this type of checkin policy does (e.g. "Require associated work items.") (never null or empty)
See Also:
PolicyType(String, String, String, String, String)

getLongDescription

public java.lang.String getLongDescription()
Returns:
a longer description of what this type of checkin policy does (e.g. "This policy requires that one or more work items be associated with every check-in.") (never null)
See Also:
PolicyType(String, String, String, String, String)

getInstallationInstructions

public java.lang.String getInstallationInstructions()
Returns:
instructions to the end-user on how to install this type of checkin policy. (never null)
See Also:
PolicyType(String, String, String, String, String)


© 2015 Microsoft. All rights reserved.