diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index 5aee11425da..89458fc9614 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -27,7 +27,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
UserVm(true, true), Template(true, true), ISO(true, false), Volume(true, true), Snapshot(true, false), Network(true, true), Nic(false, true), LoadBalancer(true, true), PortForwardingRule(
true, true), FirewallRule(true, true), SecurityGroup(true, false), PublicIpAddress(true, true), Project(true, false), Vpc(true, true), NetworkACL(true, true), StaticRoute(
true, false), VMSnapshot(true, false), RemoteAccessVpn(true, true), Zone(false, true), ServiceOffering(false, true), Storage(false, true), PrivateGateway(false,
- true), NetworkACLList(false, true), VpnGateway(false, true), CustomerGateway(false, true), VpnConnection(false, true), User(true, false), DiskOffering(false, true);
+ true), NetworkACLList(false, true), VpnGateway(false, true), CustomerGateway(false, true), VpnConnection(false, true), User(true, true), DiskOffering(false, true);
ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
this.resourceTagsSupport = resourceTagsSupport;
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
index 69d1ca7c2ee..618be7f3958 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
@@ -21,13 +21,12 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import org.apache.log4j.Logger;
-
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseAsyncCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.SuccessResponse;
+import org.apache.log4j.Logger;
import com.cloud.event.EventTypes;
import com.cloud.server.ResourceTag;
@@ -35,7 +34,7 @@ import com.cloud.server.ResourceTag;
@APICommand(name = "addResourceDetail", description = "Adds detail for the Resource.", responseObject = SuccessResponse.class)
public class AddResourceDetailCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(AddResourceDetailCmd.class.getName());
- private static final String s_name = "addResourceDetailresponse";
+ private static final String s_name = "addresourcedetailresponse";
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@@ -47,11 +46,7 @@ public class AddResourceDetailCmd extends BaseAsyncCmd {
@Parameter(name = ApiConstants.RESOURCE_TYPE, type = CommandType.STRING, required = true, description = "type of the resource")
private String resourceType;
- @Parameter(name = ApiConstants.RESOURCE_ID,
- type = CommandType.STRING,
- required = true,
- collectionType = CommandType.STRING,
- description = "resource id to create the details for")
+ @Parameter(name = ApiConstants.RESOURCE_ID, type = CommandType.STRING, required = true, collectionType = CommandType.STRING, description = "resource id to create the details for")
private String resourceId;
/////////////////////////////////////////////////////
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
index 5aa91c0231a..627cc9f6020 100644
--- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -332,6 +332,7 @@
+
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/UserDetailVO.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/UserDetailVO.java
new file mode 100644
index 00000000000..69f44739a5e
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/UserDetailVO.java
@@ -0,0 +1,81 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+@Entity
+@Table(name = "user_details")
+public class UserDetailVO implements ResourceDetail {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private long id;
+
+ @Column(name = "user_id")
+ private long resourceId;
+
+ @Column(name = "name")
+ private String name;
+
+ @Column(name = "value", length = 1024)
+ private String value;
+
+ @Column(name = "display")
+ private boolean display;
+
+ public UserDetailVO() {
+ }
+
+ public UserDetailVO(long id, String name, String value) {
+ this.resourceId = id;
+ this.name = name;
+ this.value = value;
+ }
+
+ @Override
+ public long getId() {
+ return id;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public long getResourceId() {
+ return resourceId;
+ }
+
+ @Override
+ public boolean isDisplay() {
+ return display;
+ }
+}
\ No newline at end of file
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDao.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDao.java
new file mode 100644
index 00000000000..2ef3fea503b
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDao.java
@@ -0,0 +1,26 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail.dao;
+
+import org.apache.cloudstack.resourcedetail.UserDetailVO;
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDao;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface UserDetailsDao extends GenericDao, ResourceDetailsDao {
+
+}
\ No newline at end of file
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDaoImpl.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDaoImpl.java
new file mode 100644
index 00000000000..508185297a8
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/UserDetailsDaoImpl.java
@@ -0,0 +1,33 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.resourcedetail.dao;
+
+import javax.ejb.Local;
+
+import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase;
+import org.apache.cloudstack.resourcedetail.UserDetailVO;
+import org.springframework.stereotype.Component;
+
+@Component
+@Local(value = {UserDetailsDao.class})
+public class UserDetailsDaoImpl extends ResourceDetailsDaoBase implements UserDetailsDao {
+
+ @Override
+ public void addDetail(long resourceId, String key, String value) {
+ super.addDetail(new UserDetailVO(resourceId, key, value));
+ }
+}
\ No newline at end of file
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index df082ec43ec..c7906f52d16 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -34,6 +34,7 @@ import org.apache.cloudstack.resourcedetail.dao.RemoteAccessVpnDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.Site2SiteCustomerGatewayDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnConnectionDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.Site2SiteVpnGatewayDetailsDao;
+import org.apache.cloudstack.resourcedetail.dao.UserDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.VpcDetailsDao;
import org.apache.cloudstack.resourcedetail.dao.VpcGatewayDetailsDao;
@@ -104,6 +105,8 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
Site2SiteVpnConnectionDetailsDao _vpnConnectionDetailsDao;
@Inject
DiskOfferingDetailsDao _diskOfferingDetailsDao;
+ @Inject
+ UserDetailsDao _userDetailsDao;
private static Map> s_daoMap = new HashMap>();
@@ -130,6 +133,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
s_daoMap.put(ResourceObjectType.CustomerGateway, _customerGatewayDetailsDao);
s_daoMap.put(ResourceObjectType.VpnConnection, _vpnConnectionDetailsDao);
s_daoMap.put(ResourceObjectType.DiskOffering, _diskOfferingDetailsDao);
+ s_daoMap.put(ResourceObjectType.User, _userDetailsDao);
return true;
}
diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql
index 0dd2c39674b..17b4c6d6076 100644
--- a/setup/db/db/schema-430to440.sql
+++ b/setup/db/db/schema-430to440.sql
@@ -214,5 +214,14 @@ CREATE VIEW `cloud`.`volume_view` AS
and async_job.job_status = 0;
UPDATE `cloud`.`configuration` SET `description` = 'If set to true, StartCommand, StopCommand, CopyCommand, MigrateCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is true.' WHERE `name` = 'execute.in.sequence.hypervisor.commands';
+ALTER TABLE `cloud`.`disk_offering_details` CHANGE `display_detail` `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
-ALTER TABLE `cloud`.`disk_offering_details` CHANGE `display_detail` `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
\ No newline at end of file
+CREATE TABLE `cloud`.`user_details` (
+ `id` bigint unsigned NOT NULL auto_increment,
+ `user_id` bigint unsigned NOT NULL COMMENT 'VPC gateway id',
+ `name` varchar(255) NOT NULL,
+ `value` varchar(1024) NOT NULL,
+ `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user',
+ PRIMARY KEY (`id`),
+ CONSTRAINT `fk_user_details__user_id` FOREIGN KEY `fk_user_details__user_id`(`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
\ No newline at end of file