accounting-lib/src/main/java/org/gcube/accounting/datamodel/implementations/PortletUsageRecord.java

65 lines
1.8 KiB
Java

/**
*
*/
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.validations.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;
@DeprecatedWarning @NotEmptyIfNotNull
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 More
public PortletUsageRecord(){
super();
}
@Deprecated
public String getUserId() {
return (String) this.resourceSpecificProperties.get(USER_ID);
}
@Deprecated
public void setUserId(String userId) throws InvalidValueException {
setResourceSpecificProperty(USER_ID, userId);
}
public String getPortletId() {
return (String) this.resourceSpecificProperties.get(PORTLET_ID);
}
public void setPortletId(String portletId) throws InvalidValueException {
setResourceSpecificProperty(PORTLET_ID, portletId);
}
public String getOperationId() {
return (String) this.resourceSpecificProperties.get(OPERATION_ID);
}
public void setOperationId(String operationId) throws InvalidValueException {
setResourceSpecificProperty(OPERATION_ID, operationId);
}
}