org.xiruss.repository.server
Class OnSnapShotResolutionPolicyBase

java.lang.Object
  extended by org.xiruss.repository.server.RepositoryObjectBase
      extended by org.xiruss.repository.server.ResolutionPolicyBase
          extended by org.xiruss.repository.server.OnSnapShotResolutionPolicyBase
All Implemented Interfaces:
java.lang.Comparable, OnSnapshotResolutionPolicy, RepositoryObject, ResolutionPolicy

public class OnSnapShotResolutionPolicyBase
extends ResolutionPolicyBase
implements OnSnapshotResolutionPolicy

Resolution policy that resolves to the latest version visible on the current snapshot, if any. This policy has no construction-time parameters.


Field Summary
 
Fields inherited from class org.xiruss.repository.server.ResolutionPolicyBase
params
 
Fields inherited from class org.xiruss.repository.server.RepositoryObjectBase
id, name, objectTypeConstant, properties, rep
 
Constructor Summary
OnSnapShotResolutionPolicyBase()
           
 
Method Summary
 Version applyPolicy(Version sourceVersion, Resource targetResource, Snapshot onSnapshot)
          Applies a policy and returns a collection of zero or more result versions.
 java.lang.String getPolicyTypeName()
          Returns the string "onSnapshot".
 
Methods inherited from class org.xiruss.repository.server.ResolutionPolicyBase
getParameter, getParams, initialize, setParameter
 
Methods inherited from class org.xiruss.repository.server.RepositoryObjectBase
accept, compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, getType, hasProperty, initialize, initialize, isNull, setId, setName, setProperties, setProperty, setRepository, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xiruss.snapcm.api.ResolutionPolicy
getParameter, getParams, initialize, setParameter
 
Methods inherited from interface org.xiruss.snapcm.api.RepositoryObject
accept, compareTo, getId, getName, getProperties, getProperty, getPropertyNames, getRepository, getType, hasProperty, initialize, isNull, setId, setName, setProperty, toString
 

Constructor Detail

OnSnapShotResolutionPolicyBase

public OnSnapShotResolutionPolicyBase()
Method Detail

applyPolicy

public Version applyPolicy(Version sourceVersion,
                           Resource targetResource,
                           Snapshot onSnapshot)
                    throws ResolutionPolicyException
Description copied from interface: ResolutionPolicy
Applies a policy and returns a collection of zero or more result versions.

Specified by:
applyPolicy in interface ResolutionPolicy
Specified by:
applyPolicy in class ResolutionPolicyBase
Parameters:
sourceVersion - The version the dependency is from
targetResource - The resource the depencency targets
onSnapshot - The snapshot that establishes the visibility context within which the policy is resolved.
Throws:
ResolutionPolicyException

getPolicyTypeName

public java.lang.String getPolicyTypeName()
Returns the string "onSnapshot". This value is reserved by the SnapCM implementation and is a special case. All other policy types must return a repository-unique policy type name, i.e., the class name. FIXME: Not sure what my original intent was here other than providing a string-based mechanism for doing mapping from resolution policy types to business logic. Not sure we really need this given we can do instanceof.

Specified by:
getPolicyTypeName in interface ResolutionPolicy
Overrides:
getPolicyTypeName in class ResolutionPolicyBase
Returns: