@Test public void testEffectivePolicy() { assertEquals( UPDATE_POLICY_ALWAYS, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_ALWAYS, UPDATE_POLICY_DAILY ) ); assertEquals( UPDATE_POLICY_ALWAYS, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_ALWAYS, UPDATE_POLICY_NEVER ) ); assertEquals( UPDATE_POLICY_DAILY, analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_DAILY, UPDATE_POLICY_NEVER ) ); assertEquals( UPDATE_POLICY_INTERVAL + ":60", analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_DAILY, UPDATE_POLICY_INTERVAL + ":60" ) ); assertEquals( UPDATE_POLICY_INTERVAL + ":60", analyzer.getEffectiveUpdatePolicy( session, UPDATE_POLICY_INTERVAL + ":100", UPDATE_POLICY_INTERVAL + ":60" ) ); }
public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; }
DefaultUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer, Service { public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } }
DefaultUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer, Service { public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } DefaultUpdatePolicyAnalyzer(); @Inject  DefaultUpdatePolicyAnalyzer( LoggerFactory loggerFactory ); }
DefaultUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer, Service { public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } DefaultUpdatePolicyAnalyzer(); @Inject  DefaultUpdatePolicyAnalyzer( LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultUpdatePolicyAnalyzer setLoggerFactory( LoggerFactory loggerFactory ); String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ); boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy ); }
DefaultUpdatePolicyAnalyzer implements UpdatePolicyAnalyzer, Service { public String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ) { return ordinalOfUpdatePolicy( policy1 ) < ordinalOfUpdatePolicy( policy2 ) ? policy1 : policy2; } DefaultUpdatePolicyAnalyzer(); @Inject  DefaultUpdatePolicyAnalyzer( LoggerFactory loggerFactory ); void initService( ServiceLocator locator ); DefaultUpdatePolicyAnalyzer setLoggerFactory( LoggerFactory loggerFactory ); String getEffectiveUpdatePolicy( RepositorySystemSession session, String policy1, String policy2 ); boolean isUpdatedRequired( RepositorySystemSession session, long lastModified, String policy );  }