Changeset 1339


Ignore:
Timestamp:
05/18/11 15:53:21 (13 years ago)
Author:
twagoo
Message:

ComponentRegistryImplBase? for shared methods between fs Impl and DbImpl?

Location:
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl
Files:
1 added
2 edited

Legend:

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

    r1337 r1339  
    88import clarin.cmdi.componentregistry.UserUnauthorizedException;
    99import clarin.cmdi.componentregistry.components.CMDComponentSpec;
     10import clarin.cmdi.componentregistry.impl.ComponentRegistryImplBase;
    1011import clarin.cmdi.componentregistry.model.AbstractDescription;
    1112import clarin.cmdi.componentregistry.model.ComponentDescription;
     
    3334 * @author Twan Goosen <twan.goosen@mpi.nl>
    3435 */
    35 public class ComponentRegistryDbImpl implements ComponentRegistry {
     36public class ComponentRegistryDbImpl extends ComponentRegistryImplBase implements ComponentRegistry {
    3637
    3738    private final static Logger LOG = LoggerFactory.getLogger(ComponentRegistryDbImpl.class);
     
    251252            throw ex;
    252253        }
    253     }
    254 
    255     @Override
    256     public List<ComponentDescription> getUsageInComponents(String componentId) {
    257         throw new UnsupportedOperationException("Not supported yet.");
    258     }
    259 
    260     @Override
    261     public List<ProfileDescription> getUsageInProfiles(String componentId) {
    262         throw new UnsupportedOperationException("Not supported yet.");
    263254    }
    264255
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/filesystem/ComponentRegistryImpl.java

    r1335 r1339  
    11package clarin.cmdi.componentregistry.impl.filesystem;
    22
     3import clarin.cmdi.componentregistry.impl.ComponentRegistryImplBase;
    34import clarin.cmdi.componentregistry.ComponentRegistry;
    45import clarin.cmdi.componentregistry.ComponentRegistryUtils;
     
    1112import java.io.IOException;
    1213import java.io.OutputStream;
    13 import java.io.UnsupportedEncodingException;
    1414import java.security.Principal;
    1515import java.text.ParseException;
     
    4141import clarin.cmdi.componentregistry.model.ProfileDescription;
    4242
    43 public class ComponentRegistryImpl implements ComponentRegistry {
     43public class ComponentRegistryImpl extends ComponentRegistryImplBase implements ComponentRegistry {
    4444
    4545    public static final String DESCRIPTION_FILE_NAME = "description.xml";
     
    395395
    396396    @Override
    397     public List<ComponentDescription> getUsageInComponents(String componentId) {
    398         List<ComponentDescription> result = new ArrayList<ComponentDescription>();
    399         List<ComponentDescription> descs = getComponentDescriptions();
    400         for (ComponentDescription desc : descs) {
    401             CMDComponentSpec spec = getMDComponent(desc.getId());
    402             if (spec != null && ComponentRegistryUtils.findComponentId(componentId, spec.getCMDComponent())) {
    403                 result.add(desc);
    404             }
    405         }
    406         return result;
    407     }
    408 
    409     @Override
    410     public List<ProfileDescription> getUsageInProfiles(String componentId) {
    411         List<ProfileDescription> result = new ArrayList<ProfileDescription>();
    412         for (ProfileDescription profileDescription : getProfileDescriptions()) {
    413             CMDComponentSpec profile = getMDProfile(profileDescription.getId());
    414             if (profile != null && ComponentRegistryUtils.findComponentId(componentId, profile.getCMDComponent())) {
    415                 result.add(profileDescription);
    416             }
    417         }
    418         return result;
    419     }
    420 
    421     @Override
    422397    public boolean isPublic() {
    423398        return isPublic;
Note: See TracChangeset for help on using the changeset viewer.