Changeset 2068
- Timestamp:
- 08/08/12 08:28:32 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java
r2067 r2068 48 48 49 49 private final static Logger LOG = LoggerFactory.getLogger(ComponentRegistryDbImpl.class); 50 private Owner owner;51 private ComponentStatus status;50 private Owner registryOwner; 51 private ComponentStatus registryStatus; 52 52 @Autowired 53 53 private Configuration configuration; … … 75 75 */ 76 76 public ComponentRegistryDbImpl() { 77 this. status = ComponentStatus.PUBLIC;77 this.registryStatus = ComponentStatus.PUBLIC; 78 78 } 79 79 … … 87 87 */ 88 88 public ComponentRegistryDbImpl(ComponentStatus status, Owner owner) { 89 this. status = status;90 this. owner = owner;89 this.registryStatus = status; 90 this.registryOwner = owner; 91 91 } 92 92 … … 94 94 public List<ProfileDescription> getProfileDescriptions() throws ComponentRegistryException { 95 95 try { 96 switch ( status) {96 switch (registryStatus) { 97 97 // TODO: support other status types 98 98 case DEVELOPMENT: 99 if ( owner == null) {99 if (registryOwner == null) { 100 100 throw new ComponentRegistryException("Development workspace without owner!"); 101 101 } 102 102 // TODO: Support group space 103 return profileDescriptionDao.getUserspaceDescriptions( owner.getId());103 return profileDescriptionDao.getUserspaceDescriptions(registryOwner.getId()); 104 104 case PUBLIC: 105 105 return profileDescriptionDao.getPublicProfileDescriptions(); 106 106 default: 107 throw new ComponentRegistryException("Unsupported status type" + status);107 throw new ComponentRegistryException("Unsupported status type" + registryStatus); 108 108 } 109 109 } catch (DataAccessException ex) { … … 512 512 @Deprecated 513 513 public boolean isPublic() { 514 return status == ComponentStatus.PUBLIC;514 return registryStatus == ComponentStatus.PUBLIC; 515 515 } 516 516 … … 519 519 */ 520 520 private Number getUserId() { 521 if ( owner instanceof OwnerUser) {522 return owner.getId();521 if (registryOwner instanceof OwnerUser) { 522 return registryOwner.getId(); 523 523 } else { 524 524 return null; … … 530 530 */ 531 531 private Number getGroupId() { 532 if ( owner instanceof OwnerGroup) {533 return owner.getId();532 if (registryOwner instanceof OwnerGroup) { 533 return registryOwner.getId(); 534 534 } else { 535 535 return null; … … 539 539 @Override 540 540 public Owner getOwner() { 541 return owner;541 return registryOwner; 542 542 } 543 543 … … 550 550 public void setStatus(ComponentStatus status, Owner owner) { 551 551 setStatus(status); 552 this. owner = owner;552 this.registryOwner = owner; 553 553 } 554 554 555 555 public void setStatus(ComponentStatus status) { 556 this. status = status;556 this.registryStatus = status; 557 557 } 558 558 559 559 @Override 560 560 public ComponentStatus getStatus() { 561 return status;561 return registryStatus; 562 562 } 563 563
Note: See TracChangeset
for help on using the changeset viewer.