org.ccsds.moims.mo.mal.structures.Blob.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(15.4k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.ccsds.moims.mo.mal.structures.Blob.<init>()方法的一些代码示例,展示了Blob.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Blob.<init>()方法的具体详情如下:
包路径:org.ccsds.moims.mo.mal.structures.Blob
类名称:Blob
方法名:<init>

Blob.<init>介绍

暂无

代码示例

代码示例来源:origin: int.esa.ccsds.mo/TRANSPORT_JMS

public JMSBrokerBinding(URI uri, String localName, Blob authenticationId, QoSLevel[] expectedQos, UInteger priorityLevelNumber)
{
 this.uri = uri;
 this.localName = localName;
 this.authenticationId = new Blob(JMSTransport.authId);
 this.expectedQos = expectedQos;
 this.priorityLevelNumber = priorityLevelNumber;
}

代码示例来源:origin: int.esa.ccsds.mo/ENCODING_GEN

@Override
public Blob decodeBlob() throws MALException
{
 return new Blob(sourceBuffer.getBytes());
}

代码示例来源:origin: int.esa.nmf.core.moservices.impl/ccsds-com

@Override
public Blob decodeBlob() throws MALException
{
 return new Blob(sourceBuffer.getBytes());
}

代码示例来源:origin: int.esa.ccsds.mo/TRANSPORT_GEN

@Override
public MALEncodedElement getEncodedBodyElement(final int index) throws MALException
{
 if (-1 == index)
 {
  // want the complete message body
  return new MALEncodedElement((Blob) encBodyElements.readElement(new Blob(), null));
 }
 else
 {
  return null;
 }
}

代码示例来源:origin: int.esa.nmf.core.moservices.impl/ccsds-com

public void sendUpdateToConsumer(int index, byte[] aChunk) {
  chunksFlushed.add(index, aChunk);
  try {
    interaction.sendUpdate(new Blob(aChunk), new UInteger(index));
  } catch (MALInteractionException ex) {
    Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
  } catch (MALException ex) {
    Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
  }
}

代码示例来源:origin: int.esa.nmf.core/helper-tools

return new Blob(serialBytesOut);

代码示例来源:origin: int.esa.nmf.core.moservices.impl/ccsds-com

@Override
public Blob decodeNullableBlob() throws MALException
{
 final int len = sourceBuffer.getSignedInt();
 if (len >= 0)
 {
  return new Blob(sourceBuffer.directGetBytes(len));
 }
 return null;
}

代码示例来源:origin: int.esa.ccsds.mo/TRANSPORT_GEN

@Override
public MALEncodedBody getEncodedBody() throws MALException
{
 if (!decodedBody && (encBodyElements instanceof GENElementInputStream))
 {
  byte[] rd = ((GENElementInputStream) encBodyElements).getRemainingEncodedData();
  if ((null != encBodyBytes) && (0 < encBodyBytes.available()))
  {
   byte[] c = new byte[rd.length + encBodyBytes.available()];
   System.arraycopy(rd, 0, c, 0, rd.length);
   encBodyBytes.mark(0);
   encBodyBytes.read(c, rd.length, encBodyBytes.available());
   encBodyBytes.reset();
   
   rd = c;
  }
  return new MALEncodedBody(new Blob(rd));
 }
 else
 {
  throw new UnsupportedOperationException("Not supported yet.");
 }
}

代码示例来源:origin: int.esa.ccsds.mo/ENCODING_STRING

@Override
 public Blob encode(final Object[] elements, final MALEncodingContext ctx) throws MALException
 {
  final ByteArrayOutputStream baos = new ByteArrayOutputStream();
  
  final MALElementOutputStream os = createOutputStream(baos);
  
  for (int i = 0; i < elements.length; i++)
  {
   os.writeElement(elements[i], ctx);
  }
  
  os.flush();
  
  return new Blob(baos.toByteArray());
 }
}

代码示例来源:origin: int.esa.ccsds.mo/TRANSPORT_TCPIP

@Override
public Blob decodeBlob() throws MALException {
  int sz = (int) decodeUInteger().getValue();
  if (sz == 0) {
    return null;
  }
  return new Blob(sourceBuffer.directGetBytes(sz));
}

代码示例来源:origin: int.esa.nmf.core/helper-tools

brokerName,
System.getProperties().getProperty("org.ccsds.moims.mo.mal.transport.default.protocol"),
new Blob("".getBytes()),
new QoSLevel[]{QoSLevel.ASSURED},
new UInteger(1),

代码示例来源:origin: int.esa.nmf.core/helper-tools

uriB,
malService,
new Blob("".getBytes()),
domain,
configuration.getNetwork(),

代码示例来源:origin: int.esa.nmf.core/helper-tools

uriB,
malService,
new Blob("".getBytes()),
domain,
configuration.getNetwork(),

代码示例来源:origin: int.esa.nmf.core.moservices.impl/ccsds-com

@Override
public void retrieveRangeAgain(final Long transactionTicket, final UIntegerList missingIndexes,
    final RetrieveRangeAgainInteraction interaction) throws MALInteractionException, MALException {
  final Dispatcher dispatcher = dispatchers.get(transactionTicket);
  if (dispatcher == null) {
    throw new MALInteractionException(new MALStandardError(COMHelper.INVALID_ERROR_NUMBER, null));
  }
  interaction.sendAcknowledgement();
  if (missingIndexes.size() == 2 && missingIndexes.get(1).getValue() == 0) {
    // Special case! The condition means that we need to retransmit
    // everything since the value in missingIndexes.get(0)
    UInteger lastIndex = missingIndexes.get(0);
    try {
      int numberOfChunks = dispatcher.numberOfChunks();
      for (int i = (int) lastIndex.getValue(); i < numberOfChunks; i++) {
        byte[] chunk = dispatcher.getFlushedChunk(i);
        interaction.sendUpdate(new Blob(chunk), new UInteger(i));
      }
    } catch (IOException ex) {
      Logger.getLogger(ArchiveSyncProviderServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
    }
  } else {
    for (UInteger missingIndex : missingIndexes) {
      byte[] chunk = dispatcher.getFlushedChunk((short) missingIndex.getValue());
      interaction.sendUpdate(new Blob(chunk), missingIndex);
    }
  }
  interaction.sendResponse();
}

代码示例来源:origin: int.esa.nmf.core.moservices.api/software-management

/**
 * Called by the MAL when an INVOKE response is received from a provider.
 * @param msgHeader msgHeader The header of the received message.
 * @param body body The body of the received message.
 * @param qosProperties qosProperties The QoS properties associated with the message.
 * @throws org.ccsds.moims.mo.mal.MALException if an error is detected processing the message.
 */
public final void invokeResponseReceived(org.ccsds.moims.mo.mal.transport.MALMessageHeader msgHeader, org.ccsds.moims.mo.mal.transport.MALMessageBody body, java.util.Map qosProperties) throws org.ccsds.moims.mo.mal.MALException
{
 switch (msgHeader.getOperation().getValue())
 {
  case org.ccsds.moims.mo.softwaremanagement.memorymanagement.MemoryManagementHelper._CHECKMEMORY_OP_NUMBER:
   checkMemoryResponseReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), qosProperties);
   break;
  default:
   throw new org.ccsds.moims.mo.mal.MALException("Consumer adapter was not expecting operation number " + msgHeader.getOperation().getValue());
 }
}

代码示例来源:origin: int.esa.nmf.core.moservices.api/com-nmf

/**
 * Called by the MAL when a PROGRESS update is received from a provider.
 * @param msgHeader msgHeader The header of the received message.
 * @param body body The body of the received message.
 * @param qosProperties qosProperties The QoS properties associated with the message.
 * @throws org.ccsds.moims.mo.mal.MALException if an error is detected processing the message.
 */
public final void progressUpdateReceived(org.ccsds.moims.mo.mal.transport.MALMessageHeader msgHeader, org.ccsds.moims.mo.mal.transport.MALMessageBody body, java.util.Map qosProperties) throws org.ccsds.moims.mo.mal.MALException
{
 switch (msgHeader.getOperation().getValue())
 {
  case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGE_OP_NUMBER:
   retrieveRangeUpdateReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), qosProperties);
   break;
  case org.ccsds.moims.mo.com.archivesync.ArchiveSyncHelper._RETRIEVERANGEAGAIN_OP_NUMBER:
   retrieveRangeAgainUpdateReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (org.ccsds.moims.mo.mal.structures.UInteger) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.UInteger()), qosProperties);
   break;
  default:
   throw new org.ccsds.moims.mo.mal.MALException("Consumer adapter was not expecting operation number " + msgHeader.getOperation().getValue());
 }
}

代码示例来源:origin: int.esa.ccsds.mo/API_COMMON

/**
  * The login operation allows a user to log in to the system. A user can log in more than once by using a different role; however, a specific deployment may place limits on the number of users that may use a specific role, and in that case will fail the login operation.
  * @param userDetails The userDetails field shall contain the details of the new user and role combination.
If the username field of the supplied Profile structure is either the wildcard '*' or empty an INVALID error shall be returned.
If roles are required by the system and the role field of the supplied Profile structure is NULL then an INVALID error shall be returned.
The role field of the supplied Profile structure may be NULL if roles are not used by the system.
An UNKNOWN error shall be returned if the username, password and role combination are not correct for the system i.e. unknown user/role or incorrect password.
A DUPLICATE error shall be returned if the username and role combination is currently in use.
A TOO_MANY error shall be returned if the username or role are already used and exceed the permitted maximum usage value (deployment dependent).
If the login is successful the provider shall create a new LoginInstance COM object and store it in the COM archive.
The related link of the new LoginInstance COM object shall be set to the requested LoginRole COM object.
A LoginEvent COM event shall be generated at this point.
  * @param password password Argument number 1 as defined by the service operation.
  * @return The return value of the interaction.
  * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a problem during the interaction as defined by the MAL specification.
  * @throws org.ccsds.moims.mo.mal.MALException if there is an implementation exception.
  */
 public org.ccsds.moims.mo.common.login.body.LoginResponse login(org.ccsds.moims.mo.common.login.structures.Profile userDetails, String password) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException
 {
  org.ccsds.moims.mo.mal.transport.MALMessageBody body = consumer.request(org.ccsds.moims.mo.common.login.LoginHelper.LOGIN_OP, userDetails, (password == null) ? null : new org.ccsds.moims.mo.mal.structures.Union(password));
  Object body0 = (Object) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob());
  Object body1 = (Object) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE));
  return new org.ccsds.moims.mo.common.login.body.LoginResponse((org.ccsds.moims.mo.mal.structures.Blob) body0, (body1 == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body1).getLongValue());
 }

代码示例来源:origin: int.esa.ccsds.mo/API_COMMON

/**
  * The handover operation allows an existing login to be transferred to a new user. Two cases are expected here, the first is where the operation is used to change the user's current role, and the second is where an operations context is handed over to another user.
  * @param newUserDetails The newUserDetails field shall contain the details of the new user and role combination.
If the username field of the supplied Profile structure is either NULL, the wildcard '*', or empty an INVALID error shall be returned.
If roles are required by the system and the role field of the supplied Profile structure is NULL then an INVALID error shall be returned.
The role field of the supplied Profile structure may be NULL if roles are not used by the system.
An UNKNOWN error shall be returned if the username, password and role combination are not correct for the system i.e. unknown user/role or incorrect password.
A DUPLICATE error shall be returned if the username and role combination is currently in use.
A TOO_MANY error shall be returned if the username or role are already used and exceed the permitted maximum usage value (deployment dependent).
The DUPLICATE and TOO_MANY checks shall take into account the fact that current operator/role combination will be logged out after the handover operation completes.
If the handover is successful the provider shall create a new LoginInstance COM object and store it in the COM archive.
The related link of the new LoginInstance COM object shall be set to the requested LoginRole COM object.
The source link of the new LoginInstance COM object shall be set to the LoginInstance COM object that represents the previous login.
If the handover operation is successful a LogoutEvent COM event shall be generated for the previous login and a LoginEvent COM event shall be generated for the new login.
  * @param newUserPassword newUserPassword Argument number 1 as defined by the service operation.
  * @return The return value of the interaction.
  * @throws org.ccsds.moims.mo.mal.MALInteractionException if there is a problem during the interaction as defined by the MAL specification.
  * @throws org.ccsds.moims.mo.mal.MALException if there is an implementation exception.
  */
 public org.ccsds.moims.mo.common.login.body.HandoverResponse handover(org.ccsds.moims.mo.common.login.structures.Profile newUserDetails, String newUserPassword) throws org.ccsds.moims.mo.mal.MALInteractionException, org.ccsds.moims.mo.mal.MALException
 {
  org.ccsds.moims.mo.mal.transport.MALMessageBody body = consumer.request(org.ccsds.moims.mo.common.login.LoginHelper.HANDOVER_OP, newUserDetails, (newUserPassword == null) ? null : new org.ccsds.moims.mo.mal.structures.Union(newUserPassword));
  Object body0 = (Object) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob());
  Object body1 = (Object) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE));
  return new org.ccsds.moims.mo.common.login.body.HandoverResponse((org.ccsds.moims.mo.mal.structures.Blob) body0, (body1 == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body1).getLongValue());
 }

代码示例来源:origin: int.esa.ccsds.mo/API_COMMON

/**
 * Called by the MAL when a REQUEST response is received from a provider.
 * @param msgHeader msgHeader The header of the received message.
 * @param body body The body of the received message.
 * @param qosProperties qosProperties The QoS properties associated with the message.
 * @throws org.ccsds.moims.mo.mal.MALException if an error is detected processing the message.
 */
public final void requestResponseReceived(org.ccsds.moims.mo.mal.transport.MALMessageHeader msgHeader, org.ccsds.moims.mo.mal.transport.MALMessageBody body, java.util.Map qosProperties) throws org.ccsds.moims.mo.mal.MALException
{
 switch (msgHeader.getOperation().getValue())
 {
  case org.ccsds.moims.mo.common.login.LoginHelper._LOGIN_OP_NUMBER:
   loginResponseReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE)) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE))).getLongValue(), qosProperties);
   break;
  case org.ccsds.moims.mo.common.login.LoginHelper._LISTROLES_OP_NUMBER:
   listRolesResponseReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.LongList) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.LongList()), qosProperties);
   break;
  case org.ccsds.moims.mo.common.login.LoginHelper._HANDOVER_OP_NUMBER:
   handoverResponseReceived(msgHeader, (org.ccsds.moims.mo.mal.structures.Blob) body.getBodyElement(0, new org.ccsds.moims.mo.mal.structures.Blob()), (body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE)) == null) ? null : ((org.ccsds.moims.mo.mal.structures.Union) body.getBodyElement(1, new org.ccsds.moims.mo.mal.structures.Union(Long.MAX_VALUE))).getLongValue(), qosProperties);
   break;
  default:
   throw new org.ccsds.moims.mo.mal.MALException("Consumer adapter was not expecting operation number " + msgHeader.getOperation().getValue());
 }
}

代码示例来源:origin: int.esa.ccsds.mo/TRANSPORT_JMS

static GENMessageHeader createReturnHeader(MALMessage sourceMessage, boolean isError, short stage)
{
 GENMessageHeader hdr = new GENMessageHeader();
 MALMessageHeader srcHdr = sourceMessage.getHeader();
 hdr.setURIFrom(srcHdr.getURITo());
 hdr.setURITo(srcHdr.getURIFrom());
 hdr.setAuthenticationId(new Blob(JMSTransport.authId));
 hdr.setTimestamp(new Time(new java.util.Date().getTime()));
 hdr.setQoSlevel(srcHdr.getQoSlevel());
 hdr.setPriority(srcHdr.getPriority());
 hdr.setDomain(srcHdr.getDomain());
 hdr.setNetworkZone(srcHdr.getNetworkZone());
 hdr.setSession(srcHdr.getSession());
 hdr.setSessionName(srcHdr.getSessionName());
 hdr.setInteractionType(srcHdr.getInteractionType());
 hdr.setInteractionStage(new UOctet(stage));
 hdr.setTransactionId(srcHdr.getTransactionId());
 hdr.setServiceArea(srcHdr.getServiceArea());
 hdr.setService(srcHdr.getService());
 hdr.setOperation(srcHdr.getOperation());
 hdr.setAreaVersion(srcHdr.getAreaVersion());
 hdr.setIsErrorMessage(isError);
 return hdr;
}

相关文章