This commit is contained in:
Lucio Lelii 2018-05-07 09:32:55 +00:00
parent aff8ca2030
commit 50ebdd199b
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package org.gcube.common.storagehub.model.items.nodes.accounting;
import org.gcube.common.storagehub.model.annotations.Attribute;
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
import org.gcube.common.storagehub.model.items.nodes.AccountEntry;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@AttributeRootNode("nthl:accountingEntryRead")
public class AccountEntryRead extends AccountEntry{
@Attribute("hl:itemName")
String itemName;
AccountingEntryType type = AccountingEntryType.READ;
}

View File

@ -0,0 +1,55 @@
package org.gcube.common.storagehub.model.items.nodes.accounting;
public enum AccountingEntryType {
CREATE("nthl:accountingEntryCreate"),
READ("nthl:accountingEntryRead"),
ADD("nthl:accountingFolderEntryAdd"),
PASTE("nthl:accountingEntryPaste"),
CUT("nthl:accountingFolderEntryCut"),
UPDATE("nthl:accountingEntryUpdate"),
SHARE("nthl:accountingEntryShare"),
UNSHARE("nthl:accountingEntryUnshare"),
REMOVAL("nthl:accountingFolderEntryRemoval"),
RENAMING("nthl:accountingFolderEntryRenaming"),
DELETE("nthl:accountingEntryDelete"),
RESTORE("nthl:accountingEntryRestore"),
ENABLED_PUBLIC_ACCESS("nthl:accountingEntryEnabledPublicAccess"),
DISABLED_PUBLIC_ACCESS("nthl:accountingEntryDisabledPublicAccess"),
SET_ACL("nthl:accountingEntryAddACL");
private String nodeTypeDefinition;
AccountingEntryType(String value) {
this.nodeTypeDefinition = value;
}
public String getNodeTypeDefinition() {
return nodeTypeDefinition;
}
public static AccountingEntryType getEnum(String value) {
for (AccountingEntryType entry : AccountingEntryType.values()) {
if (entry.getNodeTypeDefinition().compareTo(value) == 0) {
return entry;
}
}
return null;
}
}