00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _PERSPRODUCT_I_H_
00033 #define _PERSPRODUCT_I_H_
00034
00035
00036
00037
00038
00039
00040 #include "persproduct.h"
00041
00042
00043 #include "persproductS.h"
00044 #include "servantlocators.h"
00045
00046
00047 namespace OSB_CORBA {
00048 class AnCList_i;
00049 class ContractAdmin_i;
00050 class ContractWriter_i;
00051 class PersProdItemWriter_i;
00052 class PersProdNodeWriter_i;
00053 }
00054
00055 namespace OSB_LIB {
00056 class AnCList;
00057 }
00058
00059
00060
00061 namespace OSB_CORBA {
00062 using namespace corba::cadmin::persprod;
00063 using namespace corba::cadmin::persprodnode;
00064 using namespace corba::cadmin::persproditem;
00065
00066 using corba::cadmin::AssociateId;
00067 using corba::cadmin::PersProdId;
00068 using corba::cadmin::PersNodeId;
00069 using corba::cadmin::Status;
00070 using corba::cadmin::StatusHistory;
00071 using corba::cadmin::StatusRequest;
00072 using corba::cadmin::StatusValue;
00073 using corba::common::CfgErrorSeq_out;
00074 using corba::common::DateTime;
00075 using corba::common::Utf8String;
00076 using corba::pcat::pd::ProductId;
00077 using corba::pcat::pp::ProductPartId;
00078
00082 class PersProductWriter_i :
00083 public virtual POA_corba::cadmin::persprod::PersProductWriter
00084 {
00085 public:
00086 static const std::string IFC;
00087
00095 PersProductWriter_i(
00096 AnCList_i& ancList,
00097 ContractWriter_i& coServant,
00098 OSB_LIB::PersProduct* persProduct
00099 );
00100
00102 ~PersProductWriter_i();
00103
00105 const Locators::Key& key() const
00106 {
00107 return key_;
00108 }
00109
00111 PersProdId id()
00112 throw (CORBA::SystemException);
00113
00115 ProductId prodId()
00116 throw (CORBA::SystemException);
00117
00119 AssociateId userId()
00120 throw (CORBA::SystemException);
00121
00123 Utf8String* name()
00124 throw (CORBA::SystemException, OsbCorbaException);
00125
00127 Utf8String* desc()
00128 throw (CORBA::SystemException, OsbCorbaException);
00129
00131 Status effStatus()
00132 throw (CORBA::SystemException);
00133
00135 Status prefStatus()
00136 throw (CORBA::SystemException);
00137
00139 DateTime* createdDate()
00140 throw (CORBA::SystemException);
00141
00143 DateTime* effStatusDate()
00144 throw (CORBA::SystemException);
00145
00147 DateTime* prefStatusDate()
00148 throw (CORBA::SystemException);
00149
00161 virtual StatusValue requestedStatus(
00162 const DateTime& ts
00163 ) throw (CORBA::SystemException, OsbCorbaException);
00164
00177 StatusHistory* statusHistory(
00178 const DateTime& from,
00179 const DateTime& to,
00180 CORBA::Boolean noWait
00181 ) throw (CORBA::SystemException, OsbCorbaException);
00182
00187 AvailnSubscrPartSeq* availnSubscrParts(
00188 const OSB_LIB::PersParts& persParts
00189 );
00190
00198 virtual AvailnSubscrPartSeq* getNextAvailnSubscrParts()
00199 throw (CORBA::SystemException);
00200
00215 AvailnSubscrPartSeq* getAvailnSubscrParts(
00216 const ProductPartId& id
00217 ) throw (CORBA::SystemException, OsbCorbaException);
00218
00229 AvailnSubscrPart* getAvailnSubscrPart(
00230 const ProductPartId& id
00231 ) throw (CORBA::SystemException, OsbCorbaException);
00232
00234 PersProdNodeSeq* getPersProdNodes()
00235 throw (CORBA::SystemException, OsbCorbaException);
00236
00244 PersProdNodeWriter_ptr getPersProdNode(
00245 const ProductPartId& id
00246 ) throw (CORBA::SystemException, OsbCorbaException);
00247
00260 CORBA::Boolean addPersProdNode(
00261 const ProductPartId& id,
00262 CORBA::Boolean noWait
00263 ) throw (CORBA::SystemException, OsbCorbaException);
00264
00277 CORBA::Boolean removePersProdNode(
00278 const ProductPartId& id,
00279 CORBA::Boolean noWait
00280 ) throw (CORBA::SystemException, OsbCorbaException);
00281
00297 CORBA::Boolean subscribe(
00298 const ProductPartId& id,
00299 CORBA::Boolean noWait
00300 ) throw (CORBA::SystemException, OsbCorbaException);
00301
00307 void setUserId(
00308 const AssociateId& id
00309 ) throw (CORBA::SystemException);
00310
00312 CORBA::Boolean commitChanges(
00313 CORBA::Boolean noWait
00314 ) throw (CORBA::SystemException, OsbCorbaException);
00315
00317
00318
00332 CORBA::Boolean changeStatus(
00333 StatusRequest& status,
00334 CORBA::Boolean noWait,
00335 CfgErrorSeq_out errors
00336 ) throw (CORBA::SystemException, OsbCorbaException);
00352 CORBA::Boolean changePartStatus(
00353 StatusRequest& status,
00354 const ProductPartId& id,
00355 CORBA::Boolean noWait,
00356 CfgErrorSeq_out errors
00357 ) throw (CORBA::SystemException, OsbCorbaException);
00359
00360 private:
00362 friend class PersProdNodeWriter_i;
00364 friend class PersProdItemWriter_i;
00365
00371 void ppiChanged(
00372 const OSB_DB::Session& session
00373 );
00379 void ppnChanged(
00380 const OSB_DB::Session& session
00381 );
00382
00384 ContractAdmin_i& cadmin();
00386 OSB_LIB::AnCList& ancList();
00387
00388 private:
00390 typedef std::list<Locators::Key> Servants;
00391
00393 AnCList_i& ancList_;
00395 ContractWriter_i& coServant_;
00401 OSB_LIB::PersProduct* persProduct_;
00403 Servants ppnServants_;
00405 Servants ansServants_;
00407 Locators::Key key_;
00408 };
00409
00413 class AvailnSubscrPart_i :
00414 public virtual POA_corba::cadmin::persprod::AvailnSubscrPart
00415 {
00416 public:
00417 static const std::string IFC;
00418
00420 AvailnSubscrPart_i(
00421 ContractAdmin_i& cadmin,
00422 PersProductWriter_i& ppServant,
00423 const OSB_LIB::PersPart& persPart
00424 );
00425
00431 ~AvailnSubscrPart_i();
00432 public:
00434 PersNodeId ppnId()
00435 throw (CORBA::SystemException);
00436
00438 ProductPartId ppId()
00439 throw (CORBA::SystemException);
00440
00442 CORBA::Long mandatory()
00443 throw (CORBA::SystemException);
00444
00446 CORBA::Boolean isSubscribed()
00447 throw (CORBA::SystemException);
00448
00456 CORBA::Boolean hasDefPersPart()
00457 throw (CORBA::SystemException);
00458
00466 PersProdItemWriter_ptr crePersPart()
00467 throw (CORBA::SystemException, OsbCorbaException);
00468
00469 public:
00471 const Locators::Key& key() const
00472 {
00473 return key_;
00474 }
00475
00476 private:
00478 typedef std::list<Locators::Key> Servants;
00479
00481 ContractAdmin_i& cadmin_;
00483 PersProductWriter_i& ppServant_;
00484
00486 OSB_LIB::PersPart persPart_;
00487
00489 Servants ppiServants_;
00491 Locators::Key key_;
00492 };
00493 }
00494
00495
00496
00497 namespace OSB_CORBA {
00498 }
00499 #endif // #ifndef _ASSOCIATE_I_H_