01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.ivy.plugins.latest;
19:
20: import java.util.Date;
21: import java.util.List;
22:
23: public interface LatestStrategy {
24: /**
25: * Finds the latest artifact among the given artifacts info. The definition of 'latest' depends
26: * on the strategy itself. Given artifacts info are all good candidate. If the given date is not
27: * null, then found artifact should not be later than this date.
28: *
29: * @param infos
30: * @param date
31: * @return the latest artifact among the given ones.
32: */
33: ArtifactInfo findLatest(ArtifactInfo[] infos, Date date);
34:
35: /**
36: * Sorts the given artifacts info from the oldest one to the latest one. The definition of
37: * 'latest' depends on the strategy itself. Given artifacts info are all good candidate.
38: *
39: * @param infos
40: * @return
41: */
42: List sort(ArtifactInfo[] infos);
43:
44: String getName();
45: }
|