@Override protected CpuProfile createProfileEntity(ResultSet rs) throws SQLException { CpuProfile cpuProfile = new CpuProfile(); cpuProfile.setClusterId(getGuid(rs, "cluster_id")); return cpuProfile; }
@Override protected DiskProfile createProfileEntity(ResultSet rs) throws SQLException { DiskProfile diskProfile = new DiskProfile(); diskProfile.setStorageDomainId(getGuid(rs, "storage_domain_id")); return diskProfile; }
@Override public Object getQueryableId() { return getId(); }
@Override protected CpuProfile generateNewEntity() { CpuProfile cpuProfile = new CpuProfile(); cpuProfile.setId(Guid.newGuid()); cpuProfile.setName("new_profile"); cpuProfile.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI); cpuProfile.setQosId(FixturesTool.QOS_ID_4); return cpuProfile; }
@Override protected DiskProfile generateNewEntity() { DiskProfile diskProfile = new DiskProfile(); diskProfile.setId(Guid.newGuid()); diskProfile.setName("new_profile"); diskProfile.setStorageDomainId(FixturesTool.STORAGE_DOMAIN_SCALE_SD5); diskProfile.setQosId(FixturesTool.QOS_ID_1); return diskProfile; }
static org.ovirt.engine.core.common.businessentities.profiles.DiskProfile setUpEntityExpectations(org.ovirt.engine.core.common.businessentities.profiles.DiskProfile entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getStorageDomainId()).thenReturn(GUIDS[index]); return entity; } }
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return tsb.append("id", getId()) .append("description", getDescription()) .append("profileType", getProfileType()) .append("qosId", getQosId()); }
@Override protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("clusterId", getClusterId()); } }
@Override protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("storageDomainId", getStorageDomainId()); } }
@Override protected void updateExistingEntity() { existingEntity.setQosId(FixturesTool.QOS_ID_5); existingEntity.setDescription("desc1"); }
@Override protected void updateExistingEntity() { existingEntity.setQosId(FixturesTool.QOS_ID_2); existingEntity.setDescription("Kramer goes to a fantasy camp? His whole life is a fantasy camp. " + "People should plunk down $2000 to live like him for a week. Sleep, do nothing, " + "fall ass-backwards into money, mooch food off your neighbors and have sex without dating... THAT'S a fantasy camp."); }
@Override protected MapSqlParameterSource createFullParametersMapper(DiskProfile obj) { MapSqlParameterSource map = super.createFullParametersMapper(obj); map.addValue("storage_domain_id", obj.getStorageDomainId()); return map; }
public void setProfileId(Guid profileId) { this.profile.setId(profileId); }
@Override public int hashCode() { return Objects.hash( super.hashCode(), clusterId ); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof DiskProfile)) { return false; } DiskProfile other = (DiskProfile) obj; return super.equals(obj) && Objects.equals(storageDomainId, other.storageDomainId); }
public ProfileBase(ProfileType profileType) { this.setProfileType(profileType); }
@Override public String toString() { return appendAttributes(ToStringBuilder.forInstance(this)).build(); } }
public Guid getProfileId() { return profile.getId(); }
@Override public int hashCode() { return Objects.hash( super.hashCode(), storageDomainId ); }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CpuProfile)) { return false; } CpuProfile other = (CpuProfile) obj; return super.equals(obj) && Objects.equals(clusterId, other.clusterId); }