[
https://issues.apache.org/jira/browse/CLOUDSTACK-10363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16459747#comment-16459747
]
ASF subversion and git services commented on CLOUDSTACK-10363:
--------------------------------------------------------------
Commit 2c681b8c5f253ae6e78314ac6f5bc3b1863bec4c in cloudstack's branch
refs/heads/master from [~BruceKuiLIU]
[ https://gitbox.apache.org/repos/asf?p=cloudstack.git;h=2c681b8 ]
CLOUDSTACK-10363: refactor the "getXXX" and "listXXX" method names to "findXXX"
(#2599)
These three methods are not direct getter or list.
They try to find the target objects with the related arguments.
So that, renaming them as "findXXX" should be more intuitive.
> Inconsistent "getXXX" and "listXXX" method names.
> -------------------------------------------------
>
> Key: CLOUDSTACK-10363
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-10363
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Reporter: KuiLIU
> Priority: Major
>
> The following methods are not direct getter or list.
> They try to find the target objects with the related arguments.
> So that, renaming them as "findXXX" should be more intuitive.
> {code:java}
> //cloudstack/plugins/network-elements/ovs/src/main/java/com/cloud/network/ovs/dao/OvsTunnelInterfaceDaoImpl.java
> @Override
> public OvsTunnelInterfaceVO getByHostAndLabel(long hostId, String label) {
> SearchCriteria<OvsTunnelInterfaceVO> sc = hostAndLabelSearch.create();
> sc.setParameters("host_id", hostId);
> sc.setParameters("label", label);
> return findOneBy(sc);
> }
> //cloudstack/services/secondary-storage/controller/src/main/java/org/apache/cloudstack/secondarystorage/PremiumSecondaryStorageManagerImpl.java
> private List<CommandExecLogVO> listActiveCommands(long dcId, Date
> cutTime) {
> SearchCriteria<CommandExecLogVO> sc = activeCommandSearch.create();
> sc.setParameters("created", cutTime);
> sc.setJoinParameters("hostSearch", "dc", dcId);
> sc.setJoinParameters("hostSearch", "status", Status.Up);
> return _cmdExecLogDao.search(sc, null);
> }
> //cloudstack/framework/jobs/src/main/java/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
> private AsyncJobDispatcher getWakeupDispatcher(AsyncJob job) {
> if (_jobDispatchers != null) {
> List<AsyncJobJoinMapVO> joinRecords =
> _joinMapDao.listJoinRecords(job.getId());
> if (joinRecords.size() > 0) {
> AsyncJobJoinMapVO joinRecord = joinRecords.get(0);
> for (AsyncJobDispatcher dispatcher : _jobDispatchers) {
> if
> (dispatcher.getName().equals(joinRecord.getWakeupDispatcher()))
> return dispatcher;
> }
> } else {
> s_logger.warn("job-" + job.getId() + " is scheduled for
> wakeup run, but there is no joining info anymore");
> }
> }
> return null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)