/** * Generates a COM ObjectType object from the MALService and Object number * * @param service MAL service * @param objNumber Object number * @return The ObjectType object */ public static ObjectType generateCOMObjectType(MALService service, UShort objNumber) { if (service == null || objNumber == null) { return null; } return new ObjectType(service.getArea().getNumber(), service.getNumber(), service.getArea().getVersion(), objNumber); }
/** * 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 { EVENT_SERVICE.addOperation(MONITOREVENT_OP); org.ccsds.moims.mo.com.COMHelper.COM_AREA.addService(EVENT_SERVICE); }
/** * 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); }
protected EndPointPair(final String localURI, final MALService service) { first = localURI; if (null != service) { second = (((long) service.getArea().getNumber().getValue()) << 32) + ((long) service.getNumber().getValue()); } else { second = null; } }
/** * 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; }
if (obj.getType().getArea().equals(serviceImpl.getCOMService().getArea().getNumber()) && obj.getType().getNumber().equals(serviceImpl.getCOMService().getNumber()) && obj.getKey().getDomain().equals(providerDomain)) {
serviceKeyList.add(new ServiceKey(service.getCOMService().getArea().getNumber(), service.getCOMService().getNumber(), service.getCOMService().getArea().getVersion()));
/** * 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 { OPTICALDATARECEIVER_SERVICE.addOperation(STREAMDATA_OP); OPTICALDATARECEIVER_SERVICE.addOperation(SETPUBLISHINGFREQUENCY_OP); org.ccsds.moims.mo.platform.PlatformHelper.PLATFORM_AREA.addService(OPTICALDATARECEIVER_SERVICE); }
/** * 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()); } }
@Override public MALMessage createMessage(final Blob authenticationId, final URI uriTo, final Time timestamp, final QoSLevel qosLevel, final UInteger priority, final IdentifierList domain, final Identifier networkZone, final SessionType session, final Identifier sessionName, final Long transactionId, final Boolean isErrorMessage, final MALOperation op, final UOctet interactionStage, final Map qosProperties, final Object... body) throws MALException { GENMessageHeader hdr = createMessageHeader(getURI(), authenticationId, uriTo, timestamp, qosLevel, priority, domain, networkZone, session, sessionName, op.getInteractionType(), interactionStage, transactionId, op.getService().getArea().getNumber(), op.getService().getNumber(), op.getNumber(), op.getService().getArea().getVersion(), isErrorMessage, qosProperties); try { return new TCPIPMessage(false, hdr, qosProperties, op, transport.getStreamFactory(), body); } catch (MALInteractionException e) { throw new MALException("Error creating message", e); } }
/** * 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 { HEARTBEAT_SERVICE.addOperation(BEAT_OP); HEARTBEAT_SERVICE.addOperation(GETPERIOD_OP); org.ccsds.moims.mo.softwaremanagement.SoftwareManagementHelper.SOFTWAREMANAGEMENT_AREA.addService(HEARTBEAT_SERVICE); }
/** * 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(); }
domain.add(new Identifier("*")); final ServiceKey serviceKey = new ServiceKey(eventCOM.getArea().getNumber(), eventCOM.getNumber(), eventCOM.getArea().getVersion()); final ServiceFilter sf = new ServiceFilter( new Identifier(NMFProvider.NANOSAT_MO_SUPERVISOR_NAME),
/** * 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 { POWERCONTROL_SERVICE.addOperation(LISTUNITSAVAILABLE_OP); POWERCONTROL_SERVICE.addOperation(ENABLEUNIT_OP); org.ccsds.moims.mo.platform.PlatformHelper.PLATFORM_AREA.addService(POWERCONTROL_SERVICE); }
if (null != area) MALService service = area.getServiceByNumber(header.getService()); if (null != service)
serviceKey.add(malService.getArea().getNumber().getValue()); // Area serviceKey.add((int) malService.getArea().getVersion().getValue()); // Version
/** * 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 { MAGNETOMETER_SERVICE.addOperation(GETMAGNETICFIELD_OP); org.ccsds.moims.mo.platform.PlatformHelper.PLATFORM_AREA.addService(MAGNETOMETER_SERVICE); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.magnetometer.structures.MagneticFieldInstance.SHORT_FORM, new org.ccsds.moims.mo.platform.magnetometer.structures.factory.MagneticFieldInstanceFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.magnetometer.structures.MagneticFieldInstanceList.SHORT_FORM, new org.ccsds.moims.mo.platform.magnetometer.structures.factory.MagneticFieldInstanceListFactory()); }
BaseInteractionImpl(final MessageSend sender, final Address address, final MALMessage msg) throws MALInteractionException { this.sender = sender; this.address = address; this.msg = msg; this.operation = MALContextFactory.lookupArea(msg.getHeader().getServiceArea(), msg.getHeader().getAreaVersion()) .getServiceByNumber(msg.getHeader().getService()) .getOperationByNumber(msg.getHeader().getOperation()); if (null == this.operation) { throw new MALInteractionException(new MALStandardError(MALHelper.UNSUPPORTED_OPERATION_ERROR_NUMBER, new Union(msg.getHeader().getServiceArea() + "::" + msg.getHeader().getService() + "::" + msg.getHeader().getOperation()))); } }
domain.add(new Identifier("*")); final COMService eventCOM = EventHelper.EVENT_SERVICE; ServiceKey serviceKey = new ServiceKey(eventCOM.getArea().getNumber(), eventCOM.getNumber(), eventCOM.getArea().getVersion()); ServiceFilter sf = new ServiceFilter(serviceProviderName, domain, new Identifier("*"), null, new Identifier("*"), serviceKey, new UIntegerList());
/** * 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 { SOFTWAREDEFINEDRADIO_SERVICE.addOperation(STREAMRADIO_OP); SOFTWAREDEFINEDRADIO_SERVICE.addOperation(ENABLESDR_OP); SOFTWAREDEFINEDRADIO_SERVICE.addOperation(UPDATECONFIGURATION_OP); org.ccsds.moims.mo.platform.PlatformHelper.PLATFORM_AREA.addService(SOFTWAREDEFINEDRADIO_SERVICE); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.softwaredefinedradio.structures.SDRConfiguration.SHORT_FORM, new org.ccsds.moims.mo.platform.softwaredefinedradio.structures.factory.SDRConfigurationFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.softwaredefinedradio.structures.SDRConfigurationList.SHORT_FORM, new org.ccsds.moims.mo.platform.softwaredefinedradio.structures.factory.SDRConfigurationListFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.softwaredefinedradio.structures.IQComponents.SHORT_FORM, new org.ccsds.moims.mo.platform.softwaredefinedradio.structures.factory.IQComponentsFactory()); bodyElementFactory.registerElementFactory(org.ccsds.moims.mo.platform.softwaredefinedradio.structures.IQComponentsList.SHORT_FORM, new org.ccsds.moims.mo.platform.softwaredefinedradio.structures.factory.IQComponentsListFactory()); }