Changeset 2068


Ignore:
Timestamp:
08/08/12 08:28:32 (12 years ago)
Author:
twagoo
Message:

renamed owner and status fields in ComponentRegistryDbImpl?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java

    r2067 r2068  
    4848
    4949    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;
    5252    @Autowired
    5353    private Configuration configuration;
     
    7575     */
    7676    public ComponentRegistryDbImpl() {
    77         this.status = ComponentStatus.PUBLIC;
     77        this.registryStatus = ComponentStatus.PUBLIC;
    7878    }
    7979
     
    8787     */
    8888    public ComponentRegistryDbImpl(ComponentStatus status, Owner owner) {
    89         this.status = status;
    90         this.owner = owner;
     89        this.registryStatus = status;
     90        this.registryOwner = owner;
    9191    }
    9292
     
    9494    public List<ProfileDescription> getProfileDescriptions() throws ComponentRegistryException {
    9595        try {
    96             switch (status) {
     96            switch (registryStatus) {
    9797                // TODO: support other status types
    9898                case DEVELOPMENT:
    99                     if (owner == null) {
     99                    if (registryOwner == null) {
    100100                        throw new ComponentRegistryException("Development workspace without owner!");
    101101                    }
    102102                    // TODO: Support group space
    103                     return profileDescriptionDao.getUserspaceDescriptions(owner.getId());
     103                    return profileDescriptionDao.getUserspaceDescriptions(registryOwner.getId());
    104104                case PUBLIC:
    105105                    return profileDescriptionDao.getPublicProfileDescriptions();
    106106                default:
    107                     throw new ComponentRegistryException("Unsupported status type" + status);
     107                    throw new ComponentRegistryException("Unsupported status type" + registryStatus);
    108108            }
    109109        } catch (DataAccessException ex) {
     
    512512    @Deprecated
    513513    public boolean isPublic() {
    514         return status == ComponentStatus.PUBLIC;
     514        return registryStatus == ComponentStatus.PUBLIC;
    515515    }
    516516
     
    519519     */
    520520    private Number getUserId() {
    521         if (owner instanceof OwnerUser) {
    522             return owner.getId();
     521        if (registryOwner instanceof OwnerUser) {
     522            return registryOwner.getId();
    523523        } else {
    524524            return null;
     
    530530     */
    531531    private Number getGroupId() {
    532         if (owner instanceof OwnerGroup) {
    533             return owner.getId();
     532        if (registryOwner instanceof OwnerGroup) {
     533            return registryOwner.getId();
    534534        } else {
    535535            return null;
     
    539539    @Override
    540540    public Owner getOwner() {
    541         return owner;
     541        return registryOwner;
    542542    }
    543543
     
    550550    public void setStatus(ComponentStatus status, Owner owner) {
    551551        setStatus(status);
    552         this.owner = owner;
     552        this.registryOwner = owner;
    553553    }
    554554
    555555    public void setStatus(ComponentStatus status) {
    556         this.status = status;
     556        this.registryStatus = status;
    557557    }
    558558
    559559    @Override
    560560    public ComponentStatus getStatus() {
    561         return status;
     561        return registryStatus;
    562562    }
    563563
Note: See TracChangeset for help on using the changeset viewer.