public GroupConsumerServiceImpl() throws MALException { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { GroupHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } }
/** * Registers all aspects of this area with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { org.ccsds.moims.mo.mal.MALContextFactory.registerArea(SOFTWAREMANAGEMENT_AREA); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.structures.Checksum.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.structures.factory.ChecksumFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.structures.ChecksumList.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.structures.factory.ChecksumListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(UNSUPPORTED_CHECKSUM_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("UNSUPPORTED_CHECKSUM")); }
/** * Initializes the MAL * * @throws org.ccsds.moims.mo.mal.MALException when there's an error during * the initialization of the MAL */ public void startMAL() throws MALException { malFactory = MALContextFactory.newFactory(); Properties props = new Properties(); props.putAll(System.getProperties()); mal = malFactory.createMALContext(props); consumerMgr = mal.createConsumerManager(); }
public PersistLatestServiceConfigurationAdapter(final ReconfigurableService service, final Long serviceConfigObjId, final ArchiveInheritanceSkeleton archiveService, final ExecutorService executor) { try { ConfigurationHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // if it was already initialized, then.. cool bro! } try { DirectoryHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // if it was already initialized, then.. cool bro! } this.archiveService = archiveService; this.serviceConfigObjId = serviceConfigObjId; this.executor = executor; }
/** * Finds a COMService from the fields area, areaVersion and serviceNumber * * @param area Area of the service * @param areaVersion Area version * @param serviceNumber Service number * @return COMService */ public static COMService findCOMService(UShort area, UOctet areaVersion, UShort serviceNumber) { return (COMService) MALContextFactory.lookupArea( area, areaVersion ).getServiceByNumber(serviceNumber); }
/** * Registers all aspects of this area with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { org.ccsds.moims.mo.mal.MALContextFactory.registerArea(COMMON_AREA); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.common.structures.ServiceKey.SHORT_FORM, new org.ccsds.moims.mo.common.structures.factory.ServiceKeyFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.common.structures.ServiceKeyList.SHORT_FORM, new org.ccsds.moims.mo.common.structures.factory.ServiceKeyListFactory()); }
/** * Registers all aspects of this service with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { MEMORYMANAGEMENT_SERVICE.addOperation(LOADMEMORY_OP); MEMORYMANAGEMENT_SERVICE.addOperation(DUMPMEMORY_OP); MEMORYMANAGEMENT_SERVICE.addOperation(ABORTMEMORYDUMP_OP); MEMORYMANAGEMENT_SERVICE.addOperation(CHECKMEMORY_OP); org.ccsds.moims.mo.softwaremanagement.SoftwareManagementHelper.SOFTWAREMANAGEMENT_AREA.addService(MEMORYMANAGEMENT_SERVICE); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlock.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.factory.DataBlockFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.DataBlockList.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.factory.DataBlockListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryArea.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.factory.MemoryAreaFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.MemoryAreaList.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.memorymanagement.structures.factory.MemoryAreaListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(UNKNOWN_DEVICE_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("UNKNOWN_DEVICE")); org.ccsds.moims.mo.mal.MALContextFactory.registerError(INVALID_ADDRESS_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("INVALID_ADDRESS")); }
public AppsLauncherManager(COMServicesProvider comServices) { super(comServices); // If there is a property for that, then use it!! if (System.getProperty(FOLDER_LOCATION_PROPERTY) != null) { apps_folder_path = new File(System.getProperty(FOLDER_LOCATION_PROPERTY)); } runnable_filename = osValidator.isWindows() ? RUN_WIN_FILENAME : RUN_LIN_FILENAME; try { AppsLauncherHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } if (super.getArchiveService() == null) { // No Archive? this.uniqueObjIdDef = new AtomicLong(0); } else { // With Archive... } }
/** * Returns the Name of the COM object from the objectType * * @param objType Object Type * @return Name of the COM object */ public static String objType2string(final ObjectType objType) { final COMObject comObject = HelperCOM.objType2COMObject(objType); String string = MALContextFactory.lookupArea( objType.getArea(), objType.getAreaVersion() ).getName().toString(); string += " - " + MALContextFactory.lookupArea( objType.getArea(), objType.getAreaVersion() ).getServiceByNumber(objType.getService()).getName().toString(); if (comObject != null) { string += ": " + comObject.getObjectName().getValue(); } return string; }
/** * Registers all aspects of this service with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { SOFTWAREIMAGE_SERVICE.addOperation(DEPLOYIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(CHECKIMAGEINTEGRITY_OP); SOFTWAREIMAGE_SERVICE.addOperation(CLONEIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(LISTIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(PATCHIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(ADDIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(DELETEIMAGE_OP); SOFTWAREIMAGE_SERVICE.addOperation(LISTPATCH_OP); SOFTWAREIMAGE_SERVICE.addOperation(ADDPATCH_OP); SOFTWAREIMAGE_SERVICE.addOperation(DELETEPATCH_OP); SOFTWAREIMAGE_SERVICE.addCOMObject(SOFTWAREIMAGE_OBJECT); SOFTWAREIMAGE_SERVICE.addCOMObject(PATCH_OBJECT); org.ccsds.moims.mo.softwaremanagement.SoftwareManagementHelper.SOFTWAREMANAGEMENT_AREA.addService(SOFTWAREIMAGE_SERVICE); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.ImageDefinition.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.factory.ImageDefinitionFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.ImageDefinitionList.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.factory.ImageDefinitionListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.PatchDefinition.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.factory.PatchDefinitionFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.PatchDefinitionList.SHORT_FORM, new org.ccsds.moims.mo.softwaremanagement.softwareimage.structures.factory.PatchDefinitionListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(DELETION_FAILED_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("DELETION_FAILED")); }
public ConversionConsumerServiceImpl() { try { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ConversionHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } catch (MALException ex) { Logger.getLogger(ConversionConsumerServiceImpl.class.getName()).log(Level.SEVERE, null, ex); } }
/** * Generates the corresponding MAL Element from a certain MAL Element List * * @param obj The MAL Element List * @return The MAL Element * @throws java.lang.Exception */ public static Element elementList2element(ElementList obj) throws Exception { if (obj == null) { return null; } long l = obj.getShortForm(); long ll = (-((l) & 0xFFFFFFL)) & 0xFFFFFFL + (l & 0xFFFFFFFFFF000000L); MALElementFactory eleFact = MALContextFactory.getElementFactoryRegistry().lookupElementFactory(ll); if (eleFact == null) { Logger.getLogger(HelperMisc.class.getName()).log(Level.SEVERE, "The element could not be found in the MAL ElementFactory! The object type is: '" + obj.getClass().getSimpleName() + "'. Maybe the service Helper for this object was not initialized. " + "Try initializing the Service Helper of this object."); } return (Element) eleFact.createElement(); }
/** * Finds and generates the COMObject from the ObjectType * * @param objType COM Object Type * @return COMObject object */ public static COMObject objType2COMObject(ObjectType objType) { if (objType == null) { return null; } if (objType.getService() == null) { return null; } COMService service = (COMService) MALContextFactory.lookupArea( objType.getArea(), objType.getAreaVersion() ).getServiceByNumber(objType.getService()); if (service == null || objType.getNumber().getValue() == 0) { // Special case for the event service... return null; } else { return service.getObjectByNumber(objType.getNumber()); } }
/** * Registers all aspects of this area with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { org.ccsds.moims.mo.mal.MALContextFactory.registerArea(PLATFORM_AREA); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.Vector3D.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.Vector3DFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.Vector3DList.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.Vector3DListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.WheelSpeed.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.WheelSpeedFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.WheelSpeedList.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.WheelSpeedListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.Quaternions.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.QuaternionsFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.structures.QuaternionsList.SHORT_FORM, new org.ccsds.moims.mo.platform.structures.factory.QuaternionsListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(DEVICE_IN_USE_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("DEVICE_IN_USE")); org.ccsds.moims.mo.mal.MALContextFactory.registerError(DEVICE_NOT_AVAILABLE_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("DEVICE_NOT_AVAILABLE")); }
bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.autonomousadcs.structures.AttitudeDefinitionNadirPointing.SHORT_FORM, new org.ccsds.moims.mo.platform.autonomousadcs.structures.factory.AttitudeDefinitionNadirPointingFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.autonomousadcs.structures.AttitudeDefinitionNadirPointingList.SHORT_FORM, new org.ccsds.moims.mo.platform.autonomousadcs.structures.factory.AttitudeDefinitionNadirPointingListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(ADCS_NOT_AVAILABLE_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("ADCS_NOT_AVAILABLE"));
malFactory = MALContextFactory.newFactory(); mal = malFactory.createMALContext(System.getProperties()); brokerMgr = mal.createBrokerManager();
/** * * @param archiveService * @throws org.ccsds.moims.mo.mal.MALException */ protected synchronized void init(ArchiveProviderServiceImpl archiveService) throws MALException { this.archiveService = archiveService; if (!initialiased) { if (MALContextFactory.lookupArea(MALHelper.MAL_AREA_NAME, MALHelper.MAL_AREA_VERSION) == null) { MALHelper.init(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(COMHelper.COM_AREA_NAME, COMHelper.COM_AREA_VERSION) == null) { COMHelper.deepInit(MALContextFactory.getElementFactoryRegistry()); } if (MALContextFactory.lookupArea(MCHelper.MC_AREA_NAME, MCHelper.MC_AREA_VERSION) == null) { MCHelper.init(MALContextFactory.getElementFactoryRegistry()); } try { ConversionHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } } initialiased = true; }
public ParameterManager(COMServicesProvider comServices, ParameterStatusListener parametersMonitoring) { super(comServices); try { ParameterHelper.init(MALContextFactory.getElementFactoryRegistry()); } catch (MALException ex) { // nothing to be done.. } this.parametersMonitoring = parametersMonitoring; if (super.getArchiveService() == null) { // No Archive? this.uniqueObjIdIdentity = new Long(0); // The zeroth value will not be used (reserved for the wildcard) this.uniqueObjIdDef = new Long(0); // The zeroth value will not be used (reserved for the wildcard) this.uniqueObjIdPVal = new Long(0); // The zeroth value will not be used (reserved for the wildcard) // this.load(); // Load the file } else { // With Archive... // Initialize the Conversion service try { this.conversionService.init(super.getArchiveService()); } catch (MALException ex) { Logger.getLogger(ParameterManager.class.getName()).log(Level.SEVERE, null, ex); } } }
/** * Finds the service name from the area, areaVersion and service numbers * * @param area Area of the service * @param areaVersion Area version of the service * @param service Service number * @return The name of the service * @throws org.ccsds.moims.mo.mal.MALException The area/service is Unknown */ public static String serviceKey2name(UShort area, UOctet areaVersion, UShort service) throws MALException { MALArea malArea = MALContextFactory.lookupArea(area, areaVersion); if (malArea == null) { throw new MALException("(" + area.getValue() + "," + areaVersion.getValue() + "," + service.getValue() + ") " + "Unknown area to the MAL! Maybe the API was not initialized."); } MALService malSer = malArea.getServiceByNumber(service); if (malSer == null) { throw new MALException("(" + area.getValue() + "," + areaVersion.getValue() + "," + service.getValue() + ") " + "Unknown service to the MAL! Maybe the API was not initialized."); } return malSer.getName().toString(); }
/** * Registers all aspects of this area with the provided element factory. * @param bodyElementFactory bodyElementFactory The element factory registry to initialise with this helper. * @throws org.ccsds.moims.mo.mal.MALException If cannot initialise this helper. */ public static void init(org.ccsds.moims.mo.mal.MALElementFactoryRegistry bodyElementFactory) throws org.ccsds.moims.mo.mal.MALException { org.ccsds.moims.mo.mal.MALContextFactory.registerArea(COM_AREA); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectType.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectTypeFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectTypeList.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectTypeListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectKey.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectKeyFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectKeyList.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectKeyListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectId.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectIdFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectIdList.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectIdListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectDetails.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectDetailsFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.ObjectDetailsList.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.ObjectDetailsListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.InstanceBooleanPair.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.InstanceBooleanPairFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.com.structures.InstanceBooleanPairList.SHORT_FORM, new org.ccsds.moims.mo.com.structures.factory.InstanceBooleanPairListFactory()); org.ccsds.moims.mo.mal.MALContextFactory.registerError(INVALID_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("INVALID")); org.ccsds.moims.mo.mal.MALContextFactory.registerError(DUPLICATE_ERROR_NUMBER, new org.ccsds.moims.mo.mal.structures.Identifier("DUPLICATE")); }