repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java | RtcpPacketFactory.buildReceiverReport | private static RtcpReceiverReport buildReceiverReport(RtpStatistics statistics, boolean padding) {
RtcpReceiverReport report = new RtcpReceiverReport(padding, statistics.getSsrc());
long ssrc = statistics.getSsrc();
// Add receiver reports for each registered member
List<Long> members = statistics.getMembers... | java | private static RtcpReceiverReport buildReceiverReport(RtpStatistics statistics, boolean padding) {
RtcpReceiverReport report = new RtcpReceiverReport(padding, statistics.getSsrc());
long ssrc = statistics.getSsrc();
// Add receiver reports for each registered member
List<Long> members = statistics.getMembers... | [
"private",
"static",
"RtcpReceiverReport",
"buildReceiverReport",
"(",
"RtpStatistics",
"statistics",
",",
"boolean",
"padding",
")",
"{",
"RtcpReceiverReport",
"report",
"=",
"new",
"RtcpReceiverReport",
"(",
"padding",
",",
"statistics",
".",
"getSsrc",
"(",
")",
... | Builds a packet containing an RTCP Receiver Report
@param statistics
The statistics of the RTP session
@return The RTCP packet | [
"Builds",
"a",
"packet",
"containing",
"an",
"RTCP",
"Receiver",
"Report"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java#L118-L132 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java | RtcpPacketFactory.buildReport | public static RtcpPacket buildReport(RtpStatistics statistics) {
// TODO Validate padding
boolean padding = false;
// Build the initial report packet
RtcpReport report;
if(statistics.hasSent()) {
report = buildSenderReport(statistics, padding);
} else {
report = buildReceiverReport(statistics, pad... | java | public static RtcpPacket buildReport(RtpStatistics statistics) {
// TODO Validate padding
boolean padding = false;
// Build the initial report packet
RtcpReport report;
if(statistics.hasSent()) {
report = buildSenderReport(statistics, padding);
} else {
report = buildReceiverReport(statistics, pad... | [
"public",
"static",
"RtcpPacket",
"buildReport",
"(",
"RtpStatistics",
"statistics",
")",
"{",
"// TODO Validate padding",
"boolean",
"padding",
"=",
"false",
";",
"// Build the initial report packet",
"RtcpReport",
"report",
";",
"if",
"(",
"statistics",
".",
"hasSent"... | Builds a packet containing an RTCP Report.
RTP receivers provide reception quality feedback using RTCP report
packets which may take one of two forms depending upon whether or not the
receiver is also a sender. The only difference between the sender report
(SR) and receiver report (RR) forms, besides the packet type c... | [
"Builds",
"a",
"packet",
"containing",
"an",
"RTCP",
"Report",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java#L192-L209 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java | RtcpPacketFactory.buildBye | public static RtcpPacket buildBye(RtpStatistics statistics) {
// TODO Validate padding
boolean padding = false;
// Build the initial report packet
RtcpReport report;
if(statistics.hasSent()) {
report = buildSenderReport(statistics, padding);
} else {
report = buildReceiverReport(statistics, paddin... | java | public static RtcpPacket buildBye(RtpStatistics statistics) {
// TODO Validate padding
boolean padding = false;
// Build the initial report packet
RtcpReport report;
if(statistics.hasSent()) {
report = buildSenderReport(statistics, padding);
} else {
report = buildReceiverReport(statistics, paddin... | [
"public",
"static",
"RtcpPacket",
"buildBye",
"(",
"RtpStatistics",
"statistics",
")",
"{",
"// TODO Validate padding",
"boolean",
"padding",
"=",
"false",
";",
"// Build the initial report packet",
"RtcpReport",
"report",
";",
"if",
"(",
"statistics",
".",
"hasSent",
... | Builds a packet containing an RTCP BYE message.
@param statistics
The statistics of the RTP session
@return The RTCP packet | [
"Builds",
"a",
"packet",
"containing",
"an",
"RTCP",
"BYE",
"message",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtcp/RtcpPacketFactory.java#L218-L239 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java | IceComponent.addLocalCandidates | public void addLocalCandidates(List<LocalCandidateWrapper> candidatesWrapper) {
for (LocalCandidateWrapper candidateWrapper : candidatesWrapper) {
addLocalCandidate(candidateWrapper, false);
}
sortCandidates();
} | java | public void addLocalCandidates(List<LocalCandidateWrapper> candidatesWrapper) {
for (LocalCandidateWrapper candidateWrapper : candidatesWrapper) {
addLocalCandidate(candidateWrapper, false);
}
sortCandidates();
} | [
"public",
"void",
"addLocalCandidates",
"(",
"List",
"<",
"LocalCandidateWrapper",
">",
"candidatesWrapper",
")",
"{",
"for",
"(",
"LocalCandidateWrapper",
"candidateWrapper",
":",
"candidatesWrapper",
")",
"{",
"addLocalCandidate",
"(",
"candidateWrapper",
",",
"false"... | Registers a collection of local candidates to the component.
@param candidatesWrapper
The list of local candidates
@see IceComponent#addLocalCandidate(LocalCandidateWrapper) | [
"Registers",
"a",
"collection",
"of",
"local",
"candidates",
"to",
"the",
"component",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java#L91-L96 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java | IceComponent.addLocalCandidate | private void addLocalCandidate(LocalCandidateWrapper candidateWrapper, boolean sort) {
IceCandidate candidate = candidateWrapper.getCandidate();
// Configure the candidate before registration
candidate.setPriority(calculatePriority(candidate));
synchronized (this.localCandidates) {
if (!this.localCandidate... | java | private void addLocalCandidate(LocalCandidateWrapper candidateWrapper, boolean sort) {
IceCandidate candidate = candidateWrapper.getCandidate();
// Configure the candidate before registration
candidate.setPriority(calculatePriority(candidate));
synchronized (this.localCandidates) {
if (!this.localCandidate... | [
"private",
"void",
"addLocalCandidate",
"(",
"LocalCandidateWrapper",
"candidateWrapper",
",",
"boolean",
"sort",
")",
"{",
"IceCandidate",
"candidate",
"=",
"candidateWrapper",
".",
"getCandidate",
"(",
")",
";",
"// Configure the candidate before registration",
"candidate... | Attempts to registers a local candidate.
@param candidateWrapper
The wrapper that contains the local ICE candidate
@param sort
Decides whether the candidates list should be ordered after
insert | [
"Attempts",
"to",
"registers",
"a",
"local",
"candidate",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceComponent.java#L117-L129 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.getNetworkInterfaces | private Enumeration<NetworkInterface> getNetworkInterfaces() throws HarvestException {
try {
return NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
throw new HarvestException("Could not retrieve list of available Network Interfaces.", e);
}
} | java | private Enumeration<NetworkInterface> getNetworkInterfaces() throws HarvestException {
try {
return NetworkInterface.getNetworkInterfaces();
} catch (SocketException e) {
throw new HarvestException("Could not retrieve list of available Network Interfaces.", e);
}
} | [
"private",
"Enumeration",
"<",
"NetworkInterface",
">",
"getNetworkInterfaces",
"(",
")",
"throws",
"HarvestException",
"{",
"try",
"{",
"return",
"NetworkInterface",
".",
"getNetworkInterfaces",
"(",
")",
";",
"}",
"catch",
"(",
"SocketException",
"e",
")",
"{",
... | Finds all Network interfaces available on this server.
@return The list of available network interfaces.
@throws HarvestException
When an error occurs while retrieving the network interfaces | [
"Finds",
"all",
"Network",
"interfaces",
"available",
"on",
"this",
"server",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L71-L77 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.useNetworkInterface | private boolean useNetworkInterface(NetworkInterface networkInterface) throws HarvestException {
try {
return !networkInterface.isLoopback() && networkInterface.isUp();
} catch (SocketException e) {
throw new HarvestException("Could not evaluate whether network interface is loopback.", e);
}
} | java | private boolean useNetworkInterface(NetworkInterface networkInterface) throws HarvestException {
try {
return !networkInterface.isLoopback() && networkInterface.isUp();
} catch (SocketException e) {
throw new HarvestException("Could not evaluate whether network interface is loopback.", e);
}
} | [
"private",
"boolean",
"useNetworkInterface",
"(",
"NetworkInterface",
"networkInterface",
")",
"throws",
"HarvestException",
"{",
"try",
"{",
"return",
"!",
"networkInterface",
".",
"isLoopback",
"(",
")",
"&&",
"networkInterface",
".",
"isUp",
"(",
")",
";",
"}",... | Decides whether a certain network interface can be used as a host
candidate.
@param networkInterface
The network interface to evaluate
@return <code>true</code> if the interface can be used. Returns
<code>false</code>, otherwise.
@throws HarvestException
When an error occurs while inspecting the interface. | [
"Decides",
"whether",
"a",
"certain",
"network",
"interface",
"can",
"be",
"used",
"as",
"a",
"host",
"candidate",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L90-L96 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.findAddresses | private List<InetAddress> findAddresses() throws HarvestException {
// Stores found addresses
List<InetAddress> found = new ArrayList<InetAddress>(3);
// Retrieve list of available network interfaces
Enumeration<NetworkInterface> interfaces = getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
... | java | private List<InetAddress> findAddresses() throws HarvestException {
// Stores found addresses
List<InetAddress> found = new ArrayList<InetAddress>(3);
// Retrieve list of available network interfaces
Enumeration<NetworkInterface> interfaces = getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
... | [
"private",
"List",
"<",
"InetAddress",
">",
"findAddresses",
"(",
")",
"throws",
"HarvestException",
"{",
"// Stores found addresses",
"List",
"<",
"InetAddress",
">",
"found",
"=",
"new",
"ArrayList",
"<",
"InetAddress",
">",
"(",
"3",
")",
";",
"// Retrieve li... | Finds available addresses that will be used to gather candidates from.
@return A list of collected addresses.
@throws HarvestException
If an error occurs while searching for available addresses | [
"Finds",
"available",
"addresses",
"that",
"will",
"be",
"used",
"to",
"gather",
"candidates",
"from",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L105-L137 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.openUdpChannel | private DatagramChannel openUdpChannel(InetAddress localAddress, int port, Selector selector) throws IOException {
DatagramChannel channel = DatagramChannel.open();
channel.configureBlocking(false);
// Register selector for reading operations
channel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRI... | java | private DatagramChannel openUdpChannel(InetAddress localAddress, int port, Selector selector) throws IOException {
DatagramChannel channel = DatagramChannel.open();
channel.configureBlocking(false);
// Register selector for reading operations
channel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRI... | [
"private",
"DatagramChannel",
"openUdpChannel",
"(",
"InetAddress",
"localAddress",
",",
"int",
"port",
",",
"Selector",
"selector",
")",
"throws",
"IOException",
"{",
"DatagramChannel",
"channel",
"=",
"DatagramChannel",
".",
"open",
"(",
")",
";",
"channel",
"."... | Opens a datagram channel and binds it to an address.
@param localAddress
The address to bind the channel to.
@param port
The port to use
@return The bound datagram channel
@throws IOException
When an error occurs while binding the datagram channel. | [
"Opens",
"a",
"datagram",
"channel",
"and",
"binds",
"it",
"to",
"an",
"address",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L150-L157 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java | HostCandidateHarvester.gatherCandidate | private boolean gatherCandidate(IceComponent component, InetAddress address, int startingPort, RtpPortManager portManager, Selector selector) {
// Recursion stop criteria
if(startingPort == portManager.peek()) {
return false;
}
// Gather the candidate using current port
try {
int port = portManager.c... | java | private boolean gatherCandidate(IceComponent component, InetAddress address, int startingPort, RtpPortManager portManager, Selector selector) {
// Recursion stop criteria
if(startingPort == portManager.peek()) {
return false;
}
// Gather the candidate using current port
try {
int port = portManager.c... | [
"private",
"boolean",
"gatherCandidate",
"(",
"IceComponent",
"component",
",",
"InetAddress",
"address",
",",
"int",
"startingPort",
",",
"RtpPortManager",
"portManager",
",",
"Selector",
"selector",
")",
"{",
"// Recursion stop criteria",
"if",
"(",
"startingPort",
... | Gathers a candidate and registers it in the respective ICE Component. A
datagram channel will be bound to the local candidate address.
@param component
The component the candidate belongs to
@param address
The address of the candidate
@param startingPort
The preferred port for the candidate to use.<br>
The candidate p... | [
"Gathers",
"a",
"candidate",
"and",
"registers",
"it",
"in",
"the",
"respective",
"ICE",
"Component",
".",
"A",
"datagram",
"channel",
"will",
"be",
"bound",
"to",
"the",
"local",
"candidate",
"address",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/harvest/HostCandidateHarvester.java#L213-L232 | train |
RestComm/media-core | codec/g729/src/main/java/org/restcomm/media/core/codec/g729/Encoder.java | Encoder.process | public byte[] process(byte[] media) {
frame++;
float[] new_speech = new float[media.length];
short[] shortMedia = Util.byteArrayToShortArray(media);
for (int i = 0; i < LD8KConstants.L_FRAME; i++) {
new_speech[i] = (float) shortMedia[i];
}
preProc.pre_process... | java | public byte[] process(byte[] media) {
frame++;
float[] new_speech = new float[media.length];
short[] shortMedia = Util.byteArrayToShortArray(media);
for (int i = 0; i < LD8KConstants.L_FRAME; i++) {
new_speech[i] = (float) shortMedia[i];
}
preProc.pre_process... | [
"public",
"byte",
"[",
"]",
"process",
"(",
"byte",
"[",
"]",
"media",
")",
"{",
"frame",
"++",
";",
"float",
"[",
"]",
"new_speech",
"=",
"new",
"float",
"[",
"media",
".",
"length",
"]",
";",
"short",
"[",
"]",
"shortMedia",
"=",
"Util",
".",
"... | Perform compression.
@param input
media
@return compressed media. | [
"Perform",
"compression",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/codec/g729/src/main/java/org/restcomm/media/core/codec/g729/Encoder.java#L123-L140 | train |
RestComm/media-core | client/jsr-309/driver/src/main/java/org/restcomm/mscontrol/sdp/SessionDescriptor.java | SessionDescriptor.exclude | public void exclude(String formatName) {
for (int i = 0; i < count; i++) {
md[i].exclude(formatName);
}
} | java | public void exclude(String formatName) {
for (int i = 0; i < count; i++) {
md[i].exclude(formatName);
}
} | [
"public",
"void",
"exclude",
"(",
"String",
"formatName",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"md",
"[",
"i",
"]",
".",
"exclude",
"(",
"formatName",
")",
";",
"}",
"}"
] | Excludes specified formats from descriptor.
@param formatName the name of the format. | [
"Excludes",
"specified",
"formats",
"from",
"descriptor",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/mscontrol/sdp/SessionDescriptor.java#L184-L188 | train |
RestComm/media-core | client/jsr-309/driver/src/main/java/org/restcomm/mscontrol/sdp/SessionDescriptor.java | SessionDescriptor.contains | public boolean contains(String encoding) {
if (encoding.equalsIgnoreCase("sendrecv") ||
encoding.equalsIgnoreCase("fmtp") ||
encoding.equalsIgnoreCase("audio") ||
encoding.equalsIgnoreCase("AS") ||
encoding.equalsIgnoreCase("IP4")) {
... | java | public boolean contains(String encoding) {
if (encoding.equalsIgnoreCase("sendrecv") ||
encoding.equalsIgnoreCase("fmtp") ||
encoding.equalsIgnoreCase("audio") ||
encoding.equalsIgnoreCase("AS") ||
encoding.equalsIgnoreCase("IP4")) {
... | [
"public",
"boolean",
"contains",
"(",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
".",
"equalsIgnoreCase",
"(",
"\"sendrecv\"",
")",
"||",
"encoding",
".",
"equalsIgnoreCase",
"(",
"\"fmtp\"",
")",
"||",
"encoding",
".",
"equalsIgnoreCase",
"(",
"\"... | Checks that specified format is described by this sdp.
@param encoding the encoding name of the format to check
@return true if format with specified encoding present in sdp. | [
"Checks",
"that",
"specified",
"format",
"is",
"described",
"by",
"this",
"sdp",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/mscontrol/sdp/SessionDescriptor.java#L196-L210 | train |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/GenericMgcpEndpoint.java | GenericMgcpEndpoint.cancelSignals | private void cancelSignals() {
Iterator<String> keys = this.signals.keySet().iterator();
while (keys.hasNext()) {
cancelSignal(keys.next());
}
} | java | private void cancelSignals() {
Iterator<String> keys = this.signals.keySet().iterator();
while (keys.hasNext()) {
cancelSignal(keys.next());
}
} | [
"private",
"void",
"cancelSignals",
"(",
")",
"{",
"Iterator",
"<",
"String",
">",
"keys",
"=",
"this",
".",
"signals",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"keys",
".",
"hasNext",
"(",
")",
")",
"{",
"cancelSignal",... | Cancels any ongoing signal. | [
"Cancels",
"any",
"ongoing",
"signal",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/GenericMgcpEndpoint.java#L462-L467 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java | IPAddressCompare.isInRangeV4 | public static boolean isInRangeV4(byte[] network,byte[] subnet,byte[] ipAddress)
{
if(network.length!=4 || subnet.length!=4 || ipAddress.length!=4)
return false;
return compareByteValues(network,subnet,ipAddress);
} | java | public static boolean isInRangeV4(byte[] network,byte[] subnet,byte[] ipAddress)
{
if(network.length!=4 || subnet.length!=4 || ipAddress.length!=4)
return false;
return compareByteValues(network,subnet,ipAddress);
} | [
"public",
"static",
"boolean",
"isInRangeV4",
"(",
"byte",
"[",
"]",
"network",
",",
"byte",
"[",
"]",
"subnet",
",",
"byte",
"[",
"]",
"ipAddress",
")",
"{",
"if",
"(",
"network",
".",
"length",
"!=",
"4",
"||",
"subnet",
".",
"length",
"!=",
"4",
... | Checks whether ipAddress is in IPV4 network with specified subnet | [
"Checks",
"whether",
"ipAddress",
"is",
"in",
"IPV4",
"network",
"with",
"specified",
"subnet"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L36-L42 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java | IPAddressCompare.isInRangeV6 | public static boolean isInRangeV6(byte[] network,byte[] subnet,byte[] ipAddress)
{
if(network.length!=16 || subnet.length!=16 || ipAddress.length!=16)
return false;
return compareByteValues(network,subnet,ipAddress);
} | java | public static boolean isInRangeV6(byte[] network,byte[] subnet,byte[] ipAddress)
{
if(network.length!=16 || subnet.length!=16 || ipAddress.length!=16)
return false;
return compareByteValues(network,subnet,ipAddress);
} | [
"public",
"static",
"boolean",
"isInRangeV6",
"(",
"byte",
"[",
"]",
"network",
",",
"byte",
"[",
"]",
"subnet",
",",
"byte",
"[",
"]",
"ipAddress",
")",
"{",
"if",
"(",
"network",
".",
"length",
"!=",
"16",
"||",
"subnet",
".",
"length",
"!=",
"16",... | Checks whether ipAddress is in IPV6 network with specified subnet | [
"Checks",
"whether",
"ipAddress",
"is",
"in",
"IPV6",
"network",
"with",
"specified",
"subnet"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L47-L53 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java | IPAddressCompare.compareByteValues | private static boolean compareByteValues(byte[] network,byte[] subnet,byte[] ipAddress)
{
for(int i=0;i<network.length;i++)
if((network[i] & subnet[i]) != (ipAddress[i] & subnet[i]))
return false;
return true;
} | java | private static boolean compareByteValues(byte[] network,byte[] subnet,byte[] ipAddress)
{
for(int i=0;i<network.length;i++)
if((network[i] & subnet[i]) != (ipAddress[i] & subnet[i]))
return false;
return true;
} | [
"private",
"static",
"boolean",
"compareByteValues",
"(",
"byte",
"[",
"]",
"network",
",",
"byte",
"[",
"]",
"subnet",
",",
"byte",
"[",
"]",
"ipAddress",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"network",
".",
"length",
";",
"i... | Checks whether ipAddress is in network with specified subnet by comparing byte logical end values | [
"Checks",
"whether",
"ipAddress",
"is",
"in",
"network",
"with",
"specified",
"subnet",
"by",
"comparing",
"byte",
"logical",
"end",
"values"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L58-L65 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java | IPAddressCompare.getAddressType | public static IPAddressType getAddressType(String ipAddress)
{
if(IPAddressUtil.isIPv4LiteralAddress(ipAddress))
return IPAddressType.IPV4;
if(IPAddressUtil.isIPv6LiteralAddress(ipAddress))
return IPAddressType.IPV6;
return IPAddressType.INVALID;
} | java | public static IPAddressType getAddressType(String ipAddress)
{
if(IPAddressUtil.isIPv4LiteralAddress(ipAddress))
return IPAddressType.IPV4;
if(IPAddressUtil.isIPv6LiteralAddress(ipAddress))
return IPAddressType.IPV6;
return IPAddressType.INVALID;
} | [
"public",
"static",
"IPAddressType",
"getAddressType",
"(",
"String",
"ipAddress",
")",
"{",
"if",
"(",
"IPAddressUtil",
".",
"isIPv4LiteralAddress",
"(",
"ipAddress",
")",
")",
"return",
"IPAddressType",
".",
"IPV4",
";",
"if",
"(",
"IPAddressUtil",
".",
"isIPv... | Gets IP address type | [
"Gets",
"IP",
"address",
"type"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L70-L79 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java | UdpManager.start | public void start() {
synchronized (LOCK) {
if (!this.active) {
this.active = true;
logger.info("Starting UDP Manager");
try {
generateTasks();
logger.info("Initialized UDP interface[" + inet + "]: bind address="... | java | public void start() {
synchronized (LOCK) {
if (!this.active) {
this.active = true;
logger.info("Starting UDP Manager");
try {
generateTasks();
logger.info("Initialized UDP interface[" + inet + "]: bind address="... | [
"public",
"void",
"start",
"(",
")",
"{",
"synchronized",
"(",
"LOCK",
")",
"{",
"if",
"(",
"!",
"this",
".",
"active",
")",
"{",
"this",
".",
"active",
"=",
"true",
";",
"logger",
".",
"info",
"(",
"\"Starting UDP Manager\"",
")",
";",
"try",
"{",
... | Starts polling the network. | [
"Starts",
"polling",
"the",
"network",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java#L453-L467 | train |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java | UdpManager.stop | public void stop() {
synchronized (LOCK) {
if (this.active) {
this.active = false;
logger.info("Stopping UDP Manager");
stopTasks();
closeSelectors();
cleanResources();
logger.info("UDP Manager has stoppe... | java | public void stop() {
synchronized (LOCK) {
if (this.active) {
this.active = false;
logger.info("Stopping UDP Manager");
stopTasks();
closeSelectors();
cleanResources();
logger.info("UDP Manager has stoppe... | [
"public",
"void",
"stop",
"(",
")",
"{",
"synchronized",
"(",
"LOCK",
")",
"{",
"if",
"(",
"this",
".",
"active",
")",
"{",
"this",
".",
"active",
"=",
"false",
";",
"logger",
".",
"info",
"(",
"\"Stopping UDP Manager\"",
")",
";",
"stopTasks",
"(",
... | Stops polling the network. | [
"Stops",
"polling",
"the",
"network",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/UdpManager.java#L472-L483 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java | IceAgent.getMediaStream | public IceMediaStream getMediaStream(String streamName) {
IceMediaStream mediaStream;
synchronized (mediaStreams) {
mediaStream = this.mediaStreams.get(streamName);
}
return mediaStream;
} | java | public IceMediaStream getMediaStream(String streamName) {
IceMediaStream mediaStream;
synchronized (mediaStreams) {
mediaStream = this.mediaStreams.get(streamName);
}
return mediaStream;
} | [
"public",
"IceMediaStream",
"getMediaStream",
"(",
"String",
"streamName",
")",
"{",
"IceMediaStream",
"mediaStream",
";",
"synchronized",
"(",
"mediaStreams",
")",
"{",
"mediaStream",
"=",
"this",
".",
"mediaStreams",
".",
"get",
"(",
"streamName",
")",
";",
"}... | Gets a media stream by name
@param streamName
The name of the media stream
@return The media stream. Returns null, if no media stream exists with
such name. | [
"Gets",
"a",
"media",
"stream",
"by",
"name"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java#L203-L209 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java | IceAgent.harvest | public void harvest(RtpPortManager portManager) throws HarvestException, NoCandidatesGatheredException {
// Initialize the selector if necessary
if (this.selector == null || !this.selector.isOpen()) {
try {
this.selector = Selector.open();
} catch (IOException e) {
throw new HarvestException("Could no... | java | public void harvest(RtpPortManager portManager) throws HarvestException, NoCandidatesGatheredException {
// Initialize the selector if necessary
if (this.selector == null || !this.selector.isOpen()) {
try {
this.selector = Selector.open();
} catch (IOException e) {
throw new HarvestException("Could no... | [
"public",
"void",
"harvest",
"(",
"RtpPortManager",
"portManager",
")",
"throws",
"HarvestException",
",",
"NoCandidatesGatheredException",
"{",
"// Initialize the selector if necessary",
"if",
"(",
"this",
".",
"selector",
"==",
"null",
"||",
"!",
"this",
".",
"selec... | Gathers all available candidates and sets the components of each media
stream.
@param portManager
The manager that handles port range for ICE candidate harvest
@throws HarvestException
An error occurred while harvesting candidates | [
"Gathers",
"all",
"available",
"candidates",
"and",
"sets",
"the",
"components",
"of",
"each",
"media",
"stream",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java#L228-L242 | train |
RestComm/media-core | ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java | IceAgent.fireCandidatePairSelectedEvent | private void fireCandidatePairSelectedEvent() {
// Stop the ICE Agent
this.stop();
// Fire the event to all listener
List<IceEventListener> listeners;
synchronized (this.iceListeners) {
listeners = new ArrayList<IceEventListener>(this.iceListeners);
}
SelectedCandidatesEvent event = new SelectedCandi... | java | private void fireCandidatePairSelectedEvent() {
// Stop the ICE Agent
this.stop();
// Fire the event to all listener
List<IceEventListener> listeners;
synchronized (this.iceListeners) {
listeners = new ArrayList<IceEventListener>(this.iceListeners);
}
SelectedCandidatesEvent event = new SelectedCandi... | [
"private",
"void",
"fireCandidatePairSelectedEvent",
"(",
")",
"{",
"// Stop the ICE Agent",
"this",
".",
"stop",
"(",
")",
";",
"// Fire the event to all listener",
"List",
"<",
"IceEventListener",
">",
"listeners",
";",
"synchronized",
"(",
"this",
".",
"iceListener... | Fires an event when all candidate pairs are selected.
@param candidatePair
The selected candidate pair | [
"Fires",
"an",
"event",
"when",
"all",
"candidate",
"pairs",
"are",
"selected",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/ice/src/main/java/org/restcomm/media/core/ice/IceAgent.java#L375-L389 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java | RtpPacket.getPayload | public void getPayload(byte[] buff, int offset) {
buffer.position(FIXED_HEADER_SIZE);
buffer.get(buff, offset, buffer.limit() - FIXED_HEADER_SIZE);
} | java | public void getPayload(byte[] buff, int offset) {
buffer.position(FIXED_HEADER_SIZE);
buffer.get(buff, offset, buffer.limit() - FIXED_HEADER_SIZE);
} | [
"public",
"void",
"getPayload",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"offset",
")",
"{",
"buffer",
".",
"position",
"(",
"FIXED_HEADER_SIZE",
")",
";",
"buffer",
".",
"get",
"(",
"buff",
",",
"offset",
",",
"buffer",
".",
"limit",
"(",
")",
"-"... | Reads the data transported by RTP in a packet, for example
audio samples or compressed video data.
@param buff the buffer used for reading
@param offset the initial offset inside buffer. | [
"Reads",
"the",
"data",
"transported",
"by",
"RTP",
"in",
"a",
"packet",
"for",
"example",
"audio",
"samples",
"or",
"compressed",
"video",
"data",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java#L304-L307 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java | RtpPacket.wrap | public void wrap(boolean mark, int payloadType, int seqNumber, long timestamp, long ssrc, byte[] data, int offset, int len) {
buffer.clear();
buffer.rewind();
//no extensions, paddings and cc
buffer.put((byte)0x80);
byte b = (byte) (payloadType);
if (mark) {
... | java | public void wrap(boolean mark, int payloadType, int seqNumber, long timestamp, long ssrc, byte[] data, int offset, int len) {
buffer.clear();
buffer.rewind();
//no extensions, paddings and cc
buffer.put((byte)0x80);
byte b = (byte) (payloadType);
if (mark) {
... | [
"public",
"void",
"wrap",
"(",
"boolean",
"mark",
",",
"int",
"payloadType",
",",
"int",
"seqNumber",
",",
"long",
"timestamp",
",",
"long",
"ssrc",
",",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"buffer",
".",
"cle... | Encapsulates data into the packet for transmission via RTP.
@param mark mark field
@param payloadType payload type field.
@param seqNumber sequence number field
@param timestamp timestamp field
@param ssrc synchronization source field
@param data data buffer
@param offset offset in the data buffer
@param len the numbe... | [
"Encapsulates",
"data",
"into",
"the",
"packet",
"for",
"transmission",
"via",
"RTP",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java#L331-L364 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java | RtpPacket.getExtensionLength | public int getExtensionLength()
{
if (!getExtensionBit())
return 0;
//the extension length comes after the RTP header, the CSRC list, and
//after two bytes in the extension header called "defined by profile"
int extLenIndex = FIXED_HEADER_SIZE
+ ... | java | public int getExtensionLength()
{
if (!getExtensionBit())
return 0;
//the extension length comes after the RTP header, the CSRC list, and
//after two bytes in the extension header called "defined by profile"
int extLenIndex = FIXED_HEADER_SIZE
+ ... | [
"public",
"int",
"getExtensionLength",
"(",
")",
"{",
"if",
"(",
"!",
"getExtensionBit",
"(",
")",
")",
"return",
"0",
";",
"//the extension length comes after the RTP header, the CSRC list, and",
"//after two bytes in the extension header called \"defined by profile\"",
"int",
... | Returns the length of the extensions currently added to this packet.
@return the length of the extensions currently added to this packet. | [
"Returns",
"the",
"length",
"of",
"the",
"extensions",
"currently",
"added",
"to",
"this",
"packet",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java#L423-L434 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java | RtpPacket.grow | public void grow(int delta) {
if (delta == 0) {
return;
}
int newLen = buffer.limit()+delta;
if (newLen <= buffer.capacity()) {
// there is more room in the underlying reserved buffer memory
buffer.limit(newLen);
return;
} else {
... | java | public void grow(int delta) {
if (delta == 0) {
return;
}
int newLen = buffer.limit()+delta;
if (newLen <= buffer.capacity()) {
// there is more room in the underlying reserved buffer memory
buffer.limit(newLen);
return;
} else {
... | [
"public",
"void",
"grow",
"(",
"int",
"delta",
")",
"{",
"if",
"(",
"delta",
"==",
"0",
")",
"{",
"return",
";",
"}",
"int",
"newLen",
"=",
"buffer",
".",
"limit",
"(",
")",
"+",
"delta",
";",
"if",
"(",
"newLen",
"<=",
"buffer",
".",
"capacity",... | Grow the internal packet buffer.
This will change the data buffer of this packet but not the
length of the valid data. Use this to grow the internal buffer
to avoid buffer re-allocations when appending data.
@param delta number of bytes to grow | [
"Grow",
"the",
"internal",
"packet",
"buffer",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/RtpPacket.java#L499-L517 | train |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/MgcpEndpointManager.java | MgcpEndpointManager.registerEndpoint | public MgcpEndpoint registerEndpoint(String namespace) throws UnrecognizedMgcpNamespaceException {
// Get correct endpoint provider
MgcpEndpointProvider<?> provider = this.providers.get(namespace);
if (provider == null) {
throw new UnrecognizedMgcpNamespaceException("Namespace " + na... | java | public MgcpEndpoint registerEndpoint(String namespace) throws UnrecognizedMgcpNamespaceException {
// Get correct endpoint provider
MgcpEndpointProvider<?> provider = this.providers.get(namespace);
if (provider == null) {
throw new UnrecognizedMgcpNamespaceException("Namespace " + na... | [
"public",
"MgcpEndpoint",
"registerEndpoint",
"(",
"String",
"namespace",
")",
"throws",
"UnrecognizedMgcpNamespaceException",
"{",
"// Get correct endpoint provider",
"MgcpEndpointProvider",
"<",
"?",
">",
"provider",
"=",
"this",
".",
"providers",
".",
"get",
"(",
"na... | Registers a new endpoint.
@param endpoint The name space of the endpoint which indicates what kind of endpoint is generated.
@param domain The domain where the endpoint is to be registered. | [
"Registers",
"a",
"new",
"endpoint",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/MgcpEndpointManager.java#L98-L116 | train |
RestComm/media-core | control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/MgcpEndpointManager.java | MgcpEndpointManager.unregisterEndpoint | public void unregisterEndpoint(String endpointId) throws MgcpEndpointNotFoundException {
MgcpEndpoint endpoint = this.endpoints.remove(endpointId);
if (endpoint == null) {
throw new MgcpEndpointNotFoundException("Endpoint " + endpointId + " not found");
}
endpoint.forget((Mgc... | java | public void unregisterEndpoint(String endpointId) throws MgcpEndpointNotFoundException {
MgcpEndpoint endpoint = this.endpoints.remove(endpointId);
if (endpoint == null) {
throw new MgcpEndpointNotFoundException("Endpoint " + endpointId + " not found");
}
endpoint.forget((Mgc... | [
"public",
"void",
"unregisterEndpoint",
"(",
"String",
"endpointId",
")",
"throws",
"MgcpEndpointNotFoundException",
"{",
"MgcpEndpoint",
"endpoint",
"=",
"this",
".",
"endpoints",
".",
"remove",
"(",
"endpointId",
")",
";",
"if",
"(",
"endpoint",
"==",
"null",
... | Unregisters an active endpoint.
@param endpointId The ID of the endpoint to be unregistered
@throws MgcpEndpointNotFoundException If there is no registered endpoint with such ID | [
"Unregisters",
"an",
"active",
"endpoint",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/control/mgcp/src/main/java/org/restcomm/media/core/control/mgcp/endpoint/MgcpEndpointManager.java#L134-L145 | train |
RestComm/media-core | client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/mediagroup/signals/buffer/EventBuffer.java | EventBuffer.offer | public void offer(Event event) {
sequence += event.toString();
//check pattern matching
if (patterns != null && sequence.length() > 0) {
for (int i = 0; i < patterns.length; i++) {
if (sequence.matches(patterns[i])) {
listener.patternMatch... | java | public void offer(Event event) {
sequence += event.toString();
//check pattern matching
if (patterns != null && sequence.length() > 0) {
for (int i = 0; i < patterns.length; i++) {
if (sequence.matches(patterns[i])) {
listener.patternMatch... | [
"public",
"void",
"offer",
"(",
"Event",
"event",
")",
"{",
"sequence",
"+=",
"event",
".",
"toString",
"(",
")",
";",
"//check pattern matching",
"if",
"(",
"patterns",
"!=",
"null",
"&&",
"sequence",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"for"... | Queues next event to the buffer.
@param event the event | [
"Queues",
"next",
"event",
"to",
"the",
"buffer",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/client/jsr-309/driver/src/main/java/org/restcomm/javax/media/mscontrol/mediagroup/signals/buffer/EventBuffer.java#L44-L67 | train |
RestComm/media-core | resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DetectorImpl.java | DetectorImpl.getMax | private int getMax(double data[]) {
int idx = 0;
double max = data[0];
for (int i = 1; i < data.length; i++) {
if (max < data[i]) {
max = data[i];
idx = i;
}
}
return idx;
} | java | private int getMax(double data[]) {
int idx = 0;
double max = data[0];
for (int i = 1; i < data.length; i++) {
if (max < data[i]) {
max = data[i];
idx = i;
}
}
return idx;
} | [
"private",
"int",
"getMax",
"(",
"double",
"data",
"[",
"]",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"double",
"max",
"=",
"data",
"[",
"0",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"data",
".",
"length",
";",
"i",
"++",
")... | Searches maximum value in the specified array.
@param data input data.
@return the index of the maximum value in the data array. | [
"Searches",
"maximum",
"value",
"in",
"the",
"specified",
"array",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DetectorImpl.java#L275-L285 | train |
RestComm/media-core | resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DetectorImpl.java | DetectorImpl.getTone | private String getTone(double f[], double F[]) {
int fm = getMax(f);
boolean fd = true;
for (int i = 0; i < f.length; i++) {
if (fm == i) {
continue;
}
double r = f[fm] / (f[i] + 1E-15);
if (r < threshold) {
fd = fa... | java | private String getTone(double f[], double F[]) {
int fm = getMax(f);
boolean fd = true;
for (int i = 0; i < f.length; i++) {
if (fm == i) {
continue;
}
double r = f[fm] / (f[i] + 1E-15);
if (r < threshold) {
fd = fa... | [
"private",
"String",
"getTone",
"(",
"double",
"f",
"[",
"]",
",",
"double",
"F",
"[",
"]",
")",
"{",
"int",
"fm",
"=",
"getMax",
"(",
"f",
")",
";",
"boolean",
"fd",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"f",
"... | Searches DTMF tone.
@param f the low frequency array
@param F the high frequency array.
@return DTMF tone. | [
"Searches",
"DTMF",
"tone",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DetectorImpl.java#L294-L332 | train |
RestComm/media-core | stun/src/main/java/org/restcomm/media/core/stun/messages/StunIndication.java | StunIndication.setMessageType | @Override
public void setMessageType(char indicationType)
throws IllegalArgumentException {
/*
* old TURN DATA indication type is an indication despite 0x0115 &
* 0x0110 indicates STUN error response type
*/
if (!isIndicationType(indicationType)
&& indicationType != StunMessage.OLD_DATA_INDICATION)... | java | @Override
public void setMessageType(char indicationType)
throws IllegalArgumentException {
/*
* old TURN DATA indication type is an indication despite 0x0115 &
* 0x0110 indicates STUN error response type
*/
if (!isIndicationType(indicationType)
&& indicationType != StunMessage.OLD_DATA_INDICATION)... | [
"@",
"Override",
"public",
"void",
"setMessageType",
"(",
"char",
"indicationType",
")",
"throws",
"IllegalArgumentException",
"{",
"/*\n\t\t * old TURN DATA indication type is an indication despite 0x0115 &\n\t\t * 0x0110 indicates STUN error response type\n\t\t */",
"if",
"(",
"!",
... | Checks whether indicationType is a valid indication type and if yes sets
it as the type of this instance.
@param indicationType
the type to set
@throws IllegalArgumentException
if indicationType is not a valid indication type | [
"Checks",
"whether",
"indicationType",
"is",
"a",
"valid",
"indication",
"type",
"and",
"if",
"yes",
"sets",
"it",
"as",
"the",
"type",
"of",
"this",
"instance",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/StunIndication.java#L32-L45 | train |
RestComm/media-core | scheduler/src/main/java/org/restcomm/media/core/scheduler/Task.java | Task.run | public void run() {
if (this.isActive) {
try {
perform();
//notify listener
if (this.listener != null) {
this.listener.onTerminate();
}
} catch (Exception e) {
logger.error("Could not execu... | java | public void run() {
if (this.isActive) {
try {
perform();
//notify listener
if (this.listener != null) {
this.listener.onTerminate();
}
} catch (Exception e) {
logger.error("Could not execu... | [
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isActive",
")",
"{",
"try",
"{",
"perform",
"(",
")",
";",
"//notify listener ",
"if",
"(",
"this",
".",
"listener",
"!=",
"null",
")",
"{",
"this",
".",
"listener",
".",
... | call should not be synchronized since can run only once in queue cycle | [
"call",
"should",
"not",
"be",
"synchronized",
"since",
"can",
"run",
"only",
"once",
"in",
"queue",
"cycle"
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/scheduler/src/main/java/org/restcomm/media/core/scheduler/Task.java#L121-L138 | train |
RestComm/media-core | stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/XorOnlyAttribute.java | XorOnlyAttribute.encode | public byte[] encode() {
char type = getAttributeType();
byte binValue[] = new byte[HEADER_LENGTH + getDataLength()];
// Type
binValue[0] = (byte) (type >> 8);
binValue[1] = (byte) (type & 0x00FF);
// Length
binValue[2] = (byte) (getDataLength() >> 8);
binValue[3] = (byte) (getDataLength() & 0x00FF);
... | java | public byte[] encode() {
char type = getAttributeType();
byte binValue[] = new byte[HEADER_LENGTH + getDataLength()];
// Type
binValue[0] = (byte) (type >> 8);
binValue[1] = (byte) (type & 0x00FF);
// Length
binValue[2] = (byte) (getDataLength() >> 8);
binValue[3] = (byte) (getDataLength() & 0x00FF);
... | [
"public",
"byte",
"[",
"]",
"encode",
"(",
")",
"{",
"char",
"type",
"=",
"getAttributeType",
"(",
")",
";",
"byte",
"binValue",
"[",
"]",
"=",
"new",
"byte",
"[",
"HEADER_LENGTH",
"+",
"getDataLength",
"(",
")",
"]",
";",
"// Type",
"binValue",
"[",
... | Returns a binary representation of this attribute.
@return a binary representation of this attribute. | [
"Returns",
"a",
"binary",
"representation",
"of",
"this",
"attribute",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/stun/src/main/java/org/restcomm/media/core/stun/messages/attributes/general/XorOnlyAttribute.java#L58-L71 | train |
RestComm/media-core | resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java | DtmfBuffer.push | public void push(String symbol) {
long now = System.currentTimeMillis();
if (!symbol.equals(lastSymbol) || (now - lastActivity > interdigitInterval)) {
lastActivity = now;
lastSymbol = symbol;
detectorImpl.fireEvent(symbol);
}
else
... | java | public void push(String symbol) {
long now = System.currentTimeMillis();
if (!symbol.equals(lastSymbol) || (now - lastActivity > interdigitInterval)) {
lastActivity = now;
lastSymbol = symbol;
detectorImpl.fireEvent(symbol);
}
else
... | [
"public",
"void",
"push",
"(",
"String",
"symbol",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"!",
"symbol",
".",
"equals",
"(",
"lastSymbol",
")",
"||",
"(",
"now",
"-",
"lastActivity",
">",
"interdigit... | Handles inter digit intervals.
@param symbol received digit. | [
"Handles",
"inter",
"digit",
"intervals",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java#L92-L102 | train |
RestComm/media-core | resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java | DtmfBuffer.queue | protected void queue(DtmfEventImpl evt) {
if (queue.size() == size) {
queue.poll();
}
queue.offer(evt);
logger.info(String.format("(%s) Buffer size: %d", detectorImpl.getName(), queue.size()));
} | java | protected void queue(DtmfEventImpl evt) {
if (queue.size() == size) {
queue.poll();
}
queue.offer(evt);
logger.info(String.format("(%s) Buffer size: %d", detectorImpl.getName(), queue.size()));
} | [
"protected",
"void",
"queue",
"(",
"DtmfEventImpl",
"evt",
")",
"{",
"if",
"(",
"queue",
".",
"size",
"(",
")",
"==",
"size",
")",
"{",
"queue",
".",
"poll",
"(",
")",
";",
"}",
"queue",
".",
"offer",
"(",
"evt",
")",
";",
"logger",
".",
"info",
... | Queues specified event.
@param evt the event to be queued. | [
"Queues",
"specified",
"event",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java#L114-L120 | train |
RestComm/media-core | resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java | DtmfBuffer.flush | public void flush() {
logger.info(String.format("(%s) Flush, buffer size: %d", detectorImpl.getName(), queue.size()));
while(queue.size()>0)
detectorImpl.fireEvent(queue.poll());
} | java | public void flush() {
logger.info(String.format("(%s) Flush, buffer size: %d", detectorImpl.getName(), queue.size()));
while(queue.size()>0)
detectorImpl.fireEvent(queue.poll());
} | [
"public",
"void",
"flush",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"String",
".",
"format",
"(",
"\"(%s) Flush, buffer size: %d\"",
",",
"detectorImpl",
".",
"getName",
"(",
")",
",",
"queue",
".",
"size",
"(",
")",
")",
")",
";",
"while",
"(",
"que... | Flushes the buffer content. | [
"Flushes",
"the",
"buffer",
"content",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/dtmf/src/main/java/org/restcomm/media/core/resource/dtmf/DtmfBuffer.java#L125-L129 | train |
RestComm/media-core | resource/media-player/src/main/java/org/restcomm/media/core/resource/player/video/mpeg/MovieHeaderBox.java | MovieHeaderBox.getCreationTime | public Date getCreationTime() {
calendar.set(Calendar.YEAR, 1904);
calendar.set(Calendar.MONTH, Calendar.JANUARY);
calendar.set(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.roll(Calendar.SECOND, (int) creationTime);... | java | public Date getCreationTime() {
calendar.set(Calendar.YEAR, 1904);
calendar.set(Calendar.MONTH, Calendar.JANUARY);
calendar.set(Calendar.DATE, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.roll(Calendar.SECOND, (int) creationTime);... | [
"public",
"Date",
"getCreationTime",
"(",
")",
"{",
"calendar",
".",
"set",
"(",
"Calendar",
".",
"YEAR",
",",
"1904",
")",
";",
"calendar",
".",
"set",
"(",
"Calendar",
".",
"MONTH",
",",
"Calendar",
".",
"JANUARY",
")",
";",
"calendar",
".",
"set",
... | Gets the creation time of this presentation.
@return creation time | [
"Gets",
"the",
"creation",
"time",
"of",
"this",
"presentation",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/resource/media-player/src/main/java/org/restcomm/media/core/resource/player/video/mpeg/MovieHeaderBox.java#L105-L115 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/DtlsSrtpServer.java | DtlsSrtpServer.generateFingerprint | public String generateFingerprint(String hashFunction) {
try {
this.hashFunction = hashFunction;
org.bouncycastle.crypto.tls.Certificate chain = TlsUtils.loadCertificateChain(certificateResources);
Certificate certificate = chain.getCertificateAt(0);
return TlsUtils.fingerprint(this.hashFunction, certific... | java | public String generateFingerprint(String hashFunction) {
try {
this.hashFunction = hashFunction;
org.bouncycastle.crypto.tls.Certificate chain = TlsUtils.loadCertificateChain(certificateResources);
Certificate certificate = chain.getCertificateAt(0);
return TlsUtils.fingerprint(this.hashFunction, certific... | [
"public",
"String",
"generateFingerprint",
"(",
"String",
"hashFunction",
")",
"{",
"try",
"{",
"this",
".",
"hashFunction",
"=",
"hashFunction",
";",
"org",
".",
"bouncycastle",
".",
"crypto",
".",
"tls",
".",
"Certificate",
"chain",
"=",
"TlsUtils",
".",
"... | Gets the fingerprint of the Certificate associated to the server.
@return The fingerprint of the server certificate. Returns an empty
String if the server does not contain a certificate. | [
"Gets",
"the",
"fingerprint",
"of",
"the",
"Certificate",
"associated",
"to",
"the",
"server",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/DtlsSrtpServer.java#L337-L347 | train |
RestComm/media-core | rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCipherCTR.java | SRTPCipherCTR.getCipherStream | public void getCipherStream(BlockCipher aesCipher, byte[] out, int length, byte[] iv) {
System.arraycopy(iv, 0, cipherInBlock, 0, 14);
int ctr;
for (ctr = 0; ctr < length / BLKLEN; ctr++) {
// compute the cipher stream
cipherInBlock[14] = (byte) ((ctr & 0xFF00) >> ... | java | public void getCipherStream(BlockCipher aesCipher, byte[] out, int length, byte[] iv) {
System.arraycopy(iv, 0, cipherInBlock, 0, 14);
int ctr;
for (ctr = 0; ctr < length / BLKLEN; ctr++) {
// compute the cipher stream
cipherInBlock[14] = (byte) ((ctr & 0xFF00) >> ... | [
"public",
"void",
"getCipherStream",
"(",
"BlockCipher",
"aesCipher",
",",
"byte",
"[",
"]",
"out",
",",
"int",
"length",
",",
"byte",
"[",
"]",
"iv",
")",
"{",
"System",
".",
"arraycopy",
"(",
"iv",
",",
"0",
",",
"cipherInBlock",
",",
"0",
",",
"14... | Computes the cipher stream for AES CM mode. See section 4.1.1 in RFC3711
for detailed description.
@param out
byte array holding the output cipher stream
@param length
length of the cipher stream to produce, in bytes
@param iv
initialization vector used to generate this cipher stream | [
"Computes",
"the",
"cipher",
"stream",
"for",
"AES",
"CM",
"mode",
".",
"See",
"section",
"4",
".",
"1",
".",
"1",
"in",
"RFC3711",
"for",
"detailed",
"description",
"."
] | 07b8703343708599f60af66bae62aded77ee81b5 | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/rtp/src/main/java/org/restcomm/media/core/rtp/crypto/SRTPCipherCTR.java#L85-L103 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.processComponents | private void processComponents(MAPDialogImpl mapDialogImpl, Component[] components) {
// Now let us decode the Components
for (Component c : components) {
doProcessComponent(mapDialogImpl, c);
}
} | java | private void processComponents(MAPDialogImpl mapDialogImpl, Component[] components) {
// Now let us decode the Components
for (Component c : components) {
doProcessComponent(mapDialogImpl, c);
}
} | [
"private",
"void",
"processComponents",
"(",
"MAPDialogImpl",
"mapDialogImpl",
",",
"Component",
"[",
"]",
"components",
")",
"{",
"// Now let us decode the Components",
"for",
"(",
"Component",
"c",
":",
"components",
")",
"{",
"doProcessComponent",
"(",
"mapDialogIm... | private service methods | [
"private",
"service",
"methods"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L1480-L1487 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.fireTCAbortACNNotSupported | private void fireTCAbortACNNotSupported(Dialog tcapDialog, MAPExtensionContainer mapExtensionContainer,
ApplicationContextName alternativeApplicationContext, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if ... | java | private void fireTCAbortACNNotSupported(Dialog tcapDialog, MAPExtensionContainer mapExtensionContainer,
ApplicationContextName alternativeApplicationContext, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if ... | [
"private",
"void",
"fireTCAbortACNNotSupported",
"(",
"Dialog",
"tcapDialog",
",",
"MAPExtensionContainer",
"mapExtensionContainer",
",",
"ApplicationContextName",
"alternativeApplicationContext",
",",
"boolean",
"returnMessageOnError",
")",
"throws",
"MAPException",
"{",
"if",... | Issue TC-U-ABORT with the "abort reason" = "application-content-name-not-supported"
@param tcapDialog
@param mapExtensionContainer
@param alternativeApplicationContext
@throws MAPException | [
"Issue",
"TC",
"-",
"U",
"-",
"ABORT",
"with",
"the",
"abort",
"reason",
"=",
"application",
"-",
"content",
"-",
"name",
"-",
"not",
"-",
"supported"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L1945-L1985 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.fireTCAbortUser | protected void fireTCAbortUser(Dialog tcapDialog, MAPUserAbortChoice mapUserAbortChoice,
MAPExtensionContainer mapExtensionContainer, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if (tcapDialog.getApplicati... | java | protected void fireTCAbortUser(Dialog tcapDialog, MAPUserAbortChoice mapUserAbortChoice,
MAPExtensionContainer mapExtensionContainer, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if (tcapDialog.getApplicati... | [
"protected",
"void",
"fireTCAbortUser",
"(",
"Dialog",
"tcapDialog",
",",
"MAPUserAbortChoice",
"mapUserAbortChoice",
",",
"MAPExtensionContainer",
"mapExtensionContainer",
",",
"boolean",
"returnMessageOnError",
")",
"throws",
"MAPException",
"{",
"if",
"(",
"this",
".",... | Issue TC-U-ABORT with the ABRT apdu with MAPUserAbortInfo userInformation
@param tcapDialog
@param mapUserAbortChoice
@param mapExtensionContainer
@throws MAPException | [
"Issue",
"TC",
"-",
"U",
"-",
"ABORT",
"with",
"the",
"ABRT",
"apdu",
"with",
"MAPUserAbortInfo",
"userInformation"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L2047-L2084 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.fireTCAbortProvider | protected void fireTCAbortProvider(Dialog tcapDialog, MAPProviderAbortReason mapProviderAbortReason,
MAPExtensionContainer mapExtensionContainer, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if (tcapDialog.... | java | protected void fireTCAbortProvider(Dialog tcapDialog, MAPProviderAbortReason mapProviderAbortReason,
MAPExtensionContainer mapExtensionContainer, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
if (tcapDialog.... | [
"protected",
"void",
"fireTCAbortProvider",
"(",
"Dialog",
"tcapDialog",
",",
"MAPProviderAbortReason",
"mapProviderAbortReason",
",",
"MAPExtensionContainer",
"mapExtensionContainer",
",",
"boolean",
"returnMessageOnError",
")",
"throws",
"MAPException",
"{",
"if",
"(",
"t... | Issue TC-U-ABORT with the ABRT apdu with MAPProviderAbortInfo userInformation
@param tcapDialog
@param mapProviderAbortReason
@param mapExtensionContainer
@throws MAPException | [
"Issue",
"TC",
"-",
"U",
"-",
"ABORT",
"with",
"the",
"ABRT",
"apdu",
"with",
"MAPProviderAbortInfo",
"userInformation"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L2094-L2130 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.fireTCAbortV1 | protected void fireTCAbortV1(Dialog tcapDialog, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
TCUserAbortRequest tcUserAbort = this.getTCAPProvider().getDialogPrimitiveFactory().createUAbort(tcapDialog);
if (ret... | java | protected void fireTCAbortV1(Dialog tcapDialog, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
TCUserAbortRequest tcUserAbort = this.getTCAPProvider().getDialogPrimitiveFactory().createUAbort(tcapDialog);
if (ret... | [
"protected",
"void",
"fireTCAbortV1",
"(",
"Dialog",
"tcapDialog",
",",
"boolean",
"returnMessageOnError",
")",
"throws",
"MAPException",
"{",
"if",
"(",
"this",
".",
"getTCAPProvider",
"(",
")",
".",
"getPreviewMode",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Issue TC-U-ABORT without any apdu - for MAP V1
@param tcapDialog
@param returnMessageOnError
@throws MAPException | [
"Issue",
"TC",
"-",
"U",
"-",
"ABORT",
"without",
"any",
"apdu",
"-",
"for",
"MAP",
"V1"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L2139-L2154 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java | Mtp2.startInitialAlignment | protected void startInitialAlignment(boolean resetTxOffset) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("(%s) Starting initial alignment", name));
}
// Comment from Oleg: this is done initialy to setup correct spot in tx
// buffer: dunno, I just believe, for ... | java | protected void startInitialAlignment(boolean resetTxOffset) {
if (logger.isDebugEnabled()) {
logger.debug(String.format("(%s) Starting initial alignment", name));
}
// Comment from Oleg: this is done initialy to setup correct spot in tx
// buffer: dunno, I just believe, for ... | [
"protected",
"void",
"startInitialAlignment",
"(",
"boolean",
"resetTxOffset",
")",
"{",
"if",
"(",
"logger",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"logger",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"(%s) Starting initial alignment\"",
",",
"name"... | should not be used | [
"should",
"not",
"be",
"used"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java#L410-L431 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java | Mtp2.processRx | private void processRx(byte[] buff, int len) {
int i = 0;
// start HDLC alg
while (i < len) {
while (rxState.bits <= 24 && i < len) {
int b = buff[i++] & 0xff;
hdlc.fasthdlc_rx_load_nocheck(rxState, b);
if (rxState.state == 0) {
... | java | private void processRx(byte[] buff, int len) {
int i = 0;
// start HDLC alg
while (i < len) {
while (rxState.bits <= 24 && i < len) {
int b = buff[i++] & 0xff;
hdlc.fasthdlc_rx_load_nocheck(rxState, b);
if (rxState.state == 0) {
... | [
"private",
"void",
"processRx",
"(",
"byte",
"[",
"]",
"buff",
",",
"int",
"len",
")",
"{",
"int",
"i",
"=",
"0",
";",
"// start HDLC alg",
"while",
"(",
"i",
"<",
"len",
")",
"{",
"while",
"(",
"rxState",
".",
"bits",
"<=",
"24",
"&&",
"i",
"<",... | Handles received data.
@param buff the buffer which conatins received data.
@param len the number of received bytes. | [
"Handles",
"received",
"data",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java#L974-L1037 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java | Mtp2.countFrame | private void countFrame() {
if (state == MTP2_ALIGNED_READY || state == MTP2_INSERVICE) {
dCount = (dCount + 1) % 256;
// decrement error countor for each 256 frames
if (dCount == 0 && eCount > 0) {
eCount--;
}
}
} | java | private void countFrame() {
if (state == MTP2_ALIGNED_READY || state == MTP2_INSERVICE) {
dCount = (dCount + 1) % 256;
// decrement error countor for each 256 frames
if (dCount == 0 && eCount > 0) {
eCount--;
}
}
} | [
"private",
"void",
"countFrame",
"(",
")",
"{",
"if",
"(",
"state",
"==",
"MTP2_ALIGNED_READY",
"||",
"state",
"==",
"MTP2_INSERVICE",
")",
"{",
"dCount",
"=",
"(",
"dCount",
"+",
"1",
")",
"%",
"256",
";",
"// decrement error countor for each 256 frames",
"if... | Increment number of received frames decrement error monitor countor for each 256 good frames. | [
"Increment",
"number",
"of",
"received",
"frames",
"decrement",
"error",
"monitor",
"countor",
"for",
"each",
"256",
"good",
"frames",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp2.java#L1232-L1240 | train |
RestComm/jss7 | tools/trace-parser/bootstrap/src/main/java/org/restcomm/protocols/ss7/tools/traceparser/bootstrap/Main.java | Main.main | public static void main(String[] args) throws Throwable {
String homeDir = getHomeDir(args);
System.setProperty(TRACE_PARSER_HOME, homeDir);
String dataDir = homeDir + File.separator + "data" + File.separator;
System.setProperty(TRACE_PARSER_DATA, dataDir);
if (!initLOG4JPropert... | java | public static void main(String[] args) throws Throwable {
String homeDir = getHomeDir(args);
System.setProperty(TRACE_PARSER_HOME, homeDir);
String dataDir = homeDir + File.separator + "data" + File.separator;
System.setProperty(TRACE_PARSER_DATA, dataDir);
if (!initLOG4JPropert... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"String",
"homeDir",
"=",
"getHomeDir",
"(",
"args",
")",
";",
"System",
".",
"setProperty",
"(",
"TRACE_PARSER_HOME",
",",
"homeDir",
")",
";",
"String",... | private int httpPort = -1; | [
"private",
"int",
"httpPort",
"=",
"-",
"1",
";"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tools/trace-parser/bootstrap/src/main/java/org/restcomm/protocols/ss7/tools/traceparser/bootstrap/Main.java#L62-L89 | train |
RestComm/jss7 | management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/Message.java | Message.encode | protected void encode(ByteBuffer txBuffer) {
txBuffer.position(4); // Length int
txBuffer.put(data);
int length = txBuffer.position();
txBuffer.rewind();
txBuffer.putInt(length);
txBuffer.position(length);
} | java | protected void encode(ByteBuffer txBuffer) {
txBuffer.position(4); // Length int
txBuffer.put(data);
int length = txBuffer.position();
txBuffer.rewind();
txBuffer.putInt(length);
txBuffer.position(length);
} | [
"protected",
"void",
"encode",
"(",
"ByteBuffer",
"txBuffer",
")",
"{",
"txBuffer",
".",
"position",
"(",
"4",
")",
";",
"// Length int",
"txBuffer",
".",
"put",
"(",
"data",
")",
";",
"int",
"length",
"=",
"txBuffer",
".",
"position",
"(",
")",
";",
"... | Encodes this message. The protocol is first 4 bytes are length of this command followed by the byte stream of command
@param txBuffer | [
"Encodes",
"this",
"message",
".",
"The",
"protocol",
"is",
"first",
"4",
"bytes",
"are",
"length",
"of",
"this",
"command",
"followed",
"by",
"the",
"byte",
"stream",
"of",
"command"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/Message.java#L70-L82 | train |
RestComm/jss7 | sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java | SccpFlowControl.initializeMessageNumbering | public void initializeMessageNumbering(SccpConnDt2MessageImpl msg) {
sendSequenceNumber = getNextSequenceNumber();
msg.setSequencing(sendSequenceNumber, sendSequenceNumberExpectedAtInput);
inputWindow.setLowerEdge(sendSequenceNumberExpectedAtInput);
} | java | public void initializeMessageNumbering(SccpConnDt2MessageImpl msg) {
sendSequenceNumber = getNextSequenceNumber();
msg.setSequencing(sendSequenceNumber, sendSequenceNumberExpectedAtInput);
inputWindow.setLowerEdge(sendSequenceNumberExpectedAtInput);
} | [
"public",
"void",
"initializeMessageNumbering",
"(",
"SccpConnDt2MessageImpl",
"msg",
")",
"{",
"sendSequenceNumber",
"=",
"getNextSequenceNumber",
"(",
")",
";",
"msg",
".",
"setSequencing",
"(",
"sendSequenceNumber",
",",
"sendSequenceNumberExpectedAtInput",
")",
";",
... | IT, DT2, AK | [
"IT",
"DT2",
"AK"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java#L46-L50 | train |
RestComm/jss7 | sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java | SccpFlowControl.checkInputMessageNumbering | public boolean checkInputMessageNumbering(SccpConnectionImpl conn, SequenceNumber sendSequenceNumber,
SequenceNumber receiveSequenceNumber) throws Exception {
if (sendSequenceNumber != null) {
if (expectingFirstMessageInputAfterInit && !sendSequenceNumbe... | java | public boolean checkInputMessageNumbering(SccpConnectionImpl conn, SequenceNumber sendSequenceNumber,
SequenceNumber receiveSequenceNumber) throws Exception {
if (sendSequenceNumber != null) {
if (expectingFirstMessageInputAfterInit && !sendSequenceNumbe... | [
"public",
"boolean",
"checkInputMessageNumbering",
"(",
"SccpConnectionImpl",
"conn",
",",
"SequenceNumber",
"sendSequenceNumber",
",",
"SequenceNumber",
"receiveSequenceNumber",
")",
"throws",
"Exception",
"{",
"if",
"(",
"sendSequenceNumber",
"!=",
"null",
")",
"{",
"... | if true then message can be accepted | [
"if",
"true",
"then",
"message",
"can",
"be",
"accepted"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java#L107-L140 | train |
RestComm/jss7 | sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java | SccpFlowControl.reinitialize | public void reinitialize() {
inputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);
outputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);
sendSequenceNumberExpectedAtInput = new SequenceNumberImpl(0);
// inputWindow.setLo... | java | public void reinitialize() {
inputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);
outputWindow = new SccpFlowControlWindow(new SequenceNumberImpl(0), maximumWindowSize);
sendSequenceNumberExpectedAtInput = new SequenceNumberImpl(0);
// inputWindow.setLo... | [
"public",
"void",
"reinitialize",
"(",
")",
"{",
"inputWindow",
"=",
"new",
"SccpFlowControlWindow",
"(",
"new",
"SequenceNumberImpl",
"(",
"0",
")",
",",
"maximumWindowSize",
")",
";",
"outputWindow",
"=",
"new",
"SccpFlowControlWindow",
"(",
"new",
"SequenceNumb... | after connection establishing and on connection reset | [
"after",
"connection",
"establishing",
"and",
"on",
"connection",
"reset"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/sccp/sccp-impl/src/main/java/org/restcomm/protocols/ss7/sccp/impl/SccpFlowControl.java#L144-L155 | train |
RestComm/jss7 | service/service/src/main/java/org/restcomm/ss7/SS7Service.java | SS7Service.rebind | private void rebind(Object stack) throws NamingException {
if (jndiName != null) {
Context ctx = new InitialContext();
String[] tokens = jndiName.split("/");
for (int i = 0; i < tokens.length - 1; i++) {
if (tokens[i].trim().length() > 0) {
... | java | private void rebind(Object stack) throws NamingException {
if (jndiName != null) {
Context ctx = new InitialContext();
String[] tokens = jndiName.split("/");
for (int i = 0; i < tokens.length - 1; i++) {
if (tokens[i].trim().length() > 0) {
... | [
"private",
"void",
"rebind",
"(",
"Object",
"stack",
")",
"throws",
"NamingException",
"{",
"if",
"(",
"jndiName",
"!=",
"null",
")",
"{",
"Context",
"ctx",
"=",
"new",
"InitialContext",
"(",
")",
";",
"String",
"[",
"]",
"tokens",
"=",
"jndiName",
".",
... | Binds trunk object to the JNDI under the jndiName. | [
"Binds",
"trunk",
"object",
"to",
"the",
"JNDI",
"under",
"the",
"jndiName",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/service/service/src/main/java/org/restcomm/ss7/SS7Service.java#L125-L142 | train |
RestComm/jss7 | service/service/src/main/java/org/restcomm/ss7/SS7Service.java | SS7Service.unbind | private void unbind(String jndiName) throws NamingException {
InitialContext initialContext = new InitialContext();
initialContext.unbind(jndiName);
} | java | private void unbind(String jndiName) throws NamingException {
InitialContext initialContext = new InitialContext();
initialContext.unbind(jndiName);
} | [
"private",
"void",
"unbind",
"(",
"String",
"jndiName",
")",
"throws",
"NamingException",
"{",
"InitialContext",
"initialContext",
"=",
"new",
"InitialContext",
"(",
")",
";",
"initialContext",
".",
"unbind",
"(",
"jndiName",
")",
";",
"}"
] | Unbounds object under specified name.
@param jndiName the JNDI name of the object to be unbound. | [
"Unbounds",
"object",
"under",
"specified",
"name",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/service/service/src/main/java/org/restcomm/ss7/SS7Service.java#L149-L152 | train |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspStateMaintenanceHandler.java | AspStateMaintenanceHandler.handleHeartbeat | public void handleHeartbeat(Heartbeat hrtBeat) {
HeartbeatAck hrtBeatAck = (HeartbeatAck) this.aspFactoryImpl.messageFactory.createMessage(
MessageClass.ASP_STATE_MAINTENANCE, MessageType.HEARTBEAT_ACK);
hrtBeatAck.setHeartbeatData(hrtBeat.getHeartbeatData());
this.aspFactoryImpl... | java | public void handleHeartbeat(Heartbeat hrtBeat) {
HeartbeatAck hrtBeatAck = (HeartbeatAck) this.aspFactoryImpl.messageFactory.createMessage(
MessageClass.ASP_STATE_MAINTENANCE, MessageType.HEARTBEAT_ACK);
hrtBeatAck.setHeartbeatData(hrtBeat.getHeartbeatData());
this.aspFactoryImpl... | [
"public",
"void",
"handleHeartbeat",
"(",
"Heartbeat",
"hrtBeat",
")",
"{",
"HeartbeatAck",
"hrtBeatAck",
"=",
"(",
"HeartbeatAck",
")",
"this",
".",
"aspFactoryImpl",
".",
"messageFactory",
".",
"createMessage",
"(",
"MessageClass",
".",
"ASP_STATE_MAINTENANCE",
",... | If we receive Heartbeat, we send back response
@param hrtBeat | [
"If",
"we",
"receive",
"Heartbeat",
"we",
"send",
"back",
"response"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/AspStateMaintenanceHandler.java#L311-L317 | train |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UARouteManagement.java | M3UARouteManagement.reset | protected void reset() {
for (RouteMap.Entry<String, RouteAsImpl> e = this.route.head(), end = this.route.tail(); (e = e.getNext()) != end;) {
String key = e.getKey();
RouteAsImpl routeAs = e.getValue();
routeAs.setM3uaManagement(this.m3uaManagement);
routeAs.rese... | java | protected void reset() {
for (RouteMap.Entry<String, RouteAsImpl> e = this.route.head(), end = this.route.tail(); (e = e.getNext()) != end;) {
String key = e.getKey();
RouteAsImpl routeAs = e.getValue();
routeAs.setM3uaManagement(this.m3uaManagement);
routeAs.rese... | [
"protected",
"void",
"reset",
"(",
")",
"{",
"for",
"(",
"RouteMap",
".",
"Entry",
"<",
"String",
",",
"RouteAsImpl",
">",
"e",
"=",
"this",
".",
"route",
".",
"head",
"(",
")",
",",
"end",
"=",
"this",
".",
"route",
".",
"tail",
"(",
")",
";",
... | Reset the routeTable. Called after the persistance state of route is read from xml file. | [
"Reset",
"the",
"routeTable",
".",
"Called",
"after",
"the",
"persistance",
"state",
"of",
"route",
"is",
"read",
"from",
"xml",
"file",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UARouteManagement.java#L158-L180 | train |
RestComm/jss7 | management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/MessageFactory.java | MessageFactory.createMessage | public Message createMessage(ByteBuffer buffer) {
if (!isHeaderReady) {
int len = Math.min(MESSAGE_HEADER_SIZE - pos, buffer.remaining());
buffer.get(header, pos, len);
// update cursor postion in the header's buffer
pos += len;
// header completed?... | java | public Message createMessage(ByteBuffer buffer) {
if (!isHeaderReady) {
int len = Math.min(MESSAGE_HEADER_SIZE - pos, buffer.remaining());
buffer.get(header, pos, len);
// update cursor postion in the header's buffer
pos += len;
// header completed?... | [
"public",
"Message",
"createMessage",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"!",
"isHeaderReady",
")",
"{",
"int",
"len",
"=",
"Math",
".",
"min",
"(",
"MESSAGE_HEADER_SIZE",
"-",
"pos",
",",
"buffer",
".",
"remaining",
"(",
")",
")",
";",
... | The received buffer may not have necessary bytes to decode a message. Instance of this factory keeps data locally till
next set of data is received and a message can be successfully decoded
@param buffer
@return | [
"The",
"received",
"buffer",
"may",
"not",
"have",
"necessary",
"bytes",
"to",
"decode",
"a",
"message",
".",
"Instance",
"of",
"this",
"factory",
"keeps",
"data",
"locally",
"till",
"next",
"set",
"of",
"data",
"is",
"received",
"and",
"a",
"message",
"ca... | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/MessageFactory.java#L73-L139 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java | ISUPMessageImpl.encodeMandatoryVariableParameters | protected void encodeMandatoryVariableParameters(Map<Integer, ISUPParameter> parameters, ByteArrayOutputStream bos,
boolean isOptionalPartPresent) throws ParameterException {
try {
byte[] pointers = null;
// complicated
if (!mandatoryVariablePartPossible()) {
... | java | protected void encodeMandatoryVariableParameters(Map<Integer, ISUPParameter> parameters, ByteArrayOutputStream bos,
boolean isOptionalPartPresent) throws ParameterException {
try {
byte[] pointers = null;
// complicated
if (!mandatoryVariablePartPossible()) {
... | [
"protected",
"void",
"encodeMandatoryVariableParameters",
"(",
"Map",
"<",
"Integer",
",",
"ISUPParameter",
">",
"parameters",
",",
"ByteArrayOutputStream",
"bos",
",",
"boolean",
"isOptionalPartPresent",
")",
"throws",
"ParameterException",
"{",
"try",
"{",
"byte",
"... | takes care of endoding parameters - poniters and actual parameters.
@param parameters - list of parameters
@param bos - output
@param isOptionalPartPresent - if <b>true</b> this will encode pointer to point for start of optional part, otherwise it
will encode this octet as zeros
@throws ParameterException | [
"takes",
"care",
"of",
"endoding",
"parameters",
"-",
"poniters",
"and",
"actual",
"parameters",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java#L198-L272 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java | ISUPMessageImpl.decodeMandatoryParameters | protected int decodeMandatoryParameters(ISUPParameterFactory parameterFactory, byte[] b, int index)
throws ParameterException {
int localIndex = index;
if (b.length - index >= 3) {
try {
byte[] cic = new byte[2];
cic[0] = b[index++];
... | java | protected int decodeMandatoryParameters(ISUPParameterFactory parameterFactory, byte[] b, int index)
throws ParameterException {
int localIndex = index;
if (b.length - index >= 3) {
try {
byte[] cic = new byte[2];
cic[0] = b[index++];
... | [
"protected",
"int",
"decodeMandatoryParameters",
"(",
"ISUPParameterFactory",
"parameterFactory",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"index",
")",
"throws",
"ParameterException",
"{",
"int",
"localIndex",
"=",
"index",
";",
"if",
"(",
"b",
".",
"length",
... | Unfortunelty this cant be generic, can it? | [
"Unfortunelty",
"this",
"cant",
"be",
"generic",
"can",
"it?"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java#L334-L365 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java | ISUPMessageImpl.decodeMandatoryVariableParameters | protected int decodeMandatoryVariableParameters(ISUPParameterFactory parameterFactory, byte[] b, int index)
throws ParameterException {
// FIXME: possibly this should also be per msg, since if msg lacks
// proper parameter, decoding wotn pick this up and will throw
// some bad output... | java | protected int decodeMandatoryVariableParameters(ISUPParameterFactory parameterFactory, byte[] b, int index)
throws ParameterException {
// FIXME: possibly this should also be per msg, since if msg lacks
// proper parameter, decoding wotn pick this up and will throw
// some bad output... | [
"protected",
"int",
"decodeMandatoryVariableParameters",
"(",
"ISUPParameterFactory",
"parameterFactory",
",",
"byte",
"[",
"]",
"b",
",",
"int",
"index",
")",
"throws",
"ParameterException",
"{",
"// FIXME: possibly this should also be per msg, since if msg lacks",
"// proper ... | decodes ptrs and returns offset from passed index value to first optional parameter parameter
@param b
@param index
@return
@throws ParameterException | [
"decodes",
"ptrs",
"and",
"returns",
"offset",
"from",
"passed",
"index",
"value",
"to",
"first",
"optional",
"parameter",
"parameter"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/ISUPMessageImpl.java#L375-L414 | train |
RestComm/jss7 | tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/DialogImpl.java | DialogImpl.addIncomingInvokeId | private boolean addIncomingInvokeId(Long invokeId) {
synchronized (this.incomingInvokeList) {
if (this.incomingInvokeList.contains(invokeId))
return false;
else {
this.incomingInvokeList.add(invokeId);
return true;
}
}
... | java | private boolean addIncomingInvokeId(Long invokeId) {
synchronized (this.incomingInvokeList) {
if (this.incomingInvokeList.contains(invokeId))
return false;
else {
this.incomingInvokeList.add(invokeId);
return true;
}
}
... | [
"private",
"boolean",
"addIncomingInvokeId",
"(",
"Long",
"invokeId",
")",
"{",
"synchronized",
"(",
"this",
".",
"incomingInvokeList",
")",
"{",
"if",
"(",
"this",
".",
"incomingInvokeList",
".",
"contains",
"(",
"invokeId",
")",
")",
"return",
"false",
";",
... | Adding the new incoming invokeId into incomingInvokeList list
@param invokeId
@return false: failure - this invokeId already present in the list | [
"Adding",
"the",
"new",
"incoming",
"invokeId",
"into",
"incomingInvokeList",
"list"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/DialogImpl.java#L522-L531 | train |
RestComm/jss7 | tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/DialogImpl.java | DialogImpl.resetTimer | public void resetTimer(Long invokeId) throws TCAPException {
try {
this.dialogLock.lock();
int index = getIndexFromInvokeId(invokeId);
InvokeImpl invoke = operationsSent[index];
if (invoke == null) {
throw new TCAPException("No operation with this ... | java | public void resetTimer(Long invokeId) throws TCAPException {
try {
this.dialogLock.lock();
int index = getIndexFromInvokeId(invokeId);
InvokeImpl invoke = operationsSent[index];
if (invoke == null) {
throw new TCAPException("No operation with this ... | [
"public",
"void",
"resetTimer",
"(",
"Long",
"invokeId",
")",
"throws",
"TCAPException",
"{",
"try",
"{",
"this",
".",
"dialogLock",
".",
"lock",
"(",
")",
";",
"int",
"index",
"=",
"getIndexFromInvokeId",
"(",
"invokeId",
")",
";",
"InvokeImpl",
"invoke",
... | TC-TIMER-RESET | [
"TC",
"-",
"TIMER",
"-",
"RESET"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap/tcap-impl/src/main/java/org/restcomm/protocols/ss7/tcap/DialogImpl.java#L2192-L2204 | train |
RestComm/jss7 | sccp/sccp-api/src/main/java/org/restcomm/protocols/ss7/utils/Utils.java | Utils.hexDump | public static String hexDump(String label, byte[] bytes) {
final int modulo = 16;
final int brk = modulo / 2;
int indent = (label == null) ? 0 : label.length();
StringBuffer sb = new StringBuffer(indent + 1);
while (indent > 0) {
sb.append(" ");
indent--... | java | public static String hexDump(String label, byte[] bytes) {
final int modulo = 16;
final int brk = modulo / 2;
int indent = (label == null) ? 0 : label.length();
StringBuffer sb = new StringBuffer(indent + 1);
while (indent > 0) {
sb.append(" ");
indent--... | [
"public",
"static",
"String",
"hexDump",
"(",
"String",
"label",
",",
"byte",
"[",
"]",
"bytes",
")",
"{",
"final",
"int",
"modulo",
"=",
"16",
";",
"final",
"int",
"brk",
"=",
"modulo",
"/",
"2",
";",
"int",
"indent",
"=",
"(",
"label",
"==",
"nul... | Construct a String containing a hex-dump of a byte array
@param label the label of the hexdump or null
@param bytes the data to dump
@return a string containing the hexdump | [
"Construct",
"a",
"String",
"containing",
"a",
"hex",
"-",
"dump",
"of",
"a",
"byte",
"array"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/sccp/sccp-api/src/main/java/org/restcomm/protocols/ss7/utils/Utils.java#L63-L148 | train |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UAManagementImpl.java | M3UAManagementImpl.setMaxSequenceNumber | public void setMaxSequenceNumber(int maxSequenceNumber) throws Exception {
if (this.isStarted)
throw new Exception("MaxSequenceNumber parameter can be updated only when M3UA stack is NOT running");
if (maxSequenceNumber < 1) {
maxSequenceNumber = 1;
} else if (maxSequenc... | java | public void setMaxSequenceNumber(int maxSequenceNumber) throws Exception {
if (this.isStarted)
throw new Exception("MaxSequenceNumber parameter can be updated only when M3UA stack is NOT running");
if (maxSequenceNumber < 1) {
maxSequenceNumber = 1;
} else if (maxSequenc... | [
"public",
"void",
"setMaxSequenceNumber",
"(",
"int",
"maxSequenceNumber",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"isStarted",
")",
"throw",
"new",
"Exception",
"(",
"\"MaxSequenceNumber parameter can be updated only when M3UA stack is NOT running\"",
")",... | Set the maximum SLS that can be used by SCTP. Internally SLS vs SCTP Stream Sequence Number is maintained. Stream Seq
Number 0 is for management.
@param maxSls the maxSls to set | [
"Set",
"the",
"maximum",
"SLS",
"that",
"can",
"be",
"used",
"by",
"SCTP",
".",
"Internally",
"SLS",
"vs",
"SCTP",
"Stream",
"Sequence",
"Number",
"is",
"maintained",
".",
"Stream",
"Seq",
"Number",
"0",
"is",
"for",
"management",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UAManagementImpl.java#L173-L183 | train |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UAManagementImpl.java | M3UAManagementImpl.startAsp | public void startAsp(String aspName) throws Exception {
AspFactoryImpl aspFactoryImpl = this.getAspFactory(aspName);
if (aspFactoryImpl == null) {
throw new Exception(String.format(M3UAOAMMessages.NO_ASP_FOUND, aspName));
}
if (aspFactoryImpl.getStatus()) {
thro... | java | public void startAsp(String aspName) throws Exception {
AspFactoryImpl aspFactoryImpl = this.getAspFactory(aspName);
if (aspFactoryImpl == null) {
throw new Exception(String.format(M3UAOAMMessages.NO_ASP_FOUND, aspName));
}
if (aspFactoryImpl.getStatus()) {
thro... | [
"public",
"void",
"startAsp",
"(",
"String",
"aspName",
")",
"throws",
"Exception",
"{",
"AspFactoryImpl",
"aspFactoryImpl",
"=",
"this",
".",
"getAspFactory",
"(",
"aspName",
")",
";",
"if",
"(",
"aspFactoryImpl",
"==",
"null",
")",
"{",
"throw",
"new",
"Ex... | This method should be called by management to start the ASP
@param aspName The name of the ASP to be started
@throws Exception | [
"This",
"method",
"should",
"be",
"called",
"by",
"management",
"to",
"start",
"the",
"ASP"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/M3UAManagementImpl.java#L777-L805 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Linkset.java | Linkset.add | public void add(Mtp2 link) {
// add link at the first empty place
for (int i = 0; i < links.length; i++) {
if (links[i] == null) {
links[i] = link;
break;
}
}
count++;
remap();
} | java | public void add(Mtp2 link) {
// add link at the first empty place
for (int i = 0; i < links.length; i++) {
if (links[i] == null) {
links[i] = link;
break;
}
}
count++;
remap();
} | [
"public",
"void",
"add",
"(",
"Mtp2",
"link",
")",
"{",
"// add link at the first empty place",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"links",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"links",
"[",
"i",
"]",
"==",
"null",
")",... | Adds link to this link set.
@param link the link to add | [
"Adds",
"link",
"to",
"this",
"link",
"set",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Linkset.java#L43-L53 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Linkset.java | Linkset.remap | private void remap() {
int k = -1;
for (int i = 0; i < map.length; i++) {
boolean found = false;
for (int j = k + 1; j < links.length; j++) {
if (links[j] != null) {
found = true;
k = j;
map[i] = k;
... | java | private void remap() {
int k = -1;
for (int i = 0; i < map.length; i++) {
boolean found = false;
for (int j = k + 1; j < links.length; j++) {
if (links[j] != null) {
found = true;
k = j;
map[i] = k;
... | [
"private",
"void",
"remap",
"(",
")",
"{",
"int",
"k",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"map",
".",
"length",
";",
"i",
"++",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"int",
"j",
"=",
... | This method is called each time when number of links has changed to reestablish relation between link selection indicator
and link | [
"This",
"method",
"is",
"called",
"each",
"time",
"when",
"number",
"of",
"links",
"has",
"changed",
"to",
"reestablish",
"relation",
"between",
"link",
"selection",
"indicator",
"and",
"link"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Linkset.java#L94-L125 | train |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPServiceBaseImpl.java | MAPServiceBaseImpl.createNewTCAPDialog | protected Dialog createNewTCAPDialog(SccpAddress origAddress, SccpAddress destAddress, Long localTrId) throws MAPException {
try {
return this.mapProviderImpl.getTCAPProvider().getNewDialog(origAddress, destAddress, localTrId);
} catch (TCAPException e) {
throw new MAPException(e... | java | protected Dialog createNewTCAPDialog(SccpAddress origAddress, SccpAddress destAddress, Long localTrId) throws MAPException {
try {
return this.mapProviderImpl.getTCAPProvider().getNewDialog(origAddress, destAddress, localTrId);
} catch (TCAPException e) {
throw new MAPException(e... | [
"protected",
"Dialog",
"createNewTCAPDialog",
"(",
"SccpAddress",
"origAddress",
",",
"SccpAddress",
"destAddress",
",",
"Long",
"localTrId",
")",
"throws",
"MAPException",
"{",
"try",
"{",
"return",
"this",
".",
"mapProviderImpl",
".",
"getTCAPProvider",
"(",
")",
... | Creating new outgoing TCAP Dialog. Used when creating a new outgoing MAP Dialog
@param origAddress
@param destAddress
@return
@throws MAPException | [
"Creating",
"new",
"outgoing",
"TCAP",
"Dialog",
".",
"Used",
"when",
"creating",
"a",
"new",
"outgoing",
"MAP",
"Dialog"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPServiceBaseImpl.java#L82-L88 | train |
RestComm/jss7 | tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java | TCAPProviderImpl.getAvailableTxId | private synchronized Long getAvailableTxId() throws TCAPException {
if (this.dialogs.size() >= this.stack.getMaxDialogs())
throw new TCAPException("Current dialog count exceeds its maximum value");
while (true) {
// Long id;
// if (!currentDialogId.compareAndSet(this.s... | java | private synchronized Long getAvailableTxId() throws TCAPException {
if (this.dialogs.size() >= this.stack.getMaxDialogs())
throw new TCAPException("Current dialog count exceeds its maximum value");
while (true) {
// Long id;
// if (!currentDialogId.compareAndSet(this.s... | [
"private",
"synchronized",
"Long",
"getAvailableTxId",
"(",
")",
"throws",
"TCAPException",
"{",
"if",
"(",
"this",
".",
"dialogs",
".",
"size",
"(",
")",
">=",
"this",
".",
"stack",
".",
"getMaxDialogs",
"(",
")",
")",
"throw",
"new",
"TCAPException",
"("... | some help methods... crude but will work for first impl. | [
"some",
"help",
"methods",
"...",
"crude",
"but",
"will",
"work",
"for",
"first",
"impl",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java#L202-L226 | train |
RestComm/jss7 | tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java | TCAPProviderImpl.getNextSeqControl | protected int getNextSeqControl() {
int res = seqControl.getAndIncrement();
// if (!seqControl.compareAndSet(256, 1)) {
// return seqControl.getAndIncrement();
// } else {
// return 0;
// }
// seqControl++;
// if (seqControl > 255) {
// seqContro... | java | protected int getNextSeqControl() {
int res = seqControl.getAndIncrement();
// if (!seqControl.compareAndSet(256, 1)) {
// return seqControl.getAndIncrement();
// } else {
// return 0;
// }
// seqControl++;
// if (seqControl > 255) {
// seqContro... | [
"protected",
"int",
"getNextSeqControl",
"(",
")",
"{",
"int",
"res",
"=",
"seqControl",
".",
"getAndIncrement",
"(",
")",
";",
"// if (!seqControl.compareAndSet(256, 1)) {",
"// return seqControl.getAndIncrement();",
"// } else {",
"// return 0;",
"// }",
"// seqControl++;",... | get next Seq Control value available | [
"get",
"next",
"Seq",
"Control",
"value",
"available"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tcap-ansi/tcap-ansi-impl/src/main/java/org/restcomm/protocols/ss7/tcapAnsi/TCAPProviderImpl.java#L241-L267 | train |
RestComm/jss7 | cap/cap-impl/src/main/java/org/restcomm/protocols/ss7/cap/CAPServiceBaseImpl.java | CAPServiceBaseImpl.createNewTCAPDialog | protected Dialog createNewTCAPDialog(SccpAddress origAddress, SccpAddress destAddress, Long localTrId) throws CAPException {
try {
return this.capProviderImpl.getTCAPProvider().getNewDialog(origAddress, destAddress, localTrId);
} catch (TCAPException e) {
throw new CAPException(e... | java | protected Dialog createNewTCAPDialog(SccpAddress origAddress, SccpAddress destAddress, Long localTrId) throws CAPException {
try {
return this.capProviderImpl.getTCAPProvider().getNewDialog(origAddress, destAddress, localTrId);
} catch (TCAPException e) {
throw new CAPException(e... | [
"protected",
"Dialog",
"createNewTCAPDialog",
"(",
"SccpAddress",
"origAddress",
",",
"SccpAddress",
"destAddress",
",",
"Long",
"localTrId",
")",
"throws",
"CAPException",
"{",
"try",
"{",
"return",
"this",
".",
"capProviderImpl",
".",
"getTCAPProvider",
"(",
")",
... | Creating new outgoing TCAP Dialog. Used when creating a new outgoing CAP Dialog
@param origAddress
@param destAddress
@return
@throws CAPException | [
"Creating",
"new",
"outgoing",
"TCAP",
"Dialog",
".",
"Used",
"when",
"creating",
"a",
"new",
"outgoing",
"CAP",
"Dialog"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/cap/cap-impl/src/main/java/org/restcomm/protocols/ss7/cap/CAPServiceBaseImpl.java#L82-L88 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/parameter/TransitNetworkSelectionImpl.java | TransitNetworkSelectionImpl.encodeDigits | public int encodeDigits(ByteArrayOutputStream bos) {
boolean isOdd = this.oddFlag == _FLAG_ODD;
byte b = 0;
int count = (!isOdd) ? address.length() : address.length() - 1;
int bytesCount = 0;
for (int i = 0; i < count - 1; i += 2) {
String ds1 = address.substring(i, ... | java | public int encodeDigits(ByteArrayOutputStream bos) {
boolean isOdd = this.oddFlag == _FLAG_ODD;
byte b = 0;
int count = (!isOdd) ? address.length() : address.length() - 1;
int bytesCount = 0;
for (int i = 0; i < count - 1; i += 2) {
String ds1 = address.substring(i, ... | [
"public",
"int",
"encodeDigits",
"(",
"ByteArrayOutputStream",
"bos",
")",
"{",
"boolean",
"isOdd",
"=",
"this",
".",
"oddFlag",
"==",
"_FLAG_ODD",
";",
"byte",
"b",
"=",
"0",
";",
"int",
"count",
"=",
"(",
"!",
"isOdd",
")",
"?",
"address",
".",
"leng... | This method is used in encode. Encodes digits part. This is because
@param bos - where digits will be encoded
@return - number of bytes encoded | [
"This",
"method",
"is",
"used",
"in",
"encode",
".",
"Encodes",
"digits",
"part",
".",
"This",
"is",
"because"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/impl/message/parameter/TransitNetworkSelectionImpl.java#L170-L198 | train |
RestComm/jss7 | management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/ShellServerChannel.java | ShellServerChannel.accept | public ShellChannel accept() throws IOException {
SocketChannel newChannel = ((ServerSocketChannel) channel).accept();
if (newChannel == null)
return null;
return new ShellChannelExt(chanProvider, newChannel);
} | java | public ShellChannel accept() throws IOException {
SocketChannel newChannel = ((ServerSocketChannel) channel).accept();
if (newChannel == null)
return null;
return new ShellChannelExt(chanProvider, newChannel);
} | [
"public",
"ShellChannel",
"accept",
"(",
")",
"throws",
"IOException",
"{",
"SocketChannel",
"newChannel",
"=",
"(",
"(",
"ServerSocketChannel",
")",
"channel",
")",
".",
"accept",
"(",
")",
";",
"if",
"(",
"newChannel",
"==",
"null",
")",
"return",
"null",
... | Accepts a connection made to this channel's socket.
The channel returned by this method, if any, will be in non-blocking mode.
@return The {@link ShellChannel} for the new connection, or null if no connection is available to be accepted
@throws java.io.IOException | [
"Accepts",
"a",
"connection",
"made",
"to",
"this",
"channel",
"s",
"socket",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/management/shell-transport/src/main/java/org/restcomm/ss7/management/transceiver/ShellServerChannel.java#L62-L68 | train |
RestComm/jss7 | tools/trace-parser/parser/src/main/java/org/restcomm/protocols/ss7/tools/traceparser/SS7TraceParser.java | SS7TraceParser.parseSmsSignalInfo | private void parseSmsSignalInfo(SmsSignalInfo si, boolean isMo, boolean isMt) {
if (si == null)
return;
if (isMo) {
try {
SmsTpdu tpdu = si.decodeTpdu(true);
parseSmsTpdu(tpdu);
} catch (MAPException e) {
// TODO Auto-... | java | private void parseSmsSignalInfo(SmsSignalInfo si, boolean isMo, boolean isMt) {
if (si == null)
return;
if (isMo) {
try {
SmsTpdu tpdu = si.decodeTpdu(true);
parseSmsTpdu(tpdu);
} catch (MAPException e) {
// TODO Auto-... | [
"private",
"void",
"parseSmsSignalInfo",
"(",
"SmsSignalInfo",
"si",
",",
"boolean",
"isMo",
",",
"boolean",
"isMt",
")",
"{",
"if",
"(",
"si",
"==",
"null",
")",
"return",
";",
"if",
"(",
"isMo",
")",
"{",
"try",
"{",
"SmsTpdu",
"tpdu",
"=",
"si",
"... | SMS service listener | [
"SMS",
"service",
"listener"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tools/trace-parser/parser/src/main/java/org/restcomm/protocols/ss7/tools/traceparser/SS7TraceParser.java#L1792-L1816 | train |
RestComm/jss7 | m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/MessageHandler.java | MessageHandler.getAspForNullRc | protected AspImpl getAspForNullRc() {
// We know if null RC, ASP cannot be shared and AspFactory will
// have only one ASP
AspImpl aspImpl = (AspImpl) this.aspFactoryImpl.aspList.get(0);
if (this.aspFactoryImpl.aspList.size() > 1) {
// verify that AS to which this ASP is ad... | java | protected AspImpl getAspForNullRc() {
// We know if null RC, ASP cannot be shared and AspFactory will
// have only one ASP
AspImpl aspImpl = (AspImpl) this.aspFactoryImpl.aspList.get(0);
if (this.aspFactoryImpl.aspList.size() > 1) {
// verify that AS to which this ASP is ad... | [
"protected",
"AspImpl",
"getAspForNullRc",
"(",
")",
"{",
"// We know if null RC, ASP cannot be shared and AspFactory will",
"// have only one ASP",
"AspImpl",
"aspImpl",
"=",
"(",
"AspImpl",
")",
"this",
".",
"aspFactoryImpl",
".",
"aspList",
".",
"get",
"(",
"0",
")",... | Get's the ASP for any ASP Traffic Maintenance, Management, Signalling Network Management and Transfer m3ua message's
received which has null Routing Context
@return | [
"Get",
"s",
"the",
"ASP",
"for",
"any",
"ASP",
"Traffic",
"Maintenance",
"Management",
"Signalling",
"Network",
"Management",
"and",
"Transfer",
"m3ua",
"message",
"s",
"received",
"which",
"has",
"null",
"Routing",
"Context"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/m3ua/impl/src/main/java/org/restcomm/protocols/ss7/m3ua/impl/MessageHandler.java#L62-L79 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3UserPartBaseImpl.java | Mtp3UserPartBaseImpl.sendTransferMessageToLocalUser | protected void sendTransferMessageToLocalUser(Mtp3TransferPrimitive msg, int seqControl) {
if (this.isStarted) {
MsgTransferDeliveryHandler hdl = new MsgTransferDeliveryHandler(msg);
seqControl = seqControl & slsFilter;
this.msgDeliveryExecutors[this.slsTable[seqControl]].ex... | java | protected void sendTransferMessageToLocalUser(Mtp3TransferPrimitive msg, int seqControl) {
if (this.isStarted) {
MsgTransferDeliveryHandler hdl = new MsgTransferDeliveryHandler(msg);
seqControl = seqControl & slsFilter;
this.msgDeliveryExecutors[this.slsTable[seqControl]].ex... | [
"protected",
"void",
"sendTransferMessageToLocalUser",
"(",
"Mtp3TransferPrimitive",
"msg",
",",
"int",
"seqControl",
")",
"{",
"if",
"(",
"this",
".",
"isStarted",
")",
"{",
"MsgTransferDeliveryHandler",
"hdl",
"=",
"new",
"MsgTransferDeliveryHandler",
"(",
"msg",
... | Deliver an incoming message to the local user
@param msg
@param effectiveSls For the thread selection (for message delivering) | [
"Deliver",
"an",
"incoming",
"message",
"to",
"the",
"local",
"user"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3UserPartBaseImpl.java#L251-L261 | train |
RestComm/jss7 | tools/simulator/bootstrap/src/main/java/org/restcomm/protocols/ss7/tools/simulator/bootstrap/Main.java | Main.getHomeDir | protected static String getHomeDir(String[] args) {
if (System.getenv(HOME_DIR) == null) {
if (args.length > index) {
return args[index++];
} else {
return ".";
}
} else {
return System.getenv(HOME_DIR);
}
} | java | protected static String getHomeDir(String[] args) {
if (System.getenv(HOME_DIR) == null) {
if (args.length > index) {
return args[index++];
} else {
return ".";
}
} else {
return System.getenv(HOME_DIR);
}
} | [
"protected",
"static",
"String",
"getHomeDir",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"System",
".",
"getenv",
"(",
"HOME_DIR",
")",
"==",
"null",
")",
"{",
"if",
"(",
"args",
".",
"length",
">",
"index",
")",
"{",
"return",
"args",
... | Gets the Media Server Home directory.
@param args the command line arguments
@return the path to the home directory. | [
"Gets",
"the",
"Media",
"Server",
"Home",
"directory",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/tools/simulator/bootstrap/src/main/java/org/restcomm/protocols/ss7/tools/simulator/bootstrap/Main.java#L251-L261 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3.java | Mtp3.linkUp | private void linkUp(Mtp2 link) {
if (link.mtp2Listener != null) {
link.mtp2Listener.linkUp();
}
linkset.add(link);
if (linkset.isActive() && this.mtp3Listener != null) {
try {
mtp3Listener.linkUp();
} catch (Exception e) {
... | java | private void linkUp(Mtp2 link) {
if (link.mtp2Listener != null) {
link.mtp2Listener.linkUp();
}
linkset.add(link);
if (linkset.isActive() && this.mtp3Listener != null) {
try {
mtp3Listener.linkUp();
} catch (Exception e) {
... | [
"private",
"void",
"linkUp",
"(",
"Mtp2",
"link",
")",
"{",
"if",
"(",
"link",
".",
"mtp2Listener",
"!=",
"null",
")",
"{",
"link",
".",
"mtp2Listener",
".",
"linkUp",
"(",
")",
";",
"}",
"linkset",
".",
"add",
"(",
"link",
")",
";",
"if",
"(",
"... | Notify that link is up.
@param link | [
"Notify",
"that",
"link",
"is",
"up",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3.java#L450-L467 | train |
RestComm/jss7 | mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3.java | Mtp3.checkPattern | private boolean checkPattern(Mtp2Buffer frame, int sltmLen, byte[] pattern) {
if (sltmLen != pattern.length) {
return false;
}
for (int i = 0; i < pattern.length; i++) {
if (frame.frame[i + PATTERN_OFFSET] != pattern[i]) {
return false;
}
... | java | private boolean checkPattern(Mtp2Buffer frame, int sltmLen, byte[] pattern) {
if (sltmLen != pattern.length) {
return false;
}
for (int i = 0; i < pattern.length; i++) {
if (frame.frame[i + PATTERN_OFFSET] != pattern[i]) {
return false;
}
... | [
"private",
"boolean",
"checkPattern",
"(",
"Mtp2Buffer",
"frame",
",",
"int",
"sltmLen",
",",
"byte",
"[",
"]",
"pattern",
")",
"{",
"if",
"(",
"sltmLen",
"!=",
"pattern",
".",
"length",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
... | +2 becuase frame.len contains 2B for CRC | [
"+",
"2",
"becuase",
"frame",
".",
"len",
"contains",
"2B",
"for",
"CRC"
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/mtp/mtp-impl/src/main/java/org/restcomm/protocols/ss7/mtp/Mtp3.java#L528-L538 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java | BcdHelper.bcdToHexString | public static String bcdToHexString(int encodingScheme, byte bcdByte) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
byte leftNibble = (byte) (bcdByte & 0xf0);
leftNibble = (byte) (leftNibble >>> 4);
leftNibble = (byte) (leftNibble & 0x0f);
byte rig... | java | public static String bcdToHexString(int encodingScheme, byte bcdByte) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
byte leftNibble = (byte) (bcdByte & 0xf0);
leftNibble = (byte) (leftNibble >>> 4);
leftNibble = (byte) (leftNibble & 0x0f);
byte rig... | [
"public",
"static",
"String",
"bcdToHexString",
"(",
"int",
"encodingScheme",
",",
"byte",
"bcdByte",
")",
"throws",
"UnsupportedEncodingException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"byte",
"leftNibble",
"=",
"(",
"byte",
"... | Converts single BCD encoded byte into String Hex representation.
@param bcdByte
@return String representation of BCD digits (two hex digits returned) | [
"Converts",
"single",
"BCD",
"encoded",
"byte",
"into",
"String",
"Hex",
"representation",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java#L134-L151 | train |
RestComm/jss7 | isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java | BcdHelper.bcdDecodeToHexString | public static String bcdDecodeToHexString(int encodingScheme, byte[] bcdBytes) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
for (byte b : bcdBytes) {
sb.append(bcdToHexString(encodingScheme, b));
}
if (GenericDigits._ENCODING_SCHEME_BCD_ODD =... | java | public static String bcdDecodeToHexString(int encodingScheme, byte[] bcdBytes) throws UnsupportedEncodingException {
StringBuilder sb = new StringBuilder();
for (byte b : bcdBytes) {
sb.append(bcdToHexString(encodingScheme, b));
}
if (GenericDigits._ENCODING_SCHEME_BCD_ODD =... | [
"public",
"static",
"String",
"bcdDecodeToHexString",
"(",
"int",
"encodingScheme",
",",
"byte",
"[",
"]",
"bcdBytes",
")",
"throws",
"UnsupportedEncodingException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"byte",
"b",... | Decoded BCD encoded string into Hex digits string.
@param encodingScheme BCD endcoding scheme to be used
@param bcdBytes bytes table to decode.
@return hex string representation of BCD encoded digits | [
"Decoded",
"BCD",
"encoded",
"string",
"into",
"Hex",
"digits",
"string",
"."
] | 402b4b3984e581c581e309cb5f6a858fde6dbc33 | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/isup/isup-impl/src/main/java/org/restcomm/protocols/ss7/isup/util/BcdHelper.java#L160-L171 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.initalize | private PowerShell initalize(String powerShellExecutablePath) throws PowerShellNotAvailableException {
String codePage = PowerShellCodepage.getIdentifierByCodePageName(Charset.defaultCharset().name());
ProcessBuilder pb;
//Start powershell executable in process
if (OSDetector.isWindows(... | java | private PowerShell initalize(String powerShellExecutablePath) throws PowerShellNotAvailableException {
String codePage = PowerShellCodepage.getIdentifierByCodePageName(Charset.defaultCharset().name());
ProcessBuilder pb;
//Start powershell executable in process
if (OSDetector.isWindows(... | [
"private",
"PowerShell",
"initalize",
"(",
"String",
"powerShellExecutablePath",
")",
"throws",
"PowerShellNotAvailableException",
"{",
"String",
"codePage",
"=",
"PowerShellCodepage",
".",
"getIdentifierByCodePageName",
"(",
"Charset",
".",
"defaultCharset",
"(",
")",
".... | Initializes PowerShell console in which we will enter the commands | [
"Initializes",
"PowerShell",
"console",
"in",
"which",
"we",
"will",
"enter",
"the",
"commands"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L136-L174 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeSingleCommand | public static PowerShellResponse executeSingleCommand(String command) {
PowerShellResponse response = null;
try (PowerShell session = PowerShell.openSession()) {
response = session.executeCommand(command);
} catch (PowerShellNotAvailableException ex) {
logger.log(Level.S... | java | public static PowerShellResponse executeSingleCommand(String command) {
PowerShellResponse response = null;
try (PowerShell session = PowerShell.openSession()) {
response = session.executeCommand(command);
} catch (PowerShellNotAvailableException ex) {
logger.log(Level.S... | [
"public",
"static",
"PowerShellResponse",
"executeSingleCommand",
"(",
"String",
"command",
")",
"{",
"PowerShellResponse",
"response",
"=",
"null",
";",
"try",
"(",
"PowerShell",
"session",
"=",
"PowerShell",
".",
"openSession",
"(",
")",
")",
"{",
"response",
... | Execute a single command in PowerShell console and gets result
@param command the command to execute
@return response with the output of the command | [
"Execute",
"a",
"single",
"command",
"in",
"PowerShell",
"console",
"and",
"gets",
"result"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L230-L240 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.handleResponse | private void handleResponse(PowerShellResponseHandler response, PowerShellResponse powerShellResponse) {
try {
response.handle(powerShellResponse);
} catch (Exception ex) {
logger.log(Level.SEVERE, "PowerShell not available", ex);
}
} | java | private void handleResponse(PowerShellResponseHandler response, PowerShellResponse powerShellResponse) {
try {
response.handle(powerShellResponse);
} catch (Exception ex) {
logger.log(Level.SEVERE, "PowerShell not available", ex);
}
} | [
"private",
"void",
"handleResponse",
"(",
"PowerShellResponseHandler",
"response",
",",
"PowerShellResponse",
"powerShellResponse",
")",
"{",
"try",
"{",
"response",
".",
"handle",
"(",
"powerShellResponse",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{"... | Handle response in callback way | [
"Handle",
"response",
"in",
"callback",
"way"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L262-L268 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeScript | @SuppressWarnings("WeakerAccess")
public PowerShellResponse executeScript(String scriptPath, String params) {
BufferedReader srcReader;
try {
srcReader = new BufferedReader(new FileReader(new File(scriptPath)));
} catch (FileNotFoundException fnfex) {
logger.log(Leve... | java | @SuppressWarnings("WeakerAccess")
public PowerShellResponse executeScript(String scriptPath, String params) {
BufferedReader srcReader;
try {
srcReader = new BufferedReader(new FileReader(new File(scriptPath)));
} catch (FileNotFoundException fnfex) {
logger.log(Leve... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"PowerShellResponse",
"executeScript",
"(",
"String",
"scriptPath",
",",
"String",
"params",
")",
"{",
"BufferedReader",
"srcReader",
";",
"try",
"{",
"srcReader",
"=",
"new",
"BufferedReader",
"(",
... | Executed the provided PowerShell script in PowerShell console and gets
result.
@param scriptPath the full path of the script
@param params the parameters of the script
@return response with the output of the command | [
"Executed",
"the",
"provided",
"PowerShell",
"script",
"in",
"PowerShell",
"console",
"and",
"gets",
"result",
"."
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L298-L311 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.executeScript | public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
PowerShellResponse response;
if (srcReader != null) {
File tmpFile = createWriteTempFile(srcReader);
if (tmpFile != null) {
this.scriptMode = true;
response = execut... | java | public PowerShellResponse executeScript(BufferedReader srcReader, String params) {
PowerShellResponse response;
if (srcReader != null) {
File tmpFile = createWriteTempFile(srcReader);
if (tmpFile != null) {
this.scriptMode = true;
response = execut... | [
"public",
"PowerShellResponse",
"executeScript",
"(",
"BufferedReader",
"srcReader",
",",
"String",
"params",
")",
"{",
"PowerShellResponse",
"response",
";",
"if",
"(",
"srcReader",
"!=",
"null",
")",
"{",
"File",
"tmpFile",
"=",
"createWriteTempFile",
"(",
"srcR... | Execute the provided PowerShell script in PowerShell console and gets
result.
@param srcReader the script as BufferedReader (when loading File from jar)
@param params the parameters of the script
@return response with the output of the command | [
"Execute",
"the",
"provided",
"PowerShell",
"script",
"in",
"PowerShell",
"console",
"and",
"gets",
"result",
"."
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L332-L349 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.createWriteTempFile | private File createWriteTempFile(BufferedReader srcReader) {
BufferedWriter tmpWriter = null;
File tmpFile = null;
try {
tmpFile = File.createTempFile("psscript_" + new Date().getTime(), ".ps1", this.tempFolder);
if (!tmpFile.exists()) {
return null;
... | java | private File createWriteTempFile(BufferedReader srcReader) {
BufferedWriter tmpWriter = null;
File tmpFile = null;
try {
tmpFile = File.createTempFile("psscript_" + new Date().getTime(), ".ps1", this.tempFolder);
if (!tmpFile.exists()) {
return null;
... | [
"private",
"File",
"createWriteTempFile",
"(",
"BufferedReader",
"srcReader",
")",
"{",
"BufferedWriter",
"tmpWriter",
"=",
"null",
";",
"File",
"tmpFile",
"=",
"null",
";",
"try",
"{",
"tmpFile",
"=",
"File",
".",
"createTempFile",
"(",
"\"psscript_\"",
"+",
... | Writes a temp powershell script file based on the srcReader | [
"Writes",
"a",
"temp",
"powershell",
"script",
"file",
"based",
"on",
"the",
"srcReader"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L352-L387 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.close | @Override
public void close() {
if (!this.closed) {
try {
Future<String> closeTask = threadpool.submit(() -> {
commandWriter.println("exit");
p.waitFor();
return "OK";
});
if (!closeAndWai... | java | @Override
public void close() {
if (!this.closed) {
try {
Future<String> closeTask = threadpool.submit(() -> {
commandWriter.println("exit");
p.waitFor();
return "OK";
});
if (!closeAndWai... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"closed",
")",
"{",
"try",
"{",
"Future",
"<",
"String",
">",
"closeTask",
"=",
"threadpool",
".",
"submit",
"(",
"(",
")",
"->",
"{",
"commandWriter",
".",
"pr... | Closes all the resources used to maintain the PowerShell context | [
"Closes",
"all",
"the",
"resources",
"used",
"to",
"maintain",
"the",
"PowerShell",
"context"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L392-L439 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShell.java | PowerShell.getTempFolder | private File getTempFolder(String tempPath) {
if (tempPath != null) {
File folder = new File(tempPath);
if (folder.exists()) {
return folder;
}
}
return null;
} | java | private File getTempFolder(String tempPath) {
if (tempPath != null) {
File folder = new File(tempPath);
if (folder.exists()) {
return folder;
}
}
return null;
} | [
"private",
"File",
"getTempFolder",
"(",
"String",
"tempPath",
")",
"{",
"if",
"(",
"tempPath",
"!=",
"null",
")",
"{",
"File",
"folder",
"=",
"new",
"File",
"(",
"tempPath",
")",
";",
"if",
"(",
"folder",
".",
"exists",
"(",
")",
")",
"{",
"return",... | Return the temp folder File object or null if the path does not exist | [
"Return",
"the",
"temp",
"folder",
"File",
"object",
"or",
"null",
"if",
"the",
"path",
"does",
"not",
"exist"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShell.java#L479-L487 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShellCodepage.java | PowerShellCodepage.getIdentifierByCodePageName | public static String getIdentifierByCodePageName(String cpName) {
if (cpName != null) {
for (Entry<String, String> codePage : codePages.entrySet()) {
if (codePage.getValue().toLowerCase().equals(cpName.toLowerCase())) {
return codePage.getKey();
}
... | java | public static String getIdentifierByCodePageName(String cpName) {
if (cpName != null) {
for (Entry<String, String> codePage : codePages.entrySet()) {
if (codePage.getValue().toLowerCase().equals(cpName.toLowerCase())) {
return codePage.getKey();
}
... | [
"public",
"static",
"String",
"getIdentifierByCodePageName",
"(",
"String",
"cpName",
")",
"{",
"if",
"(",
"cpName",
"!=",
"null",
")",
"{",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
">",
"codePage",
":",
"codePages",
".",
"entrySet",
"(",
")",
... | Get the CodePage code from encoding value
@param cpName the codepage name
@return String the identifier | [
"Get",
"the",
"CodePage",
"code",
"from",
"encoding",
"value"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShellCodepage.java#L201-L211 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java | PowerShellCommandProcessor.call | public String call() throws InterruptedException {
StringBuilder powerShellOutput = new StringBuilder();
try {
if (startReading()) {
readData(powerShellOutput);
}
} catch (IOException ioe) {
Logger.getLogger(PowerShell.class.getName()).log(Lev... | java | public String call() throws InterruptedException {
StringBuilder powerShellOutput = new StringBuilder();
try {
if (startReading()) {
readData(powerShellOutput);
}
} catch (IOException ioe) {
Logger.getLogger(PowerShell.class.getName()).log(Lev... | [
"public",
"String",
"call",
"(",
")",
"throws",
"InterruptedException",
"{",
"StringBuilder",
"powerShellOutput",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"try",
"{",
"if",
"(",
"startReading",
"(",
")",
")",
"{",
"readData",
"(",
"powerShellOutput",
")",
... | Calls the command and returns its output
@return String output of call
@throws InterruptedException error when reading data | [
"Calls",
"the",
"command",
"and",
"returns",
"its",
"output"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java#L65-L79 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java | PowerShellCommandProcessor.readData | private void readData(StringBuilder powerShellOutput) throws IOException {
String line;
while (null != (line = this.reader.readLine())) {
//In the case of script mode it finish when the last line is read
if (this.scriptMode) {
if (line.equals(PowerShell.END_SCRIP... | java | private void readData(StringBuilder powerShellOutput) throws IOException {
String line;
while (null != (line = this.reader.readLine())) {
//In the case of script mode it finish when the last line is read
if (this.scriptMode) {
if (line.equals(PowerShell.END_SCRIP... | [
"private",
"void",
"readData",
"(",
"StringBuilder",
"powerShellOutput",
")",
"throws",
"IOException",
"{",
"String",
"line",
";",
"while",
"(",
"null",
"!=",
"(",
"line",
"=",
"this",
".",
"reader",
".",
"readLine",
"(",
")",
")",
")",
"{",
"//In the case... | Reads all data from output | [
"Reads",
"all",
"data",
"from",
"output"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java#L82-L106 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java | PowerShellCommandProcessor.startReading | private boolean startReading() throws IOException, InterruptedException {
//If the reader is not ready, gives it some milliseconds
while (!this.reader.ready()) {
Thread.sleep(this.waitPause);
if (this.closed) {
return false;
}
}
return ... | java | private boolean startReading() throws IOException, InterruptedException {
//If the reader is not ready, gives it some milliseconds
while (!this.reader.ready()) {
Thread.sleep(this.waitPause);
if (this.closed) {
return false;
}
}
return ... | [
"private",
"boolean",
"startReading",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"//If the reader is not ready, gives it some milliseconds",
"while",
"(",
"!",
"this",
".",
"reader",
".",
"ready",
"(",
")",
")",
"{",
"Thread",
".",
"sleep",... | Checks when we can start reading the output. Timeout if it takes too long in order to avoid hangs | [
"Checks",
"when",
"we",
"can",
"start",
"reading",
"the",
"output",
".",
"Timeout",
"if",
"it",
"takes",
"too",
"long",
"in",
"order",
"to",
"avoid",
"hangs"
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java#L109-L118 | train |
profesorfalken/jPowerShell | src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java | PowerShellCommandProcessor.canContinueReading | private boolean canContinueReading() throws IOException, InterruptedException {
//If the reader is not ready, gives it some milliseconds
//It is important to do that, because the ready method guarantees that the readline will not be blocking
if (!this.reader.ready()) {
Thread.sleep(t... | java | private boolean canContinueReading() throws IOException, InterruptedException {
//If the reader is not ready, gives it some milliseconds
//It is important to do that, because the ready method guarantees that the readline will not be blocking
if (!this.reader.ready()) {
Thread.sleep(t... | [
"private",
"boolean",
"canContinueReading",
"(",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"//If the reader is not ready, gives it some milliseconds",
"//It is important to do that, because the ready method guarantees that the readline will not be blocking",
"if",
"("... | Checks when we the reader can continue to read. | [
"Checks",
"when",
"we",
"the",
"reader",
"can",
"continue",
"to",
"read",
"."
] | a0fb9d3b9db12dd5635de810e6366e17b932ee10 | https://github.com/profesorfalken/jPowerShell/blob/a0fb9d3b9db12dd5635de810e6366e17b932ee10/src/main/java/com/profesorfalken/jpowershell/PowerShellCommandProcessor.java#L121-L134 | train |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/ClassFilter.java | ClassFilter.any | public static FilterBuilder any(final Predicate... alternatives) {
return new CommonFilterBuilder() {
@Override
public boolean matches(Class<?> klass) {
for (Predicate alternative : alternatives) {
if (alternative.matches(klass)) {
return true;
}
}
return false;
}
};
} | java | public static FilterBuilder any(final Predicate... alternatives) {
return new CommonFilterBuilder() {
@Override
public boolean matches(Class<?> klass) {
for (Predicate alternative : alternatives) {
if (alternative.matches(klass)) {
return true;
}
}
return false;
}
};
} | [
"public",
"static",
"FilterBuilder",
"any",
"(",
"final",
"Predicate",
"...",
"alternatives",
")",
"{",
"return",
"new",
"CommonFilterBuilder",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Class",
"<",
"?",
">",
"klass",
")",
"{",
... | Returns a filter which satisfies any of the selected predicates.
@param alternatives alternative predicates
@return filter which satisfies any of the provided predicates | [
"Returns",
"a",
"filter",
"which",
"satisfies",
"any",
"of",
"the",
"selected",
"predicates",
"."
] | ad76c6bd8b4e84c594d94e48f466a095ffe2306a | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/ClassFilter.java#L287-L299 | train |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/processor/ClassIndexProcessor.java | ClassIndexProcessor.indexAnnotations | protected final void indexAnnotations(Class<?>... classes) {
for (Class<?> klass : classes) {
indexedAnnotations.add(klass.getCanonicalName());
}
annotationDriven = false;
} | java | protected final void indexAnnotations(Class<?>... classes) {
for (Class<?> klass : classes) {
indexedAnnotations.add(klass.getCanonicalName());
}
annotationDriven = false;
} | [
"protected",
"final",
"void",
"indexAnnotations",
"(",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"klass",
":",
"classes",
")",
"{",
"indexedAnnotations",
".",
"add",
"(",
"klass",
".",
"getCanonicalName",
"("... | Adds given annotations for indexing. | [
"Adds",
"given",
"annotations",
"for",
"indexing",
"."
] | ad76c6bd8b4e84c594d94e48f466a095ffe2306a | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/processor/ClassIndexProcessor.java#L100-L105 | train |
atteo/classindex | classindex/src/main/java/org/atteo/classindex/processor/ClassIndexProcessor.java | ClassIndexProcessor.indexSubclasses | protected final void indexSubclasses(Class<?>... classes) {
for (Class<?> klass : classes) {
indexedSuperclasses.add(klass.getCanonicalName());
}
annotationDriven = false;
} | java | protected final void indexSubclasses(Class<?>... classes) {
for (Class<?> klass : classes) {
indexedSuperclasses.add(klass.getCanonicalName());
}
annotationDriven = false;
} | [
"protected",
"final",
"void",
"indexSubclasses",
"(",
"Class",
"<",
"?",
">",
"...",
"classes",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"klass",
":",
"classes",
")",
"{",
"indexedSuperclasses",
".",
"add",
"(",
"klass",
".",
"getCanonicalName",
"("... | Adds given classes for subclass indexing. | [
"Adds",
"given",
"classes",
"for",
"subclass",
"indexing",
"."
] | ad76c6bd8b4e84c594d94e48f466a095ffe2306a | https://github.com/atteo/classindex/blob/ad76c6bd8b4e84c594d94e48f466a095ffe2306a/classindex/src/main/java/org/atteo/classindex/processor/ClassIndexProcessor.java#L110-L115 | train |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java | SipApplicationDispatcherImpl.isRouteExternal | public final boolean isRouteExternal(RouteHeader routeHeader) {
if (routeHeader != null) {
javax.sip.address.SipURI routeUri = (javax.sip.address.SipURI) routeHeader.getAddress().getURI();
String routeTransport = routeUri.getTransportParam();
if(routeTransport == null) {
routeTransport = ListeningPoint.... | java | public final boolean isRouteExternal(RouteHeader routeHeader) {
if (routeHeader != null) {
javax.sip.address.SipURI routeUri = (javax.sip.address.SipURI) routeHeader.getAddress().getURI();
String routeTransport = routeUri.getTransportParam();
if(routeTransport == null) {
routeTransport = ListeningPoint.... | [
"public",
"final",
"boolean",
"isRouteExternal",
"(",
"RouteHeader",
"routeHeader",
")",
"{",
"if",
"(",
"routeHeader",
"!=",
"null",
")",
"{",
"javax",
".",
"sip",
".",
"address",
".",
"SipURI",
"routeUri",
"=",
"(",
"javax",
".",
"sip",
".",
"address",
... | Check if the route is external
@param routeHeader the route to check
@return true if the route is external, false otherwise | [
"Check",
"if",
"the",
"route",
"is",
"external"
] | fd7011d2803ab1d205b140768a760c8c69e0c997 | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/SipApplicationDispatcherImpl.java#L1809-L1820 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.