001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Anahide Tchertchian
018 */
019package org.nuxeo.targetplatforms.api.impl;
020
021import java.util.List;
022import java.util.Map;
023
024import org.nuxeo.targetplatforms.api.TargetPackage;
025import org.nuxeo.targetplatforms.api.TargetPlatform;
026import org.nuxeo.targetplatforms.api.TargetPlatformInstance;
027
028/**
029 * {@link TargetPlatform} implementation relying on an original implementation, useful for override when adding
030 * additional metadata.
031 *
032 * @since 5.7.1
033 */
034public class TargetPlatformInstanceExtension extends TargetExtension implements TargetPlatformInstance {
035
036    private static final long serialVersionUID = 1L;
037
038    protected TargetPlatformInstance origInstance;
039
040    // needed by GWT serialization
041    protected TargetPlatformInstanceExtension() {
042        super();
043    }
044
045    public TargetPlatformInstanceExtension(TargetPlatformInstance orig) {
046        super(orig);
047        origInstance = orig;
048    }
049
050    @Override
051    public boolean isFastTrack() {
052        return origInstance.isFastTrack();
053    }
054
055    @Override
056    public List<String> getEnabledPackagesIds() {
057        return origInstance.getEnabledPackagesIds();
058    }
059
060    @Override
061    public Map<String, TargetPackage> getEnabledPackages() {
062        return origInstance.getEnabledPackages();
063    }
064
065    @Override
066    public boolean hasEnabledPackageWithName(String packageName) {
067        return origInstance.hasEnabledPackageWithName(packageName);
068    }
069
070    @Override
071    public TargetPlatform getParent() {
072        return origInstance.getParent();
073    }
074
075}