blob: 54b5a8e7565126a22caff81267a1cfcf766c8d26 [file] [log] [blame]
Jiri Simsaddbfebb2014-06-20 15:56:06 -07001// Package repository contains implementation of the interface for
2// storing and serving various veyron management objects.
3package repository
4
5import (
Jiri Simsa764efb72014-12-25 20:57:03 -08006 "v.io/core/veyron/services/mgmt/profile"
7 "v.io/core/veyron2/services/mgmt/application"
8 "v.io/core/veyron2/services/security/access"
9 public "v.io/core/veyron2/services/mgmt/repository"
Jiri Simsaddbfebb2014-06-20 15:56:06 -070010)
11
12// Application describes an application repository internally. Besides
13// the public Application interface, it allows to add and remove
14// application envelopes.
15type Application interface {
16 public.Application
17 // Put adds the given tuple of application version (specified
Bogdan Capritad9281a32014-07-02 14:40:39 -070018 // through the object name suffix) and application envelope to all
Jiri Simsaddbfebb2014-06-20 15:56:06 -070019 // of the given application profiles.
Asim Shankar68885192014-11-26 12:48:35 -080020 Put(Profiles []string, Envelope application.Envelope) error {access.Write}
Jiri Simsaddbfebb2014-06-20 15:56:06 -070021 // Remove removes the application envelope for the given profile
Bogdan Capritad9281a32014-07-02 14:40:39 -070022 // name and application version (specified through the object name
Jiri Simsaddbfebb2014-06-20 15:56:06 -070023 // suffix). If no version is specified as part of the suffix, the
24 // method removes all versions for the given profile.
25 //
26 // TODO(jsimsa): Add support for using "*" to specify all profiles
27 // when Matt implements Globing (or Ken implements querying).
Asim Shankar68885192014-11-26 12:48:35 -080028 Remove(Profile string) error {access.Write}
Jiri Simsaddbfebb2014-06-20 15:56:06 -070029}
30
31// Profile describes a profile internally. Besides the public Profile
32// interface, it allows to add and remove profile specifications.
33type Profile interface {
34 public.Profile
35 // Specification returns the profile specification for the profile
Bogdan Capritad9281a32014-07-02 14:40:39 -070036 // identified through the object name suffix.
Todd Wang383e88c2014-12-18 01:52:34 -080037 Specification() (profile.Specification | error) {access.Read}
Jiri Simsaddbfebb2014-06-20 15:56:06 -070038 // Put sets the profile specification for the profile identified
Bogdan Capritad9281a32014-07-02 14:40:39 -070039 // through the object name suffix.
Asim Shankar68885192014-11-26 12:48:35 -080040 Put(Specification profile.Specification) error {access.Write}
Jiri Simsaddbfebb2014-06-20 15:56:06 -070041 // Remove removes the profile specification for the profile
Bogdan Capritad9281a32014-07-02 14:40:39 -070042 // identified through the object name suffix.
Asim Shankar68885192014-11-26 12:48:35 -080043 Remove() error {access.Write}
Jiri Simsaddbfebb2014-06-20 15:56:06 -070044}