Skip to content

Commit 97f8c52

Browse files
author
Edison Su
committed
merge object_store
2 parents 4a26067 + 5f28dcc commit 97f8c52

586 files changed

Lines changed: 38653 additions & 26348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agent/src/com/cloud/agent/AgentShell.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public class AgentShell implements IAgentShell, Daemon {
8282
private int _pingRetries;
8383
private final List<Agent> _agents = new ArrayList<Agent>();
8484

85+
8586
public AgentShell() {
8687
}
8788

api/src/com/cloud/agent/api/Answer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class Answer extends Command {
2323
protected String details;
2424

2525
protected Answer() {
26+
this(null);
2627
}
2728

2829
public Answer(Command command) {

engine/storage/src/org/apache/cloudstack/storage/command/CopyTemplateToPrimaryStorageAnswer.java renamed to api/src/com/cloud/agent/api/storage/CopyTemplateToPrimaryStorageAnswer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package com.cloud.agent.api.storage;
12
// Licensed to the Apache Software Foundation (ASF) under one
23
// or more contributor license agreements. See the NOTICE file
34
// distributed with this work for additional information

core/src/com/cloud/agent/api/storage/DeleteVolumeCommand.java renamed to api/src/com/cloud/agent/api/storage/PasswordAuth.java

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,24 @@
1616
// under the License.
1717
package com.cloud.agent.api.storage;
1818

19-
public class DeleteVolumeCommand extends ssCommand {
20-
private String volumePath;
19+
/**
20+
* Password authentication
21+
*/
22+
public class PasswordAuth {
2123

22-
public DeleteVolumeCommand() {
23-
}
24+
String userName;
25+
String password;
26+
public PasswordAuth() {
2427

25-
public DeleteVolumeCommand(String secUrl, String volumePath) {
26-
this.setSecUrl(secUrl);
27-
this.volumePath = volumePath;
2828
}
29-
30-
@Override
31-
public boolean executeInSequence() {
32-
return true;
29+
public PasswordAuth(String user, String password) {
30+
this.userName = user;
31+
this.password = password;
32+
}
33+
public String getUserName() {
34+
return userName;
35+
}
36+
public String getPassword() {
37+
return password;
3338
}
34-
35-
public String getVolumePath() {
36-
return volumePath;
37-
}
3839
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package com.cloud.agent.api.storage;
18+
19+
import java.net.URI;
20+
21+
/**
22+
* Download Proxy
23+
*/
24+
public class Proxy {
25+
private String _host;
26+
private int _port;
27+
private String _userName;
28+
private String _password;
29+
30+
public Proxy() {
31+
32+
}
33+
34+
public Proxy(String host, int port, String userName, String password) {
35+
this._host = host;
36+
this._port = port;
37+
this._userName = userName;
38+
this._password = password;
39+
}
40+
41+
public Proxy(URI uri) {
42+
this._host = uri.getHost();
43+
this._port = uri.getPort() == -1 ? 3128 : uri.getPort();
44+
String userInfo = uri.getUserInfo();
45+
if (userInfo != null) {
46+
String[] tokens = userInfo.split(":");
47+
if (tokens.length == 1) {
48+
this._userName = userInfo;
49+
this._password = "";
50+
} else if (tokens.length == 2) {
51+
this._userName = tokens[0];
52+
this._password = tokens[1];
53+
}
54+
}
55+
}
56+
57+
public String getHost() {
58+
return _host;
59+
}
60+
61+
public int getPort() {
62+
return _port;
63+
}
64+
65+
public String getUserName() {
66+
return _userName;
67+
}
68+
69+
public String getPassword() {
70+
return _password;
71+
}
72+
}

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataObjectType.java renamed to api/src/com/cloud/agent/api/to/DataObjectType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.engine.subsystem.api.storage;
19+
package com.cloud.agent.api.to;
2020

2121
public enum DataObjectType {
2222
VOLUME,

engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageDataStoreProvider.java renamed to api/src/com/cloud/agent/api/to/DataStoreTO.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.engine.subsystem.api.storage;
19+
package com.cloud.agent.api.to;
2020

21+
import com.cloud.storage.DataStoreRole;
2122

22-
public interface ImageDataStoreProvider extends DataStoreProvider {
2323

24+
public interface DataStoreTO {
25+
public DataStoreRole getRole();
2426
}

engine/storage/imagemotion/src/org/apache/cloudstack/storage/image/motion/ImageMotionStrategy.java renamed to api/src/com/cloud/agent/api/to/DataTO.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.storage.image.motion;
19+
package com.cloud.agent.api.to;
2020

21-
import org.apache.cloudstack.storage.motion.DataMotionStrategy;
21+
public interface DataTO {
22+
public DataObjectType getObjectType();
23+
public DataStoreTO getDataStore();
24+
/**
25+
* @return
26+
*/
27+
String getPath();
2228

23-
public interface ImageMotionStrategy extends DataMotionStrategy {
29+
long getId();
2430
}

engine/api/src/org/apache/cloudstack/storage/datastore/db/DataStoreProviderDaoImpl.java renamed to api/src/com/cloud/agent/api/to/DiskTO.java

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,45 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.storage.datastore.db;
19+
package com.cloud.agent.api.to;
2020

21-
import org.springframework.stereotype.Component;
21+
import com.cloud.storage.Volume;
2222

23-
import com.cloud.utils.db.GenericDaoBase;
24-
import com.cloud.utils.db.SearchCriteria2;
25-
import com.cloud.utils.db.SearchCriteriaService;
26-
import com.cloud.utils.db.SearchCriteria.Op;
23+
public class DiskTO {
24+
private DataTO data;
25+
private Long diskSeq;
26+
private Volume.Type type;
27+
public DiskTO() {
28+
29+
}
30+
31+
public DiskTO(DataTO data, Long diskSeq, Volume.Type type) {
32+
this.data = data;
33+
this.diskSeq = diskSeq;
34+
this.type = type;
35+
}
36+
37+
public DataTO getData() {
38+
return data;
39+
}
40+
41+
public void setData(DataTO data) {
42+
this.data = data;
43+
}
2744

28-
@Component
29-
class DataStoreProviderDaoImpl extends GenericDaoBase<DataStoreProviderVO, Long> implements DataStoreProviderDao {
45+
public Long getDiskSeq() {
46+
return diskSeq;
47+
}
3048

31-
@Override
32-
public DataStoreProviderVO findByName(String name) {
33-
SearchCriteriaService<DataStoreProviderVO, DataStoreProviderVO> sc = SearchCriteria2.create(DataStoreProviderVO.class);
34-
sc.addAnd(sc.getEntity().getName(), Op.EQ, name);
35-
return sc.find();
49+
public void setDiskSeq(Long diskSeq) {
50+
this.diskSeq = diskSeq;
3651
}
3752

38-
}
53+
public Volume.Type getType() {
54+
return type;
55+
}
56+
57+
public void setType(Volume.Type type) {
58+
this.type = type;
59+
}
60+
}

engine/storage/src/org/apache/cloudstack/storage/to/NfsPrimaryDataStoreTO.java renamed to api/src/com/cloud/agent/api/to/NfsTO.java

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,47 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package org.apache.cloudstack.storage.to;
17+
package com.cloud.agent.api.to;
1818

19-
import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
19+
import com.cloud.storage.DataStoreRole;
20+
21+
public final class NfsTO implements DataStoreTO {
22+
23+
private String _url;
24+
private DataStoreRole _role;
25+
26+
public NfsTO() {
27+
28+
super();
29+
30+
}
31+
32+
public NfsTO(String url, DataStoreRole role) {
33+
34+
super();
35+
36+
this._url = url;
37+
this._role = role;
2038

21-
public class NfsPrimaryDataStoreTO extends PrimaryDataStoreTO {
22-
private String server;
23-
private String path;
24-
25-
public NfsPrimaryDataStoreTO(PrimaryDataStoreInfo dataStore) {
26-
super(dataStore);
2739
}
28-
29-
public void setServer(String server) {
30-
this.server = server;
40+
41+
public String getUrl() {
42+
return _url;
3143
}
32-
33-
public String getServer() {
34-
return this.server;
44+
45+
public void setUrl(String _url) {
46+
this._url = _url;
3547
}
36-
37-
public void setPath(String path) {
38-
this.path = path;
48+
49+
@Override
50+
public DataStoreRole getRole() {
51+
return _role;
3952
}
40-
41-
public String getPath() {
42-
return this.path;
53+
54+
public void setRole(DataStoreRole _role) {
55+
this._role = _role;
4356
}
57+
58+
59+
4460
}

0 commit comments

Comments
 (0)