1 19 20 package com.sslexplorer.properties; 21 22 import java.util.Calendar ; 23 24 import com.sslexplorer.policyframework.AbstractResource; 25 import com.sslexplorer.policyframework.PolicyConstants; 26 import com.sslexplorer.policyframework.Resource; 27 import com.sslexplorer.policyframework.ResourceType; 28 29 34 public class DefaultPropertyProfile extends AbstractResource implements PropertyProfile { 35 36 38 private String user; 39 40 50 public DefaultPropertyProfile(int realmID, int resourceId, String user, String resourceName, String resourceDescription, 51 Calendar dateCreated, Calendar dateAmended) { 52 super(realmID, PolicyConstants.PROFILE_RESOURCE_TYPE, resourceId, resourceName, resourceDescription, dateCreated, dateAmended); 53 this.user = user; 54 } 55 56 59 public String getLabel() { 60 return resourceName + (user == null || user.equals("") ? " (Global)" : " (Personal)"); 61 } 62 63 66 public String getOwnerUsername() { 67 return user; 68 } 69 70 73 public ResourceType getResourceType() { 74 return PolicyConstants.PROFILE_RESOURCE_TYPE; 75 } 76 77 80 public int compareTo(Object o) { 81 return getResourceName().compareTo(((Resource) o).getResourceName()); 82 } 83 } 84 | Popular Tags |