CORBA VMS writing method problem

I´m learning to write a Management of digital media with CORBA. I don´t know how to implement the Method VMSgetMediaAvailable () raises (ServerException).

Here is the VMS.idl:

module VMS {

enum Genre { g_undefined, SciFi, Comedy, Action, Horror, Docu };
enum StatusType { s_undefined, available, lent };

struct VMSMedia {
long ObjectId;
long ProviderId;
Genre Type;
string Title;
string ProductionCountry;
short ProductionYear;
short Length;
StatusType Status;

struct VMSProvider {
long ObjectId;
string Name;
string FirstName;
long ZIPCode; /* short does not work */
string Address;

exception ServerException {
string reason;

typedef sequence<VMSMedia> VMSMediaSeq;
typedef sequence<VMSProvider> VMSProviderSeq;

interface VMSRepository {
readonly attribute long currentMaxProviderId;
readonly attribute long currentMaxMediaId;

oneway void save ();

oneway void addProvider (in VMSProvider p);
oneway void delProvider (in long id);

VMSProvider getProvider (in long id)
raises (ServerException);
VMSProviderSeq getProviders ()
raises (ServerException);

oneway void addMedia (in VMSMedia p);
oneway void delMedia (in long id);

VMSMedia getMedia (in long id)
raises (ServerException);
VMSMediaSeq getMediaOfType (in Genre type)
raises (ServerException);
VMSMediaSeq getMediaYoungerThan (in short year)
raises (ServerException);
//here new Method
VMSMediaSeq getMediaAvailable () raises


I know I have to create a new Stub and a new Skelton in that IDL file and I have to implement this method. I need to ask if there is Media available, so i have to do a if- Statement right? But I don´t know how I can do it.

I also have a class with the Name of where i have to write the method or implement this method. all I have is this:

VMSRepository_i::VMSMediaSeq getMediaAvailable () {


Can you help me please?


P.S.: The Button with the Code "<>" didn´t work.
Topic archived. No new replies allowed.