/** * Tagging interface indicating that a facet is an implementation of a {@code ComposerHostedMetadataFacet}. This facet * is responsible for maintaining the internal metadata (currently just the provider.json file). */ @Facet.Exposed public interface ComposerHostedMetadataFacet extends Facet { }
private ComponentMaintenance getComponentMaintenanceFacet(final Repository repository) { try { return repository.facet(ComponentMaintenance.class); } catch (MissingFacetException e) { throw new IllegalOperationException( format("Deleting from repository %s of type %s is not supported", repository.getName(), repository.getFormat()), e); } } }
/** * Lookup a facet on attached repository. * * Reduce some verbosity for commonly used repository operation. * * @see Repository#facet(Class) */ @Nonnull protected <T extends Facet> T facet(final Class<T> type) throws MissingFacetException { return getRepository().facet(type); }
@Override @Transitions(from = ATTACHED, to = INITIALISED) public void init() throws Exception { doInit(getRepository().getConfiguration()); }
/** * Lookup an {@link Optional} facet on attached repository. * * Reduce some verbosity for commonly used repository operation. * * @see Repository#optionalFacet(Class) */ @Nonnull protected <T extends Facet> Optional<T> optionalFacet(final Class<T> type) { return getRepository().optionalFacet(type); }
@Override protected void doInit(final Configuration configuration) throws Exception { super.doInit(configuration); }
@Override @Guarded(by = STOPPED) public void update() throws Exception { doUpdate(getRepository().getConfiguration()); }
@Override public boolean apply(final Repository input) { return test(input); }
public static HasFacet hasFacet(final Class<? extends Facet> type) { return new HasFacet(type); } }
@Facet.Exposed public interface AptFacet extends Facet { @Nullable Content get(String path) throws IOException; Content put(String path, Payload payload) throws IOException; boolean delete(String path) throws IOException; boolean isFlat(); String getDistribution(); }
@Facet.Exposed public interface AptSnapshotFacet extends Facet { public boolean isSnapshotableFile(String path); public void createSnapshot(String id, SnapshotComponentSelector spec) throws IOException; public Content getSnapshotFile(String id, String path) throws IOException; public void deleteSnapshot(String id) throws IOException; }
/** * HTTP client facet. * * @since 3.0 */ @Facet.Exposed public interface HttpClientFacet extends Facet { HttpClient getHttpClient(); RemoteConnectionStatus getStatus(); Header createBasicAuthHeader(); }
/** * Content facet used for getting assets from storage and putting assets into storage for a Composer-format repository. */ @Facet.Exposed public interface ComposerContentFacet extends Facet { @Nullable Content get(String path) throws IOException; Content put(String path, Payload payload, AssetKind assetKind) throws IOException; void setCacheInfo(String path, Content content, CacheInfo cacheInfo) throws IOException; }