다음을 통해 공유


ServiceRemotingMessageHeaders Class

  • java.lang.Object
    • Serializable
      • microsoft.servicefabric.services.remoting.ServiceRemotingMessageHeaders

public class ServiceRemotingMessageHeaders

Specifies the headers that are sent along with a ServiceRemoting message.

Constructor Summary

Constructor Description
ServiceRemotingMessageHeaders()

Method Summary

Modifier and Type Method and Description
void addHeader(String headerName, byte[] headerValue)

Adds a new header with the specified name and value.

ServiceRemotingMessageHeaders deserialize(byte[] buffer)

De-serializes the byte array to a ServiceRemotingMessageHeaders object

String getCallContext()
String getCancellationHeaderName()
HashMap<String, byte[]> getHeaders()
byte [] getHeaderValue(String headerName)

Gets the header with the specified name

int getInterfaceId()

The interface id of the remote interface.

int getMethodId()

The methodId of the remote method

byte [] serialize(ServiceRemotingMessageHeaders msg)

Serializes the headers to a byte array

void setCallContext(String callContext)
void setHeaders(HashMap<String, byte[]> headers)

Adds a new header with the specified name and value.

void setInterfaceId(int interfaceId)

The interface id of the remote interface.

void setMethodId(int methodId)

The methodId of the remote method

Constructor Details

ServiceRemotingMessageHeaders

public ServiceRemotingMessageHeaders()

Method Details

addHeader

public void addHeader(String headerName, byte[] headerValue)

Adds a new header with the specified name and value.

Parameters:

headerName - Header Name
headerValue - header value

Throws:

FabricElementAlreadyExistsException - Throws FabricElementAlreadyExistsException if a header with the same name already exists.

deserialize

public static ServiceRemotingMessageHeaders deserialize(byte[] buffer)

De-serializes the byte array to a ServiceRemotingMessageHeaders object

Parameters:

buffer - buffer

Returns:

De-serialized headers

Throws:

IOException - throws IOException
ClassNotFoundException - throws ClassNotFoundException

getCallContext

public String getCallContext()

getCancellationHeaderName

public static String getCancellationHeaderName()

getHeaders

public HashMap getHeaders()

getHeaderValue

public byte [] getHeaderValue(String headerName)

Gets the header with the specified name

Parameters:

headerName - Header Name

Returns:

Header value

getInterfaceId

public int getInterfaceId()

The interface id of the remote interface.

Returns:

Interface id

getMethodId

public int getMethodId()

The methodId of the remote method

Returns:

Method id

serialize

public static byte [] serialize(ServiceRemotingMessageHeaders msg)

Serializes the headers to a byte array

Parameters:

msg - Headers

Returns:

The serialized byte array

Throws:

IOException - Throws IOException.

setCallContext

public void setCallContext(String callContext)

Parameters:

callContext

setHeaders

public void setHeaders(HashMap headers)

Adds a new header with the specified name and value.

Parameters:

headers - Header Name

setInterfaceId

public void setInterfaceId(int interfaceId)

The interface id of the remote interface.

Parameters:

interfaceId - interface Id

setMethodId

public void setMethodId(int methodId)

The methodId of the remote method

Parameters:

methodId - method Id

Applies to