/** * */ package org.gcube.accounting.datamodel.implementations; import org.gcube.accounting.datamodel.RawUsageRecord; import org.gcube.accounting.datamodel.SingleUsageRecord; import org.gcube.accounting.datamodel.decorators.RequiredField; import org.gcube.accounting.datamodel.deprecationmanagement.annotations.DeprecatedWarning; import org.gcube.accounting.datamodel.validations.annotations.NotEmpty; import org.gcube.accounting.datamodel.validations.annotations.NotEmptyIfNotNull; import org.gcube.accounting.exception.InvalidValueException; /** * @author Luca Frosini (ISTI - CNR) http://www.lucafrosini.com/ * */ public class PortletUsageRecord extends RawUsageRecord implements SingleUsageRecord { /** * Generated Serial Version UID */ private static final long serialVersionUID = 8339324883678974869L; @NotEmptyIfNotNull @DeprecatedWarning protected static final String USER_ID = "userId"; @RequiredField @NotEmpty public static final String PORTLET_ID = "portletId"; @RequiredField @NotEmpty public static final String OPERATION_ID = "operationId"; // TODO check ASL for more field public PortletUsageRecord(){ super(); } @Deprecated public String getUserId() { return (String) this.resourceProperties.get(USER_ID); } @Deprecated public void setUserId(String userId) throws InvalidValueException { setResourceProperty(USER_ID, userId); } public String getPortletId() { return (String) this.resourceProperties.get(PORTLET_ID); } public void setPortletId(String portletId) throws InvalidValueException { setResourceProperty(PORTLET_ID, portletId); } public String getOperationId() { return (String) this.resourceProperties.get(OPERATION_ID); } public void setOperationId(String operationId) throws InvalidValueException { setResourceProperty(OPERATION_ID, operationId); } }