1 23 24 package org.infoglue.cms.entities.management; 25 26 import org.infoglue.cms.entities.kernel.BaseEntityVO; 27 import org.infoglue.cms.entities.management.impl.simple.RepositoryImpl; 28 import org.infoglue.cms.util.ConstraintExceptionBuffer; 29 import org.infoglue.cms.util.validators.ValidatorFactory; 30 31 public class RepositoryVO implements BaseEntityVO 32 { 33 private java.lang.Integer repositoryId; 34 private java.lang.String name; 35 private java.lang.String description; 36 private java.lang.String dnsName; 37 38 41 42 public Integer getId() 43 { 44 return getRepositoryId(); 45 } 46 47 public String toString() 48 { 49 return getName(); 50 } 51 52 public java.lang.Integer getRepositoryId() 53 { 54 return this.repositoryId; 55 } 56 57 public void setRepositoryId(java.lang.Integer repositoryId) 58 { 59 this.repositoryId = repositoryId; 60 } 61 62 public java.lang.String getName() 63 { 64 return this.name; 65 } 66 67 public void setName(java.lang.String name) 68 { 69 this.name = name; 70 } 71 72 public java.lang.String getDescription() 73 { 74 return this.description; 75 } 76 77 public void setDescription(java.lang.String description) 78 { 79 this.description = description; 80 } 81 82 public java.lang.String getDnsName() 83 { 84 return this.dnsName; 85 } 86 87 public void setDnsName(java.lang.String dnsName) 88 { 89 if(dnsName == null || dnsName.length() == 0) 90 this.dnsName = "undefined"; 91 else 92 this.dnsName = dnsName; 93 } 94 95 98 public ConstraintExceptionBuffer validate() 99 { 100 ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer(); 101 102 ValidatorFactory.createStringValidator("Repository.name", true, 6, 20, true, RepositoryImpl.class, this.getId(), null).validate(this.name, ceb); 103 ValidatorFactory.createStringValidator("Repository.description", true, 1, 100).validate(description, ceb); 104 ValidatorFactory.createStringValidator("Repository.dnsName", false, 0, 2048).validate(dnsName, ceb); 105 106 return ceb; 107 } 108 109 } 110 111 | Popular Tags |