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
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.createSecurityGroup
private CreateSecurityGroupResponseType createSecurityGroup(final String groupName, final String groupDescription, final String vpcId) { CreateSecurityGroupResponseType ret = new CreateSecurityGroupResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockSecurityGroup mockSecu...
java
private CreateSecurityGroupResponseType createSecurityGroup(final String groupName, final String groupDescription, final String vpcId) { CreateSecurityGroupResponseType ret = new CreateSecurityGroupResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockSecurityGroup mockSecu...
[ "private", "CreateSecurityGroupResponseType", "createSecurityGroup", "(", "final", "String", "groupName", ",", "final", "String", "groupDescription", ",", "final", "String", "vpcId", ")", "{", "CreateSecurityGroupResponseType", "ret", "=", "new", "CreateSecurityGroupRespons...
Handles "createSecurityGroup" request to create SecurityGroup and returns response with a SecurityGroup. @param vpcId vpc Id for SecurityGroup. @param groupName group Name. @param groupDescription group Desc. @return a CreateSecurityGroupResponseType with our new SecurityGroup
[ "Handles", "createSecurityGroup", "request", "to", "create", "SecurityGroup", "and", "returns", "response", "with", "a", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1494-L1502
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.authorizeSecurityGroupIngress
private AuthorizeSecurityGroupIngressResponseType authorizeSecurityGroupIngress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { AuthorizeSecurityGroupIngressResponseType ret = new AuthorizeSecurityGroupIngressResponseType(); ...
java
private AuthorizeSecurityGroupIngressResponseType authorizeSecurityGroupIngress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { AuthorizeSecurityGroupIngressResponseType ret = new AuthorizeSecurityGroupIngressResponseType(); ...
[ "private", "AuthorizeSecurityGroupIngressResponseType", "authorizeSecurityGroupIngress", "(", "final", "String", "groupId", ",", "final", "String", "ipProtocol", ",", "final", "Integer", "fromPort", ",", "final", "Integer", "toPort", ",", "final", "String", "cidrIp", ")...
Handles "authorizeSecurityGroupIngress" request to SecurityGroup and returns response with a SecurityGroup. @param groupId group Id for SecurityGroup. @param ipProtocol Ip protocol Name. @param fromPort from port ranges. @param toPort to port ranges. @param cidrIp cidr Ip for Permission @return a AuthorizeSecurityGrou...
[ "Handles", "authorizeSecurityGroupIngress", "request", "to", "SecurityGroup", "and", "returns", "response", "with", "a", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1513-L1519
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.authorizeSecurityGroupEgress
private AuthorizeSecurityGroupEgressResponseType authorizeSecurityGroupEgress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { AuthorizeSecurityGroupEgressResponseType ret = new AuthorizeSecurityGroupEgressResponseType(); ret.se...
java
private AuthorizeSecurityGroupEgressResponseType authorizeSecurityGroupEgress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { AuthorizeSecurityGroupEgressResponseType ret = new AuthorizeSecurityGroupEgressResponseType(); ret.se...
[ "private", "AuthorizeSecurityGroupEgressResponseType", "authorizeSecurityGroupEgress", "(", "final", "String", "groupId", ",", "final", "String", "ipProtocol", ",", "final", "Integer", "fromPort", ",", "final", "Integer", "toPort", ",", "final", "String", "cidrIp", ")",...
Handles "authorizeSecurityGroupEgress" request to SecurityGroup and returns response with a SecurityGroup. @param groupId group Id for SecurityGroup. @param ipProtocol Ip protocol Name. @param fromPort from port ranges. @param toPort to port ranges. @param cidrIp cidr Ip for Permission @return a AuthorizeSecurityGroup...
[ "Handles", "authorizeSecurityGroupEgress", "request", "to", "SecurityGroup", "and", "returns", "response", "with", "a", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1530-L1536
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.createInternetGateway
private CreateInternetGatewayResponseType createInternetGateway() { CreateInternetGatewayResponseType ret = new CreateInternetGatewayResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockInternetGateway mockInternetGateway = mockInternetGatewayController .createInte...
java
private CreateInternetGatewayResponseType createInternetGateway() { CreateInternetGatewayResponseType ret = new CreateInternetGatewayResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockInternetGateway mockInternetGateway = mockInternetGatewayController .createInte...
[ "private", "CreateInternetGatewayResponseType", "createInternetGateway", "(", ")", "{", "CreateInternetGatewayResponseType", "ret", "=", "new", "CreateInternetGatewayResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ".",...
Handles "createInternetGateway" request to create InternetGateway and returns response with a InternetGateway. @return a CreateInternetGatewayResponseType with our new InternetGateway
[ "Handles", "createInternetGateway", "request", "to", "create", "InternetGateway", "and", "returns", "response", "with", "a", "InternetGateway", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1542-L1551
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteRouteTable
private DeleteRouteTableResponseType deleteRouteTable(final String routeTableId) { DeleteRouteTableResponseType ret = new DeleteRouteTableResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockRouteTableController.deleteRouteTable(routeTableId); return ret; }
java
private DeleteRouteTableResponseType deleteRouteTable(final String routeTableId) { DeleteRouteTableResponseType ret = new DeleteRouteTableResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockRouteTableController.deleteRouteTable(routeTableId); return ret; }
[ "private", "DeleteRouteTableResponseType", "deleteRouteTable", "(", "final", "String", "routeTableId", ")", "{", "DeleteRouteTableResponseType", "ret", "=", "new", "DeleteRouteTableResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID",...
Handles "deleteRouteTable" request to delete routetable and returns response with a route table. @param routeTableId Route table Id. @return a CreateRouteTableResponseType with route table
[ "Handles", "deleteRouteTable", "request", "to", "delete", "routetable", "and", "returns", "response", "with", "a", "route", "table", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1558-L1563
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteSubnet
private DeleteSubnetResponseType deleteSubnet(final String subnetId) { DeleteSubnetResponseType ret = new DeleteSubnetResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockSubnetController.deleteSubnet(subnetId); return ret; }
java
private DeleteSubnetResponseType deleteSubnet(final String subnetId) { DeleteSubnetResponseType ret = new DeleteSubnetResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockSubnetController.deleteSubnet(subnetId); return ret; }
[ "private", "DeleteSubnetResponseType", "deleteSubnet", "(", "final", "String", "subnetId", ")", "{", "DeleteSubnetResponseType", "ret", "=", "new", "DeleteSubnetResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", "."...
Handles "deleteSubnet" request to delete subnet and returns response with a subnet. @param subnetId Subnet Id. @return a DeleteSubnetResponseType with subnet.
[ "Handles", "deleteSubnet", "request", "to", "delete", "subnet", "and", "returns", "response", "with", "a", "subnet", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1570-L1575
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteSecurityGroup
private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) { DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockSecurityGroupController.deleteSecurityGroup(securityGroupId); retur...
java
private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) { DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockSecurityGroupController.deleteSecurityGroup(securityGroupId); retur...
[ "private", "DeleteSecurityGroupResponseType", "deleteSecurityGroup", "(", "final", "String", "securityGroupId", ")", "{", "DeleteSecurityGroupResponseType", "ret", "=", "new", "DeleteSecurityGroupResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", ...
Handles "deleteSecurityGroup" request to delete SecurityGroup and returns response with a SecurityGroup. @param securityGroupId SecurityGroup Id. @return a DeleteSecurityGroupResponseType with SecurityGroup.
[ "Handles", "deleteSecurityGroup", "request", "to", "delete", "SecurityGroup", "and", "returns", "response", "with", "a", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1582-L1587
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteVolume
private DeleteVolumeResponseType deleteVolume(final String volumeId) { DeleteVolumeResponseType ret = new DeleteVolumeResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockVolumeController.deleteVolume(volumeId); return ret; }
java
private DeleteVolumeResponseType deleteVolume(final String volumeId) { DeleteVolumeResponseType ret = new DeleteVolumeResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockVolumeController.deleteVolume(volumeId); return ret; }
[ "private", "DeleteVolumeResponseType", "deleteVolume", "(", "final", "String", "volumeId", ")", "{", "DeleteVolumeResponseType", "ret", "=", "new", "DeleteVolumeResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", "."...
Handles "deleteVolume" request to delete volume and returns response with a volume. @param volumeId Volume Id. @return a DeleteVolumeResponseType with volume.
[ "Handles", "deleteVolume", "request", "to", "delete", "volume", "and", "returns", "response", "with", "a", "volume", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1594-L1599
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.isVolumeIdExists
private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) { if (volumeIds != null && volumeIds.size() > 0) { for (String volId : volumeIds) { if (volId.equals(volumeId)) { return true; } } } ...
java
private boolean isVolumeIdExists(final List<String> volumeIds, final String volumeId) { if (volumeIds != null && volumeIds.size() > 0) { for (String volId : volumeIds) { if (volId.equals(volumeId)) { return true; } } } ...
[ "private", "boolean", "isVolumeIdExists", "(", "final", "List", "<", "String", ">", "volumeIds", ",", "final", "String", "volumeId", ")", "{", "if", "(", "volumeIds", "!=", "null", "&&", "volumeIds", ".", "size", "(", ")", ">", "0", ")", "{", "for", "(...
Check whether volumeId exists in list. @param volumeIds List of volume Ids. @param volumeId to check in the list. @return true if volumeId is valid.
[ "Check", "whether", "volumeId", "exists", "in", "list", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1730-L1740
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.describeSubnets
private DescribeSubnetsResponseType describeSubnets() { DescribeSubnetsResponseType ret = new DescribeSubnetsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); SubnetSetType subnetSetType = new SubnetSetType(); for (Iterator<MockSubnet> mockSubnet = mockSubnetController.des...
java
private DescribeSubnetsResponseType describeSubnets() { DescribeSubnetsResponseType ret = new DescribeSubnetsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); SubnetSetType subnetSetType = new SubnetSetType(); for (Iterator<MockSubnet> mockSubnet = mockSubnetController.des...
[ "private", "DescribeSubnetsResponseType", "describeSubnets", "(", ")", "{", "DescribeSubnetsResponseType", "ret", "=", "new", "DescribeSubnetsResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ...
Handles "describeSubnets" request and returns response with a subnet Set. @return a DescribeSubnetsResponseType with Created Vpcs
[ "Handles", "describeSubnets", "request", "and", "returns", "response", "with", "a", "subnet", "Set", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1747-L1777
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.describeInternetGateways
private DescribeInternetGatewaysResponseType describeInternetGateways() { DescribeInternetGatewaysResponseType ret = new DescribeInternetGatewaysResponseType(); InternetGatewaySetType internetGatewaySet = new InternetGatewaySetType(); for (Iterator<MockInternetGateway> mockInternetGateway = mock...
java
private DescribeInternetGatewaysResponseType describeInternetGateways() { DescribeInternetGatewaysResponseType ret = new DescribeInternetGatewaysResponseType(); InternetGatewaySetType internetGatewaySet = new InternetGatewaySetType(); for (Iterator<MockInternetGateway> mockInternetGateway = mock...
[ "private", "DescribeInternetGatewaysResponseType", "describeInternetGateways", "(", ")", "{", "DescribeInternetGatewaysResponseType", "ret", "=", "new", "DescribeInternetGatewaysResponseType", "(", ")", ";", "InternetGatewaySetType", "internetGatewaySet", "=", "new", "InternetGat...
Handles "describeInternetGateways" request and returns response with a Internet gateway. @return a DescribeInternetGatewaysResponseType with Created InternetGateways.
[ "Handles", "describeInternetGateways", "request", "and", "returns", "response", "with", "a", "Internet", "gateway", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1784-L1824
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.describeSecurityGroups
private DescribeSecurityGroupsResponseType describeSecurityGroups() { DescribeSecurityGroupsResponseType ret = new DescribeSecurityGroupsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); SecurityGroupSetType securityGroupSet = new SecurityGroupSetType(); for (Iterator<Moc...
java
private DescribeSecurityGroupsResponseType describeSecurityGroups() { DescribeSecurityGroupsResponseType ret = new DescribeSecurityGroupsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); SecurityGroupSetType securityGroupSet = new SecurityGroupSetType(); for (Iterator<Moc...
[ "private", "DescribeSecurityGroupsResponseType", "describeSecurityGroups", "(", ")", "{", "DescribeSecurityGroupsResponseType", "ret", "=", "new", "DescribeSecurityGroupsResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ...
Handles "describeSecurityGroups" request and returns response with a security group. @return a DescribeInternetGatewaysResponseType with our predefined internet gateway in aws-mock.properties (or if not overridden, as defined in aws-mock-default.properties)
[ "Handles", "describeSecurityGroups", "request", "and", "returns", "response", "with", "a", "security", "group", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1832-L1880
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.describeVpcs
private DescribeVpcsResponseType describeVpcs() { DescribeVpcsResponseType ret = new DescribeVpcsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); VpcSetType vpcSet = new VpcSetType(); for (Iterator<MockVpc> mockVpc = mockVpcController.describeVpcs().iterator(); mockVpc ...
java
private DescribeVpcsResponseType describeVpcs() { DescribeVpcsResponseType ret = new DescribeVpcsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); VpcSetType vpcSet = new VpcSetType(); for (Iterator<MockVpc> mockVpc = mockVpcController.describeVpcs().iterator(); mockVpc ...
[ "private", "DescribeVpcsResponseType", "describeVpcs", "(", ")", "{", "DescribeVpcsResponseType", "ret", "=", "new", "DescribeVpcsResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ")", ...
Handles "describeVpcs" request and returns response with a vpc. @return a DescribeVpcsResponseType with our predefined vpc in aws-mock.properties (or if not overridden, as defined in aws-mock-default.properties)
[ "Handles", "describeVpcs", "request", "and", "returns", "response", "with", "a", "vpc", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1888-L1912
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.describeTags
private DescribeTagsResponseType describeTags() { DescribeTagsResponseType ret = new DescribeTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); TagSetType tagsSet = new TagSetType(); for (MockTags mockVpc : mockTagsController.describeTags()) { for (String r...
java
private DescribeTagsResponseType describeTags() { DescribeTagsResponseType ret = new DescribeTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); TagSetType tagsSet = new TagSetType(); for (MockTags mockVpc : mockTagsController.describeTags()) { for (String r...
[ "private", "DescribeTagsResponseType", "describeTags", "(", ")", "{", "DescribeTagsResponseType", "ret", "=", "new", "DescribeTagsResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ")", ...
Handles "describeTags" request and returns response with a Tags. @return a DescribeTagsResponseType with our predefined Tags in aws-mock.properties (or if not overridden, as defined in aws-mock-default.properties)
[ "Handles", "describeTags", "request", "and", "returns", "response", "with", "a", "Tags", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1920-L1941
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.createTags
private CreateTagsResponseType createTags(final List<String> resourcesSet, final Map<String, String> tagSet) { CreateTagsResponseType ret = new CreateTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockTagsController.createTags(resourcesSet, tagSet); ret.s...
java
private CreateTagsResponseType createTags(final List<String> resourcesSet, final Map<String, String> tagSet) { CreateTagsResponseType ret = new CreateTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockTagsController.createTags(resourcesSet, tagSet); ret.s...
[ "private", "CreateTagsResponseType", "createTags", "(", "final", "List", "<", "String", ">", "resourcesSet", ",", "final", "Map", "<", "String", ",", "String", ">", "tagSet", ")", "{", "CreateTagsResponseType", "ret", "=", "new", "CreateTagsResponseType", "(", "...
Handles "createTags" request and create new Tags. @param resourcesSet List of resourceIds. @param tagSet Map for key, value of tags. @return a CreateTagsResponseType with Status of Tags.
[ "Handles", "createTags", "request", "and", "create", "new", "Tags", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1949-L1956
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteTags
private DeleteTagsResponseType deleteTags(final List<String> resources) { DeleteTagsResponseType ret = new DeleteTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockTagsController.deleteTags(resources); return ret; }
java
private DeleteTagsResponseType deleteTags(final List<String> resources) { DeleteTagsResponseType ret = new DeleteTagsResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockTagsController.deleteTags(resources); return ret; }
[ "private", "DeleteTagsResponseType", "deleteTags", "(", "final", "List", "<", "String", ">", "resources", ")", "{", "DeleteTagsResponseType", "ret", "=", "new", "DeleteTagsResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", ...
Handles "deleteTags" request and delete Tags and returns response. @param resources : List of resource Id to be deleted. @return a DeleteTagsResponseType with Status
[ "Handles", "deleteTags", "request", "and", "delete", "Tags", "and", "returns", "response", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1963-L1969
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.createVpc
private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) { CreateVpcResponseType ret = new CreateVpcResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockVpc mockVpc = mockVpcController.createVpc(cidrBlock, instanceTenancy); VpcType vpc...
java
private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) { CreateVpcResponseType ret = new CreateVpcResponseType(); ret.setRequestId(UUID.randomUUID().toString()); MockVpc mockVpc = mockVpcController.createVpc(cidrBlock, instanceTenancy); VpcType vpc...
[ "private", "CreateVpcResponseType", "createVpc", "(", "final", "String", "cidrBlock", ",", "final", "String", "instanceTenancy", ")", "{", "CreateVpcResponseType", "ret", "=", "new", "CreateVpcResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ...
Handles "createVpc" request and create new Vpc. @param cidrBlock : vpc cidrBlock. @param instanceTenancy : vpc instanceTenancy. @return a CreateVpcResponseType with new Vpc.
[ "Handles", "createVpc", "request", "and", "create", "new", "Vpc", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1977-L1990
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.deleteVpc
private DeleteVpcResponseType deleteVpc(final String vpcId) { DeleteVpcResponseType ret = new DeleteVpcResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockVpcController.deleteVpc(vpcId); return ret; }
java
private DeleteVpcResponseType deleteVpc(final String vpcId) { DeleteVpcResponseType ret = new DeleteVpcResponseType(); ret.setRequestId(UUID.randomUUID().toString()); mockVpcController.deleteVpc(vpcId); return ret; }
[ "private", "DeleteVpcResponseType", "deleteVpc", "(", "final", "String", "vpcId", ")", "{", "DeleteVpcResponseType", "ret", "=", "new", "DeleteVpcResponseType", "(", ")", ";", "ret", ".", "setRequestId", "(", "UUID", ".", "randomUUID", "(", ")", ".", "toString",...
Handles "deleteVpc" request and delete Vpc and returns response. @param vpcId : Vpc Id to be deleted. @return a DeleteVpcResponseType with new Vpc
[ "Handles", "deleteVpc", "request", "and", "delete", "Vpc", "and", "returns", "response", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1997-L2003
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.getXmlError
private String getXmlError(final String errorCode, final String errorMessage) { Map<String, Object> data = new HashMap<String, Object>(); data.put("errorCode", StringEscapeUtils.escapeXml(errorCode)); data.put("errorMessage", StringEscapeUtils.escapeXml(errorMessage)); // fake a random U...
java
private String getXmlError(final String errorCode, final String errorMessage) { Map<String, Object> data = new HashMap<String, Object>(); data.put("errorCode", StringEscapeUtils.escapeXml(errorCode)); data.put("errorMessage", StringEscapeUtils.escapeXml(errorMessage)); // fake a random U...
[ "private", "String", "getXmlError", "(", "final", "String", "errorCode", ",", "final", "String", "errorMessage", ")", "{", "Map", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "data", ...
Generate error response body in xml and write it with writer. @param errorCode the error code wrapped in the xml response @param errorMessage the error message wrapped in the xml response @return xml body for an error message which can be recognized by AWS clients
[ "Generate", "error", "response", "body", "in", "xml", "and", "write", "it", "with", "writer", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L2014-L2030
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java
MockEC2QueryHandler.getBlankResponseXml
private String getBlankResponseXml() { Map<String, Object> data = new HashMap<String, Object>(); data.put("requestID", UUID.randomUUID().toString()); String ret = null; try { ret = TemplateUtils.get(BLANK_RESPONSE_TEMPLATE, data); } catch (AwsMockException e) { ...
java
private String getBlankResponseXml() { Map<String, Object> data = new HashMap<String, Object>(); data.put("requestID", UUID.randomUUID().toString()); String ret = null; try { ret = TemplateUtils.get(BLANK_RESPONSE_TEMPLATE, data); } catch (AwsMockException e) { ...
[ "private", "String", "getBlankResponseXml", "(", ")", "{", "Map", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "data", ".", "put", "(", "\"requestID\"", ",", "UUID", ".", "randomUUI...
Generate blank response body in xml and write it with writer. @return xml body blank response which can be recognized by AWS clients
[ "Generate", "blank", "response", "body", "in", "xml", "and", "write", "it", "with", "writer", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L2037-L2050
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java
MockEc2Controller.describeInstances
public Collection<AbstractMockEc2Instance> describeInstances(final Set<String> instanceIDs) { if (null == instanceIDs || instanceIDs.size() == 0) { return allMockEc2Instances.values(); } else { return getInstances(instanceIDs); } }
java
public Collection<AbstractMockEc2Instance> describeInstances(final Set<String> instanceIDs) { if (null == instanceIDs || instanceIDs.size() == 0) { return allMockEc2Instances.values(); } else { return getInstances(instanceIDs); } }
[ "public", "Collection", "<", "AbstractMockEc2Instance", ">", "describeInstances", "(", "final", "Set", "<", "String", ">", "instanceIDs", ")", "{", "if", "(", "null", "==", "instanceIDs", "||", "instanceIDs", ".", "size", "(", ")", "==", "0", ")", "{", "re...
List mock ec2 instances in current aws-mock. @param instanceIDs a filter of specified instance IDs for the target instance to describe @return a collection of {@link AbstractMockEc2Instance} with specified instance IDs, or all of the mock ec2 instances if no instance IDs as filtered
[ "List", "mock", "ec2", "instances", "in", "current", "aws", "-", "mock", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L102-L108
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java
MockEc2Controller.listInstanceIDs
public List<String> listInstanceIDs(final Set<String> instanceIDs) { Set<String> allInstanceIDs = allMockEc2Instances.keySet(); if (null == instanceIDs || instanceIDs.size() == 0) { return new ArrayList<String>(allInstanceIDs); } else { List<String> filteredInstanceIDs = ...
java
public List<String> listInstanceIDs(final Set<String> instanceIDs) { Set<String> allInstanceIDs = allMockEc2Instances.keySet(); if (null == instanceIDs || instanceIDs.size() == 0) { return new ArrayList<String>(allInstanceIDs); } else { List<String> filteredInstanceIDs = ...
[ "public", "List", "<", "String", ">", "listInstanceIDs", "(", "final", "Set", "<", "String", ">", "instanceIDs", ")", "{", "Set", "<", "String", ">", "allInstanceIDs", "=", "allMockEc2Instances", ".", "keySet", "(", ")", ";", "if", "(", "null", "==", "in...
List mock ec2 instance IDs in current aws-mock. @param instanceIDs a filter of specified instance IDs for the target instance to describe @return a collection of IDs with specified instance IDs, or all of the mock ec2 instanceIDs if not filtered
[ "List", "mock", "ec2", "instance", "IDs", "in", "current", "aws", "-", "mock", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L117-L130
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java
MockEc2Controller.stopInstances
public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) { List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>(); Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs); for (AbstractMockEc2Instance instance : instances) { ...
java
public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) { List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>(); Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs); for (AbstractMockEc2Instance instance : instances) { ...
[ "public", "List", "<", "InstanceStateChangeType", ">", "stopInstances", "(", "final", "Set", "<", "String", ">", "instanceIDs", ")", "{", "List", "<", "InstanceStateChangeType", ">", "ret", "=", "new", "ArrayList", "<", "InstanceStateChangeType", ">", "(", ")", ...
Stop one or more existing mock ec2 instances. @param instanceIDs a set of instance IDs for those instances to stop @return a list of state change messages (typically running to stopping)
[ "Stop", "one", "or", "more", "existing", "mock", "ec2", "instances", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L267-L295
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java
MockEc2Controller.getInstances
private Collection<AbstractMockEc2Instance> getInstances(final Set<String> instanceIDs) { Collection<AbstractMockEc2Instance> ret = new ArrayList<AbstractMockEc2Instance>(); for (String instanceID : instanceIDs) { ret.add(getMockEc2Instance(instanceID)); } return ret; }
java
private Collection<AbstractMockEc2Instance> getInstances(final Set<String> instanceIDs) { Collection<AbstractMockEc2Instance> ret = new ArrayList<AbstractMockEc2Instance>(); for (String instanceID : instanceIDs) { ret.add(getMockEc2Instance(instanceID)); } return ret; }
[ "private", "Collection", "<", "AbstractMockEc2Instance", ">", "getInstances", "(", "final", "Set", "<", "String", ">", "instanceIDs", ")", "{", "Collection", "<", "AbstractMockEc2Instance", ">", "ret", "=", "new", "ArrayList", "<", "AbstractMockEc2Instance", ">", ...
Get mock ec2 instances by instance IDs. @param instanceIDs IDs of the mock ec2 instances to get @return the mock ec2 instances object
[ "Get", "mock", "ec2", "instances", "by", "instance", "IDs", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L361-L367
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java
MockEc2Controller.destroyCleanupTerminatedInstanceTimer
public void destroyCleanupTerminatedInstanceTimer() { cleanupTerminatedInstancesScheduledFuture.cancel(true); cleanupTerminatedInstancesScheduledFuture = null; cleanupTerminatedInstancesTimer.shutdown(); cleanupTerminatedInstancesTimer = null; }
java
public void destroyCleanupTerminatedInstanceTimer() { cleanupTerminatedInstancesScheduledFuture.cancel(true); cleanupTerminatedInstancesScheduledFuture = null; cleanupTerminatedInstancesTimer.shutdown(); cleanupTerminatedInstancesTimer = null; }
[ "public", "void", "destroyCleanupTerminatedInstanceTimer", "(", ")", "{", "cleanupTerminatedInstancesScheduledFuture", ".", "cancel", "(", "true", ")", ";", "cleanupTerminatedInstancesScheduledFuture", "=", "null", ";", "cleanupTerminatedInstancesTimer", ".", "shutdown", "(",...
Cancel the internal timer of cleaning up terminated mock ec2 instances.
[ "Cancel", "the", "internal", "timer", "of", "cleaning", "up", "terminated", "mock", "ec2", "instances", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEc2Controller.java#L433-L438
train
treelogic-swe/aws-mock
example/java/full/client-usage/DescribeImagesExample.java
DescribeImagesExample.describeAllImages
public static List<Image> describeAllImages() { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); // the mock endpoint for ec2 whic...
java
public static List<Image> describeAllImages() { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); // the mock endpoint for ec2 whic...
[ "public", "static", "List", "<", "Image", ">", "describeAllImages", "(", ")", "{", "// pass any credentials as aws-mock does not authenticate them at all", "AWSCredentials", "credentials", "=", "new", "BasicAWSCredentials", "(", "\"foo\"", ",", "\"bar\"", ")", ";", "Amazo...
Describe all available AMIs within aws-mock. @return a list of AMIs
[ "Describe", "all", "available", "AMIs", "within", "aws", "-", "mock", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/full/client-usage/DescribeImagesExample.java#L30-L43
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java
MockVpcController.createVpc
public MockVpc createVpc( final String cidrBlock, final String instanceTenancy) { MockVpc ret = new MockVpc(); ret.setCidrBlock(cidrBlock); ret.setVpcId("vpc-" + UUID.randomUUID().toString().substring(0, VPC_ID_POSTFIX_LENGTH)); ret.setInstanceTenancy(instanceTenancy); ...
java
public MockVpc createVpc( final String cidrBlock, final String instanceTenancy) { MockVpc ret = new MockVpc(); ret.setCidrBlock(cidrBlock); ret.setVpcId("vpc-" + UUID.randomUUID().toString().substring(0, VPC_ID_POSTFIX_LENGTH)); ret.setInstanceTenancy(instanceTenancy); ...
[ "public", "MockVpc", "createVpc", "(", "final", "String", "cidrBlock", ",", "final", "String", "instanceTenancy", ")", "{", "MockVpc", "ret", "=", "new", "MockVpc", "(", ")", ";", "ret", ".", "setCidrBlock", "(", "cidrBlock", ")", ";", "ret", ".", "setVpcI...
Create the mock VPC. @param cidrBlock VPC cidr block. @param instanceTenancy VPC instance tenancy. @return mock VPC.
[ "Create", "the", "mock", "VPC", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java#L80-L98
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java
MockVpcController.deleteVpc
public MockVpc deleteVpc(final String vpcId) { if (vpcId != null && allMockVpcInstances.containsKey(vpcId)) { return allMockVpcInstances.remove(vpcId); } return null; }
java
public MockVpc deleteVpc(final String vpcId) { if (vpcId != null && allMockVpcInstances.containsKey(vpcId)) { return allMockVpcInstances.remove(vpcId); } return null; }
[ "public", "MockVpc", "deleteVpc", "(", "final", "String", "vpcId", ")", "{", "if", "(", "vpcId", "!=", "null", "&&", "allMockVpcInstances", ".", "containsKey", "(", "vpcId", ")", ")", "{", "return", "allMockVpcInstances", ".", "remove", "(", "vpcId", ")", ...
Delete vpc. @param vpcId vpcId to be deleted @return Mock vpc.
[ "Delete", "vpc", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVpcController.java#L107-L113
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java
MockCloudWatchQueryHandler.getMetricStatistics
private GetMetricStatisticsResponse getMetricStatistics(final String[] statistics, final DateTime startTime, final DateTime endTime, final int period, final String metricName) { GetMetricStatisticsResponse ret = new GetMetricStatisticsResponse(); GetMetricStatisticsResult result ...
java
private GetMetricStatisticsResponse getMetricStatistics(final String[] statistics, final DateTime startTime, final DateTime endTime, final int period, final String metricName) { GetMetricStatisticsResponse ret = new GetMetricStatisticsResponse(); GetMetricStatisticsResult result ...
[ "private", "GetMetricStatisticsResponse", "getMetricStatistics", "(", "final", "String", "[", "]", "statistics", ",", "final", "DateTime", "startTime", ",", "final", "DateTime", "endTime", ",", "final", "int", "period", ",", "final", "String", "metricName", ")", "...
Handles "GetMetricStatistics" request, as simple as without any filters to use. @param statistics Metric statistics. @param startTime Metric statistics start time. @param endTime Metric statistics end time. @param period Metric collection period. @param metricName Metric Name. @return a GetMetricStatisticsResult for m...
[ "Handles", "GetMetricStatistics", "request", "as", "simple", "as", "without", "any", "filters", "to", "use", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L339-L367
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java
MockCloudWatchQueryHandler.describeAlarms
private DescribeAlarmsResponse describeAlarms() { DescribeAlarmsResponse ret = new DescribeAlarmsResponse(); DescribeAlarmsResult result = new DescribeAlarmsResult(); MetricAlarms metricAlarms = new MetricAlarms(); MetricAlarm metricAlarm = new MetricAlarm(); metricAlarm.setAlar...
java
private DescribeAlarmsResponse describeAlarms() { DescribeAlarmsResponse ret = new DescribeAlarmsResponse(); DescribeAlarmsResult result = new DescribeAlarmsResult(); MetricAlarms metricAlarms = new MetricAlarms(); MetricAlarm metricAlarm = new MetricAlarm(); metricAlarm.setAlar...
[ "private", "DescribeAlarmsResponse", "describeAlarms", "(", ")", "{", "DescribeAlarmsResponse", "ret", "=", "new", "DescribeAlarmsResponse", "(", ")", ";", "DescribeAlarmsResult", "result", "=", "new", "DescribeAlarmsResult", "(", ")", ";", "MetricAlarms", "metricAlarms...
Handles "describeAlarms" request. @return a GetMetricStatisticsResult for metricName.
[ "Handles", "describeAlarms", "request", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L374-L396
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java
MockCloudWatchQueryHandler.toXMLGregorianCalendar
private XMLGregorianCalendar toXMLGregorianCalendar(final DateTime date) { GregorianCalendar gCalendar = new GregorianCalendar(date.getZone().toTimeZone()); gCalendar.setTime(date.toDate()); XMLGregorianCalendar xmlGrogerianCalendar = null; try { xmlGrogerianCalendar = Dataty...
java
private XMLGregorianCalendar toXMLGregorianCalendar(final DateTime date) { GregorianCalendar gCalendar = new GregorianCalendar(date.getZone().toTimeZone()); gCalendar.setTime(date.toDate()); XMLGregorianCalendar xmlGrogerianCalendar = null; try { xmlGrogerianCalendar = Dataty...
[ "private", "XMLGregorianCalendar", "toXMLGregorianCalendar", "(", "final", "DateTime", "date", ")", "{", "GregorianCalendar", "gCalendar", "=", "new", "GregorianCalendar", "(", "date", ".", "getZone", "(", ")", ".", "toTimeZone", "(", ")", ")", ";", "gCalendar", ...
Converts java.util.Date to javax.xml.datatype.XMLGregorianCalendar. @param date Date parameter. @return a XMLGregorianCalendar for date.
[ "Converts", "java", ".", "util", ".", "Date", "to", "javax", ".", "xml", ".", "datatype", ".", "XMLGregorianCalendar", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L405-L417
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java
MockCloudWatchQueryHandler.getMetricUnit
private StandardUnit getMetricUnit(final String metricName) { String result = null; if (metricName.equals(Constants.CPU_UTILIZATION)) { result = Constants.UNIT_PERCENT; } else if (metricName.equals(Constants.DISK_READ_BYTES)) { result = Constants.UNIT_BYTES; } el...
java
private StandardUnit getMetricUnit(final String metricName) { String result = null; if (metricName.equals(Constants.CPU_UTILIZATION)) { result = Constants.UNIT_PERCENT; } else if (metricName.equals(Constants.DISK_READ_BYTES)) { result = Constants.UNIT_BYTES; } el...
[ "private", "StandardUnit", "getMetricUnit", "(", "final", "String", "metricName", ")", "{", "String", "result", "=", "null", ";", "if", "(", "metricName", ".", "equals", "(", "Constants", ".", "CPU_UTILIZATION", ")", ")", "{", "result", "=", "Constants", "."...
Get the Metric Unit. @param metricName Metric Name parameter. @return Standard Unit Value.
[ "Get", "the", "Metric", "Unit", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/control/MockCloudWatchQueryHandler.java#L659-L695
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java
TemplateUtils.write
public static void write(final String templateFilename, final Map<String, Object> data, final Writer writer) { Template tmpl = null; try { /*- * note that we don't need to cache templates by ourselves since getTemplate() does that internally already */ ...
java
public static void write(final String templateFilename, final Map<String, Object> data, final Writer writer) { Template tmpl = null; try { /*- * note that we don't need to cache templates by ourselves since getTemplate() does that internally already */ ...
[ "public", "static", "void", "write", "(", "final", "String", "templateFilename", ",", "final", "Map", "<", "String", ",", "Object", ">", "data", ",", "final", "Writer", "writer", ")", "{", "Template", "tmpl", "=", "null", ";", "try", "{", "/*-\n ...
Process with given template + data and then put result to writer. @param templateFilename filename of the .ftl file @param data data to fill in the template, as pairs of key-values @param writer target writer to print the result
[ "Process", "with", "given", "template", "+", "data", "and", "then", "put", "result", "to", "writer", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java#L68-L110
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java
TemplateUtils.get
public static String get(final String templateName, final Map<String, Object> data) { StringWriter writer = new StringWriter(); write(templateName, data, writer); return writer.toString(); }
java
public static String get(final String templateName, final Map<String, Object> data) { StringWriter writer = new StringWriter(); write(templateName, data, writer); return writer.toString(); }
[ "public", "static", "String", "get", "(", "final", "String", "templateName", ",", "final", "Map", "<", "String", ",", "Object", ">", "data", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "write", "(", "templateName", ",", ...
Process with given template + data and get result as a string. @param templateName filename of the .ftl file @param data data to fill in the template, as pairs of key-values @return processed result from template and data
[ "Process", "with", "given", "template", "+", "data", "and", "get", "result", "as", "a", "string", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/TemplateUtils.java#L121-L125
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/PersistenceUtils.java
PersistenceUtils.saveAll
public static void saveAll(final Object obj, final PersistenceStoreType storeType) { try { File file = new File(persistenceStorePath + File.separator + storeType); // create necessary parent directories on file system File directory = file.getParentFile(); if (...
java
public static void saveAll(final Object obj, final PersistenceStoreType storeType) { try { File file = new File(persistenceStorePath + File.separator + storeType); // create necessary parent directories on file system File directory = file.getParentFile(); if (...
[ "public", "static", "void", "saveAll", "(", "final", "Object", "obj", ",", "final", "PersistenceStoreType", "storeType", ")", "{", "try", "{", "File", "file", "=", "new", "File", "(", "persistenceStorePath", "+", "File", ".", "separator", "+", "storeType", "...
Save object to the binary file defined as filename in property "persistence.store.file". @param obj the object to save, which should be serializable @param storeType the store type
[ "Save", "object", "to", "the", "binary", "file", "defined", "as", "filename", "in", "property", "persistence", ".", "store", ".", "file", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/PersistenceUtils.java#L132-L156
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/PersistenceUtils.java
PersistenceUtils.loadAll
public static Object loadAll(final PersistenceStoreType storeType) { Object ret = null; try { File file = new File(persistenceStorePath + File.separator + storeType); log.info("aws-mock: try to load objects from {}", file.getAbsolutePath()); ObjectInputStream in =...
java
public static Object loadAll(final PersistenceStoreType storeType) { Object ret = null; try { File file = new File(persistenceStorePath + File.separator + storeType); log.info("aws-mock: try to load objects from {}", file.getAbsolutePath()); ObjectInputStream in =...
[ "public", "static", "Object", "loadAll", "(", "final", "PersistenceStoreType", "storeType", ")", "{", "Object", "ret", "=", "null", ";", "try", "{", "File", "file", "=", "new", "File", "(", "persistenceStorePath", "+", "File", ".", "separator", "+", "storeTy...
Load object from the binary file defined as filename in property. @param storeType the store type @return the loaded object.
[ "Load", "object", "from", "the", "binary", "file", "defined", "as", "filename", "in", "property", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/PersistenceUtils.java#L164-L191
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockVolumeController.java
MockVolumeController.createVolume
public MockVolume createVolume( final String volumeType, final String size, final String availabilityZone, final int iops, final String snapshotId) { MockVolume ret = new MockVolume(); ret.setVolumeType(volumeType); ret.setVolumeId( "vol-" + U...
java
public MockVolume createVolume( final String volumeType, final String size, final String availabilityZone, final int iops, final String snapshotId) { MockVolume ret = new MockVolume(); ret.setVolumeType(volumeType); ret.setVolumeId( "vol-" + U...
[ "public", "MockVolume", "createVolume", "(", "final", "String", "volumeType", ",", "final", "String", "size", ",", "final", "String", "availabilityZone", ",", "final", "int", "iops", ",", "final", "String", "snapshotId", ")", "{", "MockVolume", "ret", "=", "ne...
Create the mock Volume. @param volumeType of Volume. @param size : Volume size. @param availabilityZone : Volume availability zone. @param iops : Volume iops count @param snapshotId : Volume's SnapshotId. @return mock Volume.
[ "Create", "the", "mock", "Volume", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVolumeController.java#L84-L100
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockVolumeController.java
MockVolumeController.deleteVolume
public MockVolume deleteVolume(final String volumeId) { if (volumeId != null && allMockVolumes.containsKey(volumeId)) { return allMockVolumes.remove(volumeId); } return null; }
java
public MockVolume deleteVolume(final String volumeId) { if (volumeId != null && allMockVolumes.containsKey(volumeId)) { return allMockVolumes.remove(volumeId); } return null; }
[ "public", "MockVolume", "deleteVolume", "(", "final", "String", "volumeId", ")", "{", "if", "(", "volumeId", "!=", "null", "&&", "allMockVolumes", ".", "containsKey", "(", "volumeId", ")", ")", "{", "return", "allMockVolumes", ".", "remove", "(", "volumeId", ...
Delete Mock Volume. @param volumeId volumeId to be deleted @return Mock volume.
[ "Delete", "Mock", "Volume", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockVolumeController.java#L109-L116
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/listener/AppServletContextListener.java
AppServletContextListener.contextInitialized
@Override public final void contextInitialized(final ServletContextEvent sce) { if (persistenceEnabled) { // Load ec2 instances AbstractMockEc2Instance[] instanceArray = (AbstractMockEc2Instance[]) PersistenceUtils .loadAll(PersistenceStoreType.EC2); i...
java
@Override public final void contextInitialized(final ServletContextEvent sce) { if (persistenceEnabled) { // Load ec2 instances AbstractMockEc2Instance[] instanceArray = (AbstractMockEc2Instance[]) PersistenceUtils .loadAll(PersistenceStoreType.EC2); i...
[ "@", "Override", "public", "final", "void", "contextInitialized", "(", "final", "ServletContextEvent", "sce", ")", "{", "if", "(", "persistenceEnabled", ")", "{", "// Load ec2 instances", "AbstractMockEc2Instance", "[", "]", "instanceArray", "=", "(", "AbstractMockEc2...
We load the saved instances if persistence of enabled, on web application starting. @param sce the context event object
[ "We", "load", "the", "saved", "instances", "if", "persistence", "of", "enabled", "on", "web", "application", "starting", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/listener/AppServletContextListener.java#L74-L139
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/listener/AppServletContextListener.java
AppServletContextListener.contextDestroyed
@Override public final void contextDestroyed(final ServletContextEvent sce) { Collection<AbstractMockEc2Instance> instances = MockEc2Controller.getInstance() .getAllMockEc2Instances(); for (AbstractMockEc2Instance instance : instances) { // cancel and destroy th...
java
@Override public final void contextDestroyed(final ServletContextEvent sce) { Collection<AbstractMockEc2Instance> instances = MockEc2Controller.getInstance() .getAllMockEc2Instances(); for (AbstractMockEc2Instance instance : instances) { // cancel and destroy th...
[ "@", "Override", "public", "final", "void", "contextDestroyed", "(", "final", "ServletContextEvent", "sce", ")", "{", "Collection", "<", "AbstractMockEc2Instance", ">", "instances", "=", "MockEc2Controller", ".", "getInstance", "(", ")", ".", "getAllMockEc2Instances",...
We save the instances if persistence of enabled, on web application shutting-down. @param sce the context event object
[ "We", "save", "the", "instances", "if", "persistence", "of", "enabled", "on", "web", "application", "shutting", "-", "down", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/listener/AppServletContextListener.java#L147-L208
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/cloudwatch/util/JAXBUtilCW.java
JAXBUtilCW.marshall
public static String marshall(final GetMetricStatisticsResponse obj, final String localPartQName, final String requestVersion) { StringWriter writer = new StringWriter(); try { /*- * call jaxbMarshaller.marshal() synchronized (fixes the issue of * ja...
java
public static String marshall(final GetMetricStatisticsResponse obj, final String localPartQName, final String requestVersion) { StringWriter writer = new StringWriter(); try { /*- * call jaxbMarshaller.marshal() synchronized (fixes the issue of * ja...
[ "public", "static", "String", "marshall", "(", "final", "GetMetricStatisticsResponse", "obj", ",", "final", "String", "localPartQName", ",", "final", "String", "requestVersion", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "try", ...
marshall object to string. @param obj GetMetricStatisticsResponse to be serialized and built into xml @param localPartQName local part of the QName @param requestVersion the version of CloudWatch API used by client (aws-sdk, cmd-line tools or other third-party client tools) @return xml representation bound to the given...
[ "marshall", "object", "to", "string", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/cloudwatch/util/JAXBUtilCW.java#L86-L135
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java
MockRouteTableController.createRouteTable
public MockRouteTable createRouteTable( final String cidrBlock, final String vpcId) { MockRouteTable ret = new MockRouteTable(); ret.setRouteTableId( "rtb-" + UUID.randomUUID().toString().substring(0, ROUTETABLE_ID_POSTFIX_LENGTH)); ret.setVpcId(vpcId); MockR...
java
public MockRouteTable createRouteTable( final String cidrBlock, final String vpcId) { MockRouteTable ret = new MockRouteTable(); ret.setRouteTableId( "rtb-" + UUID.randomUUID().toString().substring(0, ROUTETABLE_ID_POSTFIX_LENGTH)); ret.setVpcId(vpcId); MockR...
[ "public", "MockRouteTable", "createRouteTable", "(", "final", "String", "cidrBlock", ",", "final", "String", "vpcId", ")", "{", "MockRouteTable", "ret", "=", "new", "MockRouteTable", "(", ")", ";", "ret", ".", "setRouteTableId", "(", "\"rtb-\"", "+", "UUID", "...
Create the mock RouteTable. @param cidrBlock VPC cidr block. @param vpcId vpc Id for RouteTable. @return mock RouteTable.
[ "Create", "the", "mock", "RouteTable", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java#L83-L101
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java
MockRouteTableController.deleteRouteTable
public MockRouteTable deleteRouteTable(final String routetableId) { if (routetableId != null && allMockRouteTables.containsKey(routetableId)) { return allMockRouteTables.remove(routetableId); } return null; }
java
public MockRouteTable deleteRouteTable(final String routetableId) { if (routetableId != null && allMockRouteTables.containsKey(routetableId)) { return allMockRouteTables.remove(routetableId); } return null; }
[ "public", "MockRouteTable", "deleteRouteTable", "(", "final", "String", "routetableId", ")", "{", "if", "(", "routetableId", "!=", "null", "&&", "allMockRouteTables", ".", "containsKey", "(", "routetableId", ")", ")", "{", "return", "allMockRouteTables", ".", "rem...
Delete RouteTable. @param routetableId RouteTableId to be deleted @return Mock RouteTable.
[ "Delete", "RouteTable", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java#L110-L116
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java
MockRouteTableController.createRoute
public MockRoute createRoute( final String destinationCidrBlock, final String internetGatewayId, final String routeTableId) { MockRoute ret = new MockRoute(); ret.setDestinationCidrBlock(destinationCidrBlock); ret.setGatewayId(internetGatewayId); ret.setOrigin("C...
java
public MockRoute createRoute( final String destinationCidrBlock, final String internetGatewayId, final String routeTableId) { MockRoute ret = new MockRoute(); ret.setDestinationCidrBlock(destinationCidrBlock); ret.setGatewayId(internetGatewayId); ret.setOrigin("C...
[ "public", "MockRoute", "createRoute", "(", "final", "String", "destinationCidrBlock", ",", "final", "String", "internetGatewayId", ",", "final", "String", "routeTableId", ")", "{", "MockRoute", "ret", "=", "new", "MockRoute", "(", ")", ";", "ret", ".", "setDesti...
Create the mock Route. @param destinationCidrBlock : Route destinationCidrBlock. @param internetGatewayId : for gateway Id. @param routeTableId : for Route. @return mock Route.
[ "Create", "the", "mock", "Route", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java#L125-L139
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java
MockRouteTableController.getMockRouteTable
public MockRouteTable getMockRouteTable(final String routetableId) { if (routetableId != null) { return allMockRouteTables.get(routetableId); } return null; }
java
public MockRouteTable getMockRouteTable(final String routetableId) { if (routetableId != null) { return allMockRouteTables.get(routetableId); } return null; }
[ "public", "MockRouteTable", "getMockRouteTable", "(", "final", "String", "routetableId", ")", "{", "if", "(", "routetableId", "!=", "null", ")", "{", "return", "allMockRouteTables", ".", "get", "(", "routetableId", ")", ";", "}", "return", "null", ";", "}" ]
Get mock RouteTable instance by RouteTable ID. @param routetableId ID of the mock RouteTable to get @return the mock RouteTable object
[ "Get", "mock", "RouteTable", "instance", "by", "RouteTable", "ID", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockRouteTableController.java#L148-L154
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java
MockSecurityGroupController.createSecurityGroup
public MockSecurityGroup createSecurityGroup( final String groupName, final String groupDescription, final String vpcId) { MockSecurityGroup ret = new MockSecurityGroup(); ret.setGroupName(groupName); ret.setGroupDescription(groupDescription); ret.setGroupId( ...
java
public MockSecurityGroup createSecurityGroup( final String groupName, final String groupDescription, final String vpcId) { MockSecurityGroup ret = new MockSecurityGroup(); ret.setGroupName(groupName); ret.setGroupDescription(groupDescription); ret.setGroupId( ...
[ "public", "MockSecurityGroup", "createSecurityGroup", "(", "final", "String", "groupName", ",", "final", "String", "groupDescription", ",", "final", "String", "vpcId", ")", "{", "MockSecurityGroup", "ret", "=", "new", "MockSecurityGroup", "(", ")", ";", "ret", "."...
Create the mock SecurityGroup. @param groupName group Name. @param groupDescription group Description. @param vpcId vpc Id for Security Group. @return mock Security Group.
[ "Create", "the", "mock", "SecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java#L86-L107
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java
MockSecurityGroupController.authorizeSecurityGroupIngress
public MockSecurityGroup authorizeSecurityGroupIngress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { if (groupId == null) { return null; } MockSecurityGroup ret = allMockSecurityGroup.get(groupId); if ...
java
public MockSecurityGroup authorizeSecurityGroupIngress(final String groupId, final String ipProtocol, final Integer fromPort, final Integer toPort, final String cidrIp) { if (groupId == null) { return null; } MockSecurityGroup ret = allMockSecurityGroup.get(groupId); if ...
[ "public", "MockSecurityGroup", "authorizeSecurityGroupIngress", "(", "final", "String", "groupId", ",", "final", "String", "ipProtocol", ",", "final", "Integer", "fromPort", ",", "final", "Integer", "toPort", ",", "final", "String", "cidrIp", ")", "{", "if", "(", ...
Authorize the mock SecurityGroup to Ingress IpProtocol. @param groupId group Id. @param ipProtocol ipProtocol Ingress. @param fromPort fromPort for Security Group. @param toPort toPort for Security Group. @param cidrIp cidrIp for Ingress @return mock Security Group.
[ "Authorize", "the", "mock", "SecurityGroup", "to", "Ingress", "IpProtocol", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java#L118-L138
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java
MockSecurityGroupController.deleteSecurityGroup
public MockSecurityGroup deleteSecurityGroup(final String securityGroupId) { if (securityGroupId != null && allMockSecurityGroup.containsKey(securityGroupId)) { return allMockSecurityGroup.remove(securityGroupId); } return null; }
java
public MockSecurityGroup deleteSecurityGroup(final String securityGroupId) { if (securityGroupId != null && allMockSecurityGroup.containsKey(securityGroupId)) { return allMockSecurityGroup.remove(securityGroupId); } return null; }
[ "public", "MockSecurityGroup", "deleteSecurityGroup", "(", "final", "String", "securityGroupId", ")", "{", "if", "(", "securityGroupId", "!=", "null", "&&", "allMockSecurityGroup", ".", "containsKey", "(", "securityGroupId", ")", ")", "{", "return", "allMockSecurityGr...
Delete MockSecurityGroup. @param securityGroupId securityGroupId to be deleted @return MockSecurityGroup.
[ "Delete", "MockSecurityGroup", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockSecurityGroupController.java#L178-L185
train
treelogic-swe/aws-mock
example/java/simple/RunInstancesExample.java
RunInstancesExample.runInstances
public static List<Instance> runInstances(final String imageId, final int runCount) { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); ...
java
public static List<Instance> runInstances(final String imageId, final int runCount) { // pass any credentials as aws-mock does not authenticate them at all AWSCredentials credentials = new BasicAWSCredentials("foo", "bar"); AmazonEC2Client amazonEC2Client = new AmazonEC2Client(credentials); ...
[ "public", "static", "List", "<", "Instance", ">", "runInstances", "(", "final", "String", "imageId", ",", "final", "int", "runCount", ")", "{", "// pass any credentials as aws-mock does not authenticate them at all", "AWSCredentials", "credentials", "=", "new", "BasicAWSC...
Run some new ec2 instances. @param imageId AMI for running new instances from @param runCount count of instances to run @return a list of started instances
[ "Run", "some", "new", "ec2", "instances", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/example/java/simple/RunInstancesExample.java#L35-L56
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockTagsController.java
MockTagsController.createTags
public MockTags createTags( final List<String> resourcesSet, final Map<String, String> tagSet) { MockTags ret = new MockTags(); ret.setResourcesSet(resourcesSet); ret.setTagSet(tagSet); allMockTags.add(ret); return ret; }
java
public MockTags createTags( final List<String> resourcesSet, final Map<String, String> tagSet) { MockTags ret = new MockTags(); ret.setResourcesSet(resourcesSet); ret.setTagSet(tagSet); allMockTags.add(ret); return ret; }
[ "public", "MockTags", "createTags", "(", "final", "List", "<", "String", ">", "resourcesSet", ",", "final", "Map", "<", "String", ",", "String", ">", "tagSet", ")", "{", "MockTags", "ret", "=", "new", "MockTags", "(", ")", ";", "ret", ".", "setResourcesS...
Create the mock Tags. @param resourcesSet List of resourceIds. @param tagSet Map for key, value of tags. @return mock Tags.
[ "Create", "the", "mock", "Tags", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockTagsController.java#L74-L83
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/ec2/control/MockTagsController.java
MockTagsController.deleteTags
public boolean deleteTags(final List<String> resources) { for (MockTags mockTags : allMockTags) { if (mockTags.getResourcesSet().containsAll(resources)) { allMockTags.remove(mockTags); return true; } } return false; }
java
public boolean deleteTags(final List<String> resources) { for (MockTags mockTags : allMockTags) { if (mockTags.getResourcesSet().containsAll(resources)) { allMockTags.remove(mockTags); return true; } } return false; }
[ "public", "boolean", "deleteTags", "(", "final", "List", "<", "String", ">", "resources", ")", "{", "for", "(", "MockTags", "mockTags", ":", "allMockTags", ")", "{", "if", "(", "mockTags", ".", "getResourcesSet", "(", ")", ".", "containsAll", "(", "resourc...
Delete Mock tags. @param resources resources's tags to be deleted @return Mock tags.
[ "Delete", "Mock", "tags", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockTagsController.java#L92-L102
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/PropertiesUtils.java
PropertiesUtils.getPropertiesByPrefix
public static Set<String> getPropertiesByPrefix(final String propertyNamePrefix) { Set<String> ret = new TreeSet<String>(); Set<Object> keys = properties.keySet(); for (Object key : keys) { if (null != key && key.toString().startsWith(propertyNamePrefix)) { ret.add(p...
java
public static Set<String> getPropertiesByPrefix(final String propertyNamePrefix) { Set<String> ret = new TreeSet<String>(); Set<Object> keys = properties.keySet(); for (Object key : keys) { if (null != key && key.toString().startsWith(propertyNamePrefix)) { ret.add(p...
[ "public", "static", "Set", "<", "String", ">", "getPropertiesByPrefix", "(", "final", "String", "propertyNamePrefix", ")", "{", "Set", "<", "String", ">", "ret", "=", "new", "TreeSet", "<", "String", ">", "(", ")", ";", "Set", "<", "Object", ">", "keys",...
Get a set of properties those share the same given name prefix. @param propertyNamePrefix prefix of name @return the set of values whose property names share the same prefix
[ "Get", "a", "set", "of", "properties", "those", "share", "the", "same", "given", "name", "prefix", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/PropertiesUtils.java#L105-L116
train
treelogic-swe/aws-mock
src/main/java/com/tlswe/awsmock/common/util/PropertiesUtils.java
PropertiesUtils.getIntFromProperty
public static int getIntFromProperty(final String propertyName) { try { return Integer.parseInt(properties.getProperty(propertyName)); } catch (NumberFormatException e) { log.error("NumberFormatException caught during reading property from properties file: " +...
java
public static int getIntFromProperty(final String propertyName) { try { return Integer.parseInt(properties.getProperty(propertyName)); } catch (NumberFormatException e) { log.error("NumberFormatException caught during reading property from properties file: " +...
[ "public", "static", "int", "getIntFromProperty", "(", "final", "String", "propertyName", ")", "{", "try", "{", "return", "Integer", ".", "parseInt", "(", "properties", ".", "getProperty", "(", "propertyName", ")", ")", ";", "}", "catch", "(", "NumberFormatExce...
Get int type of property value by name. @param propertyName name of the property to get @return int type of value
[ "Get", "int", "type", "of", "property", "value", "by", "name", "." ]
1d1058c0ebbd0615efa28695481e36ae3ffc58a0
https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/common/util/PropertiesUtils.java#L125-L133
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.startScheduler
public static void startScheduler(int threadPoolSize, String annotatedJobsPackageName) throws SundialSchedulerException { try { createScheduler(threadPoolSize, annotatedJobsPackageName); getScheduler().start(); } catch (SchedulerException e) { throw new SundialSchedulerException(...
java
public static void startScheduler(int threadPoolSize, String annotatedJobsPackageName) throws SundialSchedulerException { try { createScheduler(threadPoolSize, annotatedJobsPackageName); getScheduler().start(); } catch (SchedulerException e) { throw new SundialSchedulerException(...
[ "public", "static", "void", "startScheduler", "(", "int", "threadPoolSize", ",", "String", "annotatedJobsPackageName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "createScheduler", "(", "threadPoolSize", ",", "annotatedJobsPackageName", ")", ";", "getS...
Starts the Sundial Scheduler @param threadPoolSize @param annotatedJobsPackageName A comma(,) or colon(:) can be used to specify multiple packages to scan for Jobs.
[ "Starts", "the", "Sundial", "Scheduler" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L84-L93
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.startJob
public static void startJob(String jobName) throws SundialSchedulerException { try { getScheduler().triggerJob(jobName, null); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR STARTING JOB!!!", e); } }
java
public static void startJob(String jobName) throws SundialSchedulerException { try { getScheduler().triggerJob(jobName, null); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR STARTING JOB!!!", e); } }
[ "public", "static", "void", "startJob", "(", "String", "jobName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "getScheduler", "(", ")", ".", "triggerJob", "(", "jobName", ",", "null", ")", ";", "}", "catch", "(", "SchedulerException", "e", "...
Starts a Job matching the given Job Name @param jobName
[ "Starts", "a", "Job", "matching", "the", "given", "Job", "Name" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L271-L278
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.removeJob
public static void removeJob(String jobName) throws SundialSchedulerException { try { getScheduler().deleteJob(jobName); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR REMOVING JOB!!!", e); } }
java
public static void removeJob(String jobName) throws SundialSchedulerException { try { getScheduler().deleteJob(jobName); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR REMOVING JOB!!!", e); } }
[ "public", "static", "void", "removeJob", "(", "String", "jobName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "getScheduler", "(", ")", ".", "deleteJob", "(", "jobName", ")", ";", "}", "catch", "(", "SchedulerException", "e", ")", "{", "thr...
Removes a Job matching the given Job Name @param jobName
[ "Removes", "a", "Job", "matching", "the", "given", "Job", "Name" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L285-L292
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.startJob
public static void startJob(String jobName, Map<String, Object> params) throws SundialSchedulerException { try { JobDataMap jobDataMap = new JobDataMap(); for (String key : params.keySet()) { // logger.debug("key= " + key); // logger.debug("value= " + pParams.get(key)); ...
java
public static void startJob(String jobName, Map<String, Object> params) throws SundialSchedulerException { try { JobDataMap jobDataMap = new JobDataMap(); for (String key : params.keySet()) { // logger.debug("key= " + key); // logger.debug("value= " + pParams.get(key)); ...
[ "public", "static", "void", "startJob", "(", "String", "jobName", ",", "Map", "<", "String", ",", "Object", ">", "params", ")", "throws", "SundialSchedulerException", "{", "try", "{", "JobDataMap", "jobDataMap", "=", "new", "JobDataMap", "(", ")", ";", "for"...
Starts a Job matching the the given Job Name found in jobs.xml or jobs manually added. @param jobName
[ "Starts", "a", "Job", "matching", "the", "the", "given", "Job", "Name", "found", "in", "jobs", ".", "xml", "or", "jobs", "manually", "added", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L299-L314
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.removeTrigger
public static void removeTrigger(String triggerName) throws SundialSchedulerException { try { getScheduler().unscheduleJob(triggerName); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR REMOVING TRIGGER!!!", e); } }
java
public static void removeTrigger(String triggerName) throws SundialSchedulerException { try { getScheduler().unscheduleJob(triggerName); } catch (SchedulerException e) { throw new SundialSchedulerException("ERROR REMOVING TRIGGER!!!", e); } }
[ "public", "static", "void", "removeTrigger", "(", "String", "triggerName", ")", "throws", "SundialSchedulerException", "{", "try", "{", "getScheduler", "(", ")", ".", "unscheduleJob", "(", "triggerName", ")", ";", "}", "catch", "(", "SchedulerException", "e", ")...
Removes a Trigger matching the the given Trigger Name @param triggerName
[ "Removes", "a", "Trigger", "matching", "the", "the", "given", "Trigger", "Name" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L490-L497
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.getAllJobNames
public static List<String> getAllJobNames() throws SundialSchedulerException { List<String> allJobNames = new ArrayList<String>(); try { Set<String> allJobKeys = getScheduler().getJobKeys(); for (String jobKey : allJobKeys) { allJobNames.add(jobKey); } } catch (SchedulerEx...
java
public static List<String> getAllJobNames() throws SundialSchedulerException { List<String> allJobNames = new ArrayList<String>(); try { Set<String> allJobKeys = getScheduler().getJobKeys(); for (String jobKey : allJobKeys) { allJobNames.add(jobKey); } } catch (SchedulerEx...
[ "public", "static", "List", "<", "String", ">", "getAllJobNames", "(", ")", "throws", "SundialSchedulerException", "{", "List", "<", "String", ">", "allJobNames", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "try", "{", "Set", "<", "String",...
Generates an alphabetically sorted List of all Job names in the DEFAULT job group @return
[ "Generates", "an", "alphabetically", "sorted", "List", "of", "all", "Job", "names", "in", "the", "DEFAULT", "job", "group" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L504-L518
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.getAllJobsAndTriggers
public static Map<String, List<Trigger>> getAllJobsAndTriggers() throws SundialSchedulerException { Map<String, List<Trigger>> allJobsMap = new TreeMap<String, List<Trigger>>(); try { Set<String> allJobKeys = getScheduler().getJobKeys(); for (String jobKey : allJobKeys) { List<...
java
public static Map<String, List<Trigger>> getAllJobsAndTriggers() throws SundialSchedulerException { Map<String, List<Trigger>> allJobsMap = new TreeMap<String, List<Trigger>>(); try { Set<String> allJobKeys = getScheduler().getJobKeys(); for (String jobKey : allJobKeys) { List<...
[ "public", "static", "Map", "<", "String", ",", "List", "<", "Trigger", ">", ">", "getAllJobsAndTriggers", "(", ")", "throws", "SundialSchedulerException", "{", "Map", "<", "String", ",", "List", "<", "Trigger", ">", ">", "allJobsMap", "=", "new", "TreeMap", ...
Generates a Map of all Job names with corresponding Triggers @return
[ "Generates", "a", "Map", "of", "all", "Job", "names", "with", "corresponding", "Triggers" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L525-L540
train
knowm/Sundial
src/main/java/org/knowm/sundial/SundialJobScheduler.java
SundialJobScheduler.shutdown
public static void shutdown() throws SundialSchedulerException { logger.debug("shutdown() called."); try { getScheduler().shutdown(); scheduler = null; } catch (Exception e) { throw new SundialSchedulerException("COULD NOT SHUTDOWN SCHEDULER!!!", e); } }
java
public static void shutdown() throws SundialSchedulerException { logger.debug("shutdown() called."); try { getScheduler().shutdown(); scheduler = null; } catch (Exception e) { throw new SundialSchedulerException("COULD NOT SHUTDOWN SCHEDULER!!!", e); } }
[ "public", "static", "void", "shutdown", "(", ")", "throws", "SundialSchedulerException", "{", "logger", ".", "debug", "(", "\"shutdown() called.\"", ")", ";", "try", "{", "getScheduler", "(", ")", ".", "shutdown", "(", ")", ";", "scheduler", "=", "null", ";"...
Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler.
[ "Halts", "the", "Scheduler", "s", "firing", "of", "Triggers", "and", "cleans", "up", "all", "resources", "associated", "with", "the", "Scheduler", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/SundialJobScheduler.java#L565-L575
train
knowm/Sundial
src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java
XMLSchedulingDataProcessor.initDocumentParser
private void initDocumentParser() throws ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setNamespaceAware(false); docBuilderFactory.setValidating(true); docBuilderFactory.setAttribute( "http://java.sun.com/xml/...
java
private void initDocumentParser() throws ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setNamespaceAware(false); docBuilderFactory.setValidating(true); docBuilderFactory.setAttribute( "http://java.sun.com/xml/...
[ "private", "void", "initDocumentParser", "(", ")", "throws", "ParserConfigurationException", "{", "DocumentBuilderFactory", "docBuilderFactory", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "docBuilderFactory", ".", "setNamespaceAware", "(", "false", ...
Initializes the XML parser. @throws ParserConfigurationException
[ "Initializes", "the", "XML", "parser", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java#L127-L146
train
knowm/Sundial
src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java
XMLSchedulingDataProcessor.processFile
public void processFile(String fileName, boolean failOnFileNotFound) throws Exception { boolean fileFound = false; InputStream f = null; try { String furl = null; File file = new File(fileName); // files in filesystem if (!file.exists()) { URL url = classLoadHelper.getResource(fi...
java
public void processFile(String fileName, boolean failOnFileNotFound) throws Exception { boolean fileFound = false; InputStream f = null; try { String furl = null; File file = new File(fileName); // files in filesystem if (!file.exists()) { URL url = classLoadHelper.getResource(fi...
[ "public", "void", "processFile", "(", "String", "fileName", ",", "boolean", "failOnFileNotFound", ")", "throws", "Exception", "{", "boolean", "fileFound", "=", "false", ";", "InputStream", "f", "=", "null", ";", "try", "{", "String", "furl", "=", "null", ";"...
Process the xml file in the given location, and schedule all of the jobs defined within it. @param fileName meta data file name.
[ "Process", "the", "xml", "file", "in", "the", "given", "location", "and", "schedule", "all", "of", "the", "jobs", "defined", "within", "it", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java#L171-L229
train
knowm/Sundial
src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java
XMLSchedulingDataProcessor.scheduleJobs
public void scheduleJobs(Scheduler sched) throws SchedulerException { List<JobDetail> jobs = new LinkedList<JobDetail>(getLoadedJobs()); List<OperableTrigger> triggers = new LinkedList<OperableTrigger>(getLoadedTriggers()); logger.info("Adding " + jobs.size() + " jobs, " + triggers.size() + " triggers.");...
java
public void scheduleJobs(Scheduler sched) throws SchedulerException { List<JobDetail> jobs = new LinkedList<JobDetail>(getLoadedJobs()); List<OperableTrigger> triggers = new LinkedList<OperableTrigger>(getLoadedTriggers()); logger.info("Adding " + jobs.size() + " jobs, " + triggers.size() + " triggers.");...
[ "public", "void", "scheduleJobs", "(", "Scheduler", "sched", ")", "throws", "SchedulerException", "{", "List", "<", "JobDetail", ">", "jobs", "=", "new", "LinkedList", "<", "JobDetail", ">", "(", "getLoadedJobs", "(", ")", ")", ";", "List", "<", "OperableTri...
Schedules the given sets of jobs and triggers. @param sched job scheduler. @exception SchedulerException if the Job or Trigger cannot be added to the Scheduler, or there is an internal Scheduler error.
[ "Schedules", "the", "given", "sets", "of", "jobs", "and", "triggers", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/plugins/xml/XMLSchedulingDataProcessor.java#L537-L583
train
knowm/Sundial
src/main/java/org/quartz/QuartzScheduler.java
QuartzScheduler.getSchedulerThreadGroup
public ThreadGroup getSchedulerThreadGroup() { if (threadGroup == null) { threadGroup = new ThreadGroup("QuartzScheduler"); if (quartzSchedulerResources.getMakeSchedulerThreadDaemon()) { threadGroup.setDaemon(true); } } return threadGroup; }
java
public ThreadGroup getSchedulerThreadGroup() { if (threadGroup == null) { threadGroup = new ThreadGroup("QuartzScheduler"); if (quartzSchedulerResources.getMakeSchedulerThreadDaemon()) { threadGroup.setDaemon(true); } } return threadGroup; }
[ "public", "ThreadGroup", "getSchedulerThreadGroup", "(", ")", "{", "if", "(", "threadGroup", "==", "null", ")", "{", "threadGroup", "=", "new", "ThreadGroup", "(", "\"QuartzScheduler\"", ")", ";", "if", "(", "quartzSchedulerResources", ".", "getMakeSchedulerThreadDa...
Returns the name of the thread group for Quartz's main threads.
[ "Returns", "the", "name", "of", "the", "thread", "group", "for", "Quartz", "s", "main", "threads", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/QuartzScheduler.java#L145-L155
train
knowm/Sundial
src/main/java/org/knowm/sundial/JobContainer.java
JobContainer.initContextContainer
protected void initContextContainer(JobExecutionContext jobExecutionContext) { JobContext jobContext = new JobContext(); jobContext.addQuartzContext(jobExecutionContext); contextContainer.set(jobContext); }
java
protected void initContextContainer(JobExecutionContext jobExecutionContext) { JobContext jobContext = new JobContext(); jobContext.addQuartzContext(jobExecutionContext); contextContainer.set(jobContext); }
[ "protected", "void", "initContextContainer", "(", "JobExecutionContext", "jobExecutionContext", ")", "{", "JobContext", "jobContext", "=", "new", "JobContext", "(", ")", ";", "jobContext", ".", "addQuartzContext", "(", "jobExecutionContext", ")", ";", "contextContainer"...
Initialize the ThreadLocal with a JobExecutionContext object @param jobExecutionContext
[ "Initialize", "the", "ThreadLocal", "with", "a", "JobExecutionContext", "object" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/JobContainer.java#L25-L30
train
knowm/Sundial
src/main/java/org/quartz/core/SimpleThreadPool.java
SimpleThreadPool.shutdown
@Override public void shutdown() { synchronized (nextRunnableLock) { isShutdown = true; if (workers == null) { return; } // signal each worker thread to shut down Iterator<WorkerThread> workerThreads = workers.iterator(); while (workerThreads.hasNext()) { Wor...
java
@Override public void shutdown() { synchronized (nextRunnableLock) { isShutdown = true; if (workers == null) { return; } // signal each worker thread to shut down Iterator<WorkerThread> workerThreads = workers.iterator(); while (workerThreads.hasNext()) { Wor...
[ "@", "Override", "public", "void", "shutdown", "(", ")", "{", "synchronized", "(", "nextRunnableLock", ")", "{", "isShutdown", "=", "true", ";", "if", "(", "workers", "==", "null", ")", "{", "return", ";", "}", "// signal each worker thread to shut down", "Ite...
Terminate any worker threads in this thread group. <p>Jobs currently in progress will complete.
[ "Terminate", "any", "worker", "threads", "in", "this", "thread", "group", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/core/SimpleThreadPool.java#L231-L258
train
knowm/Sundial
src/main/java/org/quartz/core/RAMJobStore.java
RAMJobStore.getTriggersForJob
@Override public List<Trigger> getTriggersForJob(String jobKey) { ArrayList<Trigger> trigList = new ArrayList<Trigger>(); synchronized (lock) { for (int i = 0; i < wrappedTriggers.size(); i++) { TriggerWrapper tw = wrappedTriggers.get(i); if (tw.jobKey.equals(jobKey)) { trigL...
java
@Override public List<Trigger> getTriggersForJob(String jobKey) { ArrayList<Trigger> trigList = new ArrayList<Trigger>(); synchronized (lock) { for (int i = 0; i < wrappedTriggers.size(); i++) { TriggerWrapper tw = wrappedTriggers.get(i); if (tw.jobKey.equals(jobKey)) { trigL...
[ "@", "Override", "public", "List", "<", "Trigger", ">", "getTriggersForJob", "(", "String", "jobKey", ")", "{", "ArrayList", "<", "Trigger", ">", "trigList", "=", "new", "ArrayList", "<", "Trigger", ">", "(", ")", ";", "synchronized", "(", "lock", ")", "...
Get all of the Triggers that are associated to the given Job. <p>If there are no matches, a zero-length array should be returned.
[ "Get", "all", "of", "the", "Triggers", "that", "are", "associated", "to", "the", "given", "Job", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/core/RAMJobStore.java#L364-L379
train
knowm/Sundial
src/main/java/org/quartz/plugins/xml/ValidationException.java
ValidationException.getMessage
@Override public String getMessage() { if (getValidationExceptions().size() == 0) { return super.getMessage(); } StringBuffer sb = new StringBuffer(); boolean first = true; for (Iterator iter = getValidationExceptions().iterator(); iter.hasNext(); ) { Exception e = (Exception) iter...
java
@Override public String getMessage() { if (getValidationExceptions().size() == 0) { return super.getMessage(); } StringBuffer sb = new StringBuffer(); boolean first = true; for (Iterator iter = getValidationExceptions().iterator(); iter.hasNext(); ) { Exception e = (Exception) iter...
[ "@", "Override", "public", "String", "getMessage", "(", ")", "{", "if", "(", "getValidationExceptions", "(", ")", ".", "size", "(", ")", "==", "0", ")", "{", "return", "super", ".", "getMessage", "(", ")", ";", "}", "StringBuffer", "sb", "=", "new", ...
Returns the detail message string. @return the detail message string.
[ "Returns", "the", "detail", "message", "string", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/plugins/xml/ValidationException.java#L76-L99
train
knowm/Sundial
src/main/java/org/knowm/sundial/JobContext.java
JobContext.addQuartzContext
public void addQuartzContext(JobExecutionContext jobExecutionContext) { for (Object mapKey : jobExecutionContext.getMergedJobDataMap().keySet()) { // logger.debug("added key: " + (String) mapKey); // logger.debug("added value: " + (String) // jobExecutionContext.getMergedJobDataMap().get(map...
java
public void addQuartzContext(JobExecutionContext jobExecutionContext) { for (Object mapKey : jobExecutionContext.getMergedJobDataMap().keySet()) { // logger.debug("added key: " + (String) mapKey); // logger.debug("added value: " + (String) // jobExecutionContext.getMergedJobDataMap().get(map...
[ "public", "void", "addQuartzContext", "(", "JobExecutionContext", "jobExecutionContext", ")", "{", "for", "(", "Object", "mapKey", ":", "jobExecutionContext", ".", "getMergedJobDataMap", "(", ")", ".", "keySet", "(", ")", ")", "{", "// logger.debug(\"added key: \" + (...
Add all the mappings from the JobExecutionContext to the JobContext @param jobExecutionContext
[ "Add", "all", "the", "mappings", "from", "the", "JobExecutionContext", "to", "the", "JobContext" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/JobContext.java#L33-L48
train
knowm/Sundial
src/main/java/org/knowm/sundial/JobContext.java
JobContext.get
@SuppressWarnings("unchecked") public <T> T get(String key) { T value = (T) map.get(key); return value; }
java
@SuppressWarnings("unchecked") public <T> T get(String key) { T value = (T) map.get(key); return value; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "get", "(", "String", "key", ")", "{", "T", "value", "=", "(", "T", ")", "map", ".", "get", "(", "key", ")", ";", "return", "value", ";", "}" ]
Get a value from a key out of the JobContext @param key @return
[ "Get", "a", "value", "from", "a", "key", "out", "of", "the", "JobContext" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/JobContext.java#L67-L72
train
knowm/Sundial
src/main/java/org/knowm/sundial/JobContext.java
JobContext.getRequiredValue
@SuppressWarnings("unchecked") public <T> T getRequiredValue(String key) { T value = (T) map.get(key); if (value == null) { throw new RequiredParameterException(); } return value; }
java
@SuppressWarnings("unchecked") public <T> T getRequiredValue(String key) { T value = (T) map.get(key); if (value == null) { throw new RequiredParameterException(); } return value; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "getRequiredValue", "(", "String", "key", ")", "{", "T", "value", "=", "(", "T", ")", "map", ".", "get", "(", "key", ")", ";", "if", "(", "value", "==", "null", ")", ...
Get a required value from a key out of the Job Context @param key @return
[ "Get", "a", "required", "value", "from", "a", "key", "out", "of", "the", "Job", "Context" ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/knowm/sundial/JobContext.java#L80-L88
train
knowm/Sundial
src/main/java/org/quartz/builders/CronTriggerBuilder.java
CronTriggerBuilder.cronTriggerBuilder
public static CronTriggerBuilder cronTriggerBuilder(String cronExpression) throws ParseException { CronExpression.validateExpression(cronExpression); return new CronTriggerBuilder(cronExpression); }
java
public static CronTriggerBuilder cronTriggerBuilder(String cronExpression) throws ParseException { CronExpression.validateExpression(cronExpression); return new CronTriggerBuilder(cronExpression); }
[ "public", "static", "CronTriggerBuilder", "cronTriggerBuilder", "(", "String", "cronExpression", ")", "throws", "ParseException", "{", "CronExpression", ".", "validateExpression", "(", "cronExpression", ")", ";", "return", "new", "CronTriggerBuilder", "(", "cronExpression...
Create a CronScheduleBuilder with the given cron-expression. @param cronExpression the cron expression to base the schedule on. @return the new CronScheduleBuilder @throws ParseException @see CronExpression
[ "Create", "a", "CronScheduleBuilder", "with", "the", "given", "cron", "-", "expression", "." ]
0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62
https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/builders/CronTriggerBuilder.java#L59-L63
train
chargebee/chargebee-java
src/main/java/com/chargebee/gdata/UnicodeEscaper.java
UnicodeEscaper.escape
public String escape(String string) { int end = string.length(); int index = nextEscapeIndex(string, 0, end); return index == end ? string : escapeSlow(string, index); }
java
public String escape(String string) { int end = string.length(); int index = nextEscapeIndex(string, 0, end); return index == end ? string : escapeSlow(string, index); }
[ "public", "String", "escape", "(", "String", "string", ")", "{", "int", "end", "=", "string", ".", "length", "(", ")", ";", "int", "index", "=", "nextEscapeIndex", "(", "string", ",", "0", ",", "end", ")", ";", "return", "index", "==", "end", "?", ...
Returns the escaped form of a given literal string. <p>If you are escaping input in arbitrary successive chunks, then it is not generally safe to use this method. If an input string ends with an unmatched high surrogate character, then this method will throw {@link IllegalArgumentException}. You should either ensure y...
[ "Returns", "the", "escaped", "form", "of", "a", "given", "literal", "string", "." ]
0772f9af799492bd94b789a39a8ae56f91d47c05
https://github.com/chargebee/chargebee-java/blob/0772f9af799492bd94b789a39a8ae56f91d47c05/src/main/java/com/chargebee/gdata/UnicodeEscaper.java#L140-L144
train
jmock-developers/jmock-library
jmock/src/main/java/org/jmock/lib/concurrent/DeterministicScheduler.java
DeterministicScheduler.tick
public void tick(long duration, TimeUnit timeUnit) { long remaining = toTicks(duration, timeUnit); do { remaining = deltaQueue.tick(remaining); runUntilIdle(); } while (deltaQueue.isNotEmpty() && remaining > 0); }
java
public void tick(long duration, TimeUnit timeUnit) { long remaining = toTicks(duration, timeUnit); do { remaining = deltaQueue.tick(remaining); runUntilIdle(); } while (deltaQueue.isNotEmpty() && remaining > 0); }
[ "public", "void", "tick", "(", "long", "duration", ",", "TimeUnit", "timeUnit", ")", "{", "long", "remaining", "=", "toTicks", "(", "duration", ",", "timeUnit", ")", ";", "do", "{", "remaining", "=", "deltaQueue", ".", "tick", "(", "remaining", ")", ";",...
Runs time forwards by a given duration, executing any commands scheduled for execution during that time period, and any background tasks spawned by the scheduled tasks. Therefore, when a call to tick returns, the executor will be idle. @param duration @param timeUnit
[ "Runs", "time", "forwards", "by", "a", "given", "duration", "executing", "any", "commands", "scheduled", "for", "execution", "during", "that", "time", "period", "and", "any", "background", "tasks", "spawned", "by", "the", "scheduled", "tasks", ".", "Therefore", ...
a6a9d32f3ed0df4a959d3c7421d5f336279b9962
https://github.com/jmock-developers/jmock-library/blob/a6a9d32f3ed0df4a959d3c7421d5f336279b9962/jmock/src/main/java/org/jmock/lib/concurrent/DeterministicScheduler.java#L40-L48
train
jmock-developers/jmock-library
jmock/src/main/java/org/jmock/Mockery.java
Mockery.assertIsSatisfied
public void assertIsSatisfied() { if (firstError != null) { throw firstError; } else if (!dispatcher.isSatisfied()) { throw expectationErrorTranslator.translate( ExpectationError.notAllSatisfied(this)); } }
java
public void assertIsSatisfied() { if (firstError != null) { throw firstError; } else if (!dispatcher.isSatisfied()) { throw expectationErrorTranslator.translate( ExpectationError.notAllSatisfied(this)); } }
[ "public", "void", "assertIsSatisfied", "(", ")", "{", "if", "(", "firstError", "!=", "null", ")", "{", "throw", "firstError", ";", "}", "else", "if", "(", "!", "dispatcher", ".", "isSatisfied", "(", ")", ")", "{", "throw", "expectationErrorTranslator", "."...
Fails the test if there are any expectations that have not been met.
[ "Fails", "the", "test", "if", "there", "are", "any", "expectations", "that", "have", "not", "been", "met", "." ]
a6a9d32f3ed0df4a959d3c7421d5f336279b9962
https://github.com/jmock-developers/jmock-library/blob/a6a9d32f3ed0df4a959d3c7421d5f336279b9962/jmock/src/main/java/org/jmock/Mockery.java#L225-L233
train
jmock-developers/jmock-library
jmock/src/main/java/org/jmock/lib/script/ScriptedAction.java
ScriptedAction.where
public ScriptedAction where(String name, Object value) { try { interpreter.set(name, value); } catch (EvalError e) { throw new IllegalArgumentException("invalid name binding", e); } return this; }
java
public ScriptedAction where(String name, Object value) { try { interpreter.set(name, value); } catch (EvalError e) { throw new IllegalArgumentException("invalid name binding", e); } return this; }
[ "public", "ScriptedAction", "where", "(", "String", "name", ",", "Object", "value", ")", "{", "try", "{", "interpreter", ".", "set", "(", "name", ",", "value", ")", ";", "}", "catch", "(", "EvalError", "e", ")", "{", "throw", "new", "IllegalArgumentExcep...
Defines a variable that can be referred to by the script. @param name the name of the variable @param value the value of the variable @return the action, so that more variables can be defined if needed
[ "Defines", "a", "variable", "that", "can", "be", "referred", "to", "by", "the", "script", "." ]
a6a9d32f3ed0df4a959d3c7421d5f336279b9962
https://github.com/jmock-developers/jmock-library/blob/a6a9d32f3ed0df4a959d3c7421d5f336279b9962/jmock/src/main/java/org/jmock/lib/script/ScriptedAction.java#L97-L105
train
jmock-developers/jmock-library
jmock/src/main/java/org/jmock/internal/InvocationExpectationBuilder.java
InvocationExpectationBuilder.asMockedType
@SuppressWarnings("unchecked") private <T> T asMockedType(@SuppressWarnings("unused") T mockObject, Object capturingImposter) { return (T) capturingImposter; }
java
@SuppressWarnings("unchecked") private <T> T asMockedType(@SuppressWarnings("unused") T mockObject, Object capturingImposter) { return (T) capturingImposter; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "<", "T", ">", "T", "asMockedType", "(", "@", "SuppressWarnings", "(", "\"unused\"", ")", "T", "mockObject", ",", "Object", "capturingImposter", ")", "{", "return", "(", "T", ")", "capturingImposte...
Damn you Java generics! Damn you to HELL!
[ "Damn", "you", "Java", "generics!", "Damn", "you", "to", "HELL!" ]
a6a9d32f3ed0df4a959d3c7421d5f336279b9962
https://github.com/jmock-developers/jmock-library/blob/a6a9d32f3ed0df4a959d3c7421d5f336279b9962/jmock/src/main/java/org/jmock/internal/InvocationExpectationBuilder.java#L77-L82
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.sendUpdates
protected synchronized void sendUpdates() { log.debug("sendUpdates"); // get the current version final int currentVersion = getVersion(); log.debug("Current version: {}", currentVersion); // get the name final String name = getName(); //get owner events ...
java
protected synchronized void sendUpdates() { log.debug("sendUpdates"); // get the current version final int currentVersion = getVersion(); log.debug("Current version: {}", currentVersion); // get the name final String name = getName(); //get owner events ...
[ "protected", "synchronized", "void", "sendUpdates", "(", ")", "{", "log", ".", "debug", "(", "\"sendUpdates\"", ")", ";", "// get the current version\r", "final", "int", "currentVersion", "=", "getVersion", "(", ")", ";", "log", ".", "debug", "(", "\"Current ver...
Send update notification over data channel of RTMP connection
[ "Send", "update", "notification", "over", "data", "channel", "of", "RTMP", "connection" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L301-L358
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.notifyModified
protected void notifyModified() { log.debug("notifyModified - modified: {} update counter: {}", modified.get(), updateCounter.get()); if (updateCounter.get() == 0) { if (modified.get()) { // client sent at least one update -> increase version of SO update...
java
protected void notifyModified() { log.debug("notifyModified - modified: {} update counter: {}", modified.get(), updateCounter.get()); if (updateCounter.get() == 0) { if (modified.get()) { // client sent at least one update -> increase version of SO update...
[ "protected", "void", "notifyModified", "(", ")", "{", "log", ".", "debug", "(", "\"notifyModified - modified: {} update counter: {}\"", ",", "modified", ".", "get", "(", ")", ",", "updateCounter", ".", "get", "(", ")", ")", ";", "if", "(", "updateCounter", "."...
Send notification about modification of SO
[ "Send", "notification", "about", "modification", "of", "SO" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L363-L377
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.returnAttributeValue
protected void returnAttributeValue(String name) { ownerMessage.addEvent(Type.CLIENT_UPDATE_DATA, name, getAttribute(name)); }
java
protected void returnAttributeValue(String name) { ownerMessage.addEvent(Type.CLIENT_UPDATE_DATA, name, getAttribute(name)); }
[ "protected", "void", "returnAttributeValue", "(", "String", "name", ")", "{", "ownerMessage", ".", "addEvent", "(", "Type", ".", "CLIENT_UPDATE_DATA", ",", "name", ",", "getAttribute", "(", "name", ")", ")", ";", "}" ]
Return an attribute value to the owner. @param name name
[ "Return", "an", "attribute", "value", "to", "the", "owner", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L395-L397
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.getAttribute
@Override public Object getAttribute(String name, Object value) { log.debug("getAttribute - name: {} value: {}", name, value); Object result = null; if (name != null) { result = attributes.putIfAbsent(name, value); if (result == null) { // no pr...
java
@Override public Object getAttribute(String name, Object value) { log.debug("getAttribute - name: {} value: {}", name, value); Object result = null; if (name != null) { result = attributes.putIfAbsent(name, value); if (result == null) { // no pr...
[ "@", "Override", "public", "Object", "getAttribute", "(", "String", "name", ",", "Object", "value", ")", "{", "log", ".", "debug", "(", "\"getAttribute - name: {} value: {}\"", ",", "name", ",", "value", ")", ";", "Object", "result", "=", "null", ";", "if", ...
Return attribute by name and set if it doesn't exist yet. @param name Attribute name @param value Value to set if attribute doesn't exist @return Attribute value
[ "Return", "attribute", "by", "name", "and", "set", "if", "it", "doesn", "t", "exist", "yet", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L408-L426
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.removeAttribute
@Override public boolean removeAttribute(String name) { boolean result = true; // Send confirmation to client final SharedObjectEvent event = new SharedObjectEvent(Type.CLIENT_DELETE_DATA, name, null); if (ownerMessage.addEvent(event)) { if (super.removeAttribute(na...
java
@Override public boolean removeAttribute(String name) { boolean result = true; // Send confirmation to client final SharedObjectEvent event = new SharedObjectEvent(Type.CLIENT_DELETE_DATA, name, null); if (ownerMessage.addEvent(event)) { if (super.removeAttribute(na...
[ "@", "Override", "public", "boolean", "removeAttribute", "(", "String", "name", ")", "{", "boolean", "result", "=", "true", ";", "// Send confirmation to client\r", "final", "SharedObjectEvent", "event", "=", "new", "SharedObjectEvent", "(", "Type", ".", "CLIENT_DEL...
Removes attribute with given name @param name Attribute @return true if there's such an attribute and it was removed, false otherwise
[ "Removes", "attribute", "with", "given", "name" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L490-L506
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.sendMessage
protected void sendMessage(String handler, List<?> arguments) { final SharedObjectEvent event = new SharedObjectEvent(Type.CLIENT_SEND_MESSAGE, handler, arguments); if (ownerMessage.addEvent(event)) { syncEvents.add(event); sendStats.incrementAndGet(); if (log.is...
java
protected void sendMessage(String handler, List<?> arguments) { final SharedObjectEvent event = new SharedObjectEvent(Type.CLIENT_SEND_MESSAGE, handler, arguments); if (ownerMessage.addEvent(event)) { syncEvents.add(event); sendStats.incrementAndGet(); if (log.is...
[ "protected", "void", "sendMessage", "(", "String", "handler", ",", "List", "<", "?", ">", "arguments", ")", "{", "final", "SharedObjectEvent", "event", "=", "new", "SharedObjectEvent", "(", "Type", ".", "CLIENT_SEND_MESSAGE", ",", "handler", ",", "arguments", ...
Broadcast event to event handler @param handler Event handler @param arguments Arguments
[ "Broadcast", "event", "to", "event", "handler" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L516-L525
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.register
protected boolean register(IEventListener listener) { log.debug("register - listener: {}", listener); boolean registered = listeners.add(listener); if (registered) { listenerStats.increment(); // prepare response for new client ownerMessage.addEvent(Type...
java
protected boolean register(IEventListener listener) { log.debug("register - listener: {}", listener); boolean registered = listeners.add(listener); if (registered) { listenerStats.increment(); // prepare response for new client ownerMessage.addEvent(Type...
[ "protected", "boolean", "register", "(", "IEventListener", "listener", ")", "{", "log", ".", "debug", "(", "\"register - listener: {}\"", ",", "listener", ")", ";", "boolean", "registered", "=", "listeners", ".", "add", "(", "listener", ")", ";", "if", "(", ...
Register event listener @param listener Event listener @return true if listener was added
[ "Register", "event", "listener" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L580-L597
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.unregister
protected void unregister(IEventListener listener) { log.debug("unregister - listener: {}", listener); if (listeners.remove(listener)) { listenerStats.decrement(); } }
java
protected void unregister(IEventListener listener) { log.debug("unregister - listener: {}", listener); if (listeners.remove(listener)) { listenerStats.decrement(); } }
[ "protected", "void", "unregister", "(", "IEventListener", "listener", ")", "{", "log", ".", "debug", "(", "\"unregister - listener: {}\"", ",", "listener", ")", ";", "if", "(", "listeners", ".", "remove", "(", "listener", ")", ")", "{", "listenerStats", ".", ...
Unregister event listener @param listener Event listener
[ "Unregister", "event", "listener" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L605-L610
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.checkRelease
protected void checkRelease() { if (!isPersistent() && listeners.isEmpty() && !isAcquired()) { log.info("Deleting shared object {} because all clients disconnected and it is no longer acquired", name); if (storage != null) { if (!storage.remove(this)) { ...
java
protected void checkRelease() { if (!isPersistent() && listeners.isEmpty() && !isAcquired()) { log.info("Deleting shared object {} because all clients disconnected and it is no longer acquired", name); if (storage != null) { if (!storage.remove(this)) { ...
[ "protected", "void", "checkRelease", "(", ")", "{", "if", "(", "!", "isPersistent", "(", ")", "&&", "listeners", ".", "isEmpty", "(", ")", "&&", "!", "isAcquired", "(", ")", ")", "{", "log", ".", "info", "(", "\"Deleting shared object {} because all clients ...
Check if shared object must be released.
[ "Check", "if", "shared", "object", "must", "be", "released", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L615-L625
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.beginUpdate
protected void beginUpdate(IEventListener listener) { log.debug("beginUpdate - listener: {}", listener); source = listener; // increase number of pending updates updateCounter.incrementAndGet(); }
java
protected void beginUpdate(IEventListener listener) { log.debug("beginUpdate - listener: {}", listener); source = listener; // increase number of pending updates updateCounter.incrementAndGet(); }
[ "protected", "void", "beginUpdate", "(", "IEventListener", "listener", ")", "{", "log", ".", "debug", "(", "\"beginUpdate - listener: {}\"", ",", "listener", ")", ";", "source", "=", "listener", ";", "// increase number of pending updates\r", "updateCounter", ".", "in...
Begin update of this Shared Object and setting listener @param listener Update with listener
[ "Begin", "update", "of", "this", "Shared", "Object", "and", "setting", "listener" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L650-L655
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.clear
protected boolean clear() { log.debug("clear"); super.removeAttributes(); // send confirmation to client ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, name, null); notifyModified(); changeStats.incrementAndGet(); return true; }
java
protected boolean clear() { log.debug("clear"); super.removeAttributes(); // send confirmation to client ownerMessage.addEvent(Type.CLIENT_CLEAR_DATA, name, null); notifyModified(); changeStats.incrementAndGet(); return true; }
[ "protected", "boolean", "clear", "(", ")", "{", "log", ".", "debug", "(", "\"clear\"", ")", ";", "super", ".", "removeAttributes", "(", ")", ";", "// send confirmation to client\r", "ownerMessage", ".", "addEvent", "(", "Type", ".", "CLIENT_CLEAR_DATA", ",", "...
Deletes all the attributes and sends a clear event to all listeners. The persistent data object is also removed from a persistent shared object. @return true on success, false otherwise
[ "Deletes", "all", "the", "attributes", "and", "sends", "a", "clear", "event", "to", "all", "listeners", ".", "The", "persistent", "data", "object", "is", "also", "removed", "from", "a", "persistent", "shared", "object", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L713-L721
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.close
protected void close() { log.debug("close"); closed.compareAndSet(false, true); // clear collections super.removeAttributes(); listeners.clear(); syncEvents.clear(); ownerMessage.getEvents().clear(); }
java
protected void close() { log.debug("close"); closed.compareAndSet(false, true); // clear collections super.removeAttributes(); listeners.clear(); syncEvents.clear(); ownerMessage.getEvents().clear(); }
[ "protected", "void", "close", "(", ")", "{", "log", ".", "debug", "(", "\"close\"", ")", ";", "closed", ".", "compareAndSet", "(", "false", ",", "true", ")", ";", "// clear collections\r", "super", ".", "removeAttributes", "(", ")", ";", "listeners", ".", ...
Detaches a reference from this shared object, reset it's state, this will destroy the reference immediately. This is useful when you don't want to proxy a shared object any longer.
[ "Detaches", "a", "reference", "from", "this", "shared", "object", "reset", "it", "s", "state", "this", "will", "destroy", "the", "reference", "immediately", ".", "This", "is", "useful", "when", "you", "don", "t", "want", "to", "proxy", "a", "shared", "obje...
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L727-L735
train
Red5/red5-server-common
src/main/java/org/red5/server/ClientRegistry.java
ClientRegistry.addClient
private void addClient(String id, IClient client) { // check to see if the id already exists first if (!hasClient(id)) { clients.put(id, client); } else { log.debug("Client id: {} already registered", id); } }
java
private void addClient(String id, IClient client) { // check to see if the id already exists first if (!hasClient(id)) { clients.put(id, client); } else { log.debug("Client id: {} already registered", id); } }
[ "private", "void", "addClient", "(", "String", "id", ",", "IClient", "client", ")", "{", "// check to see if the id already exists first\r", "if", "(", "!", "hasClient", "(", "id", ")", ")", "{", "clients", ".", "put", "(", "id", ",", "client", ")", ";", "...
Add the client to the registry
[ "Add", "the", "client", "to", "the", "registry" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/ClientRegistry.java#L97-L104
train
Red5/red5-server-common
src/main/java/org/red5/server/ClientRegistry.java
ClientRegistry.getClientList
public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; }
java
public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; }
[ "public", "ClientList", "<", "Client", ">", "getClientList", "(", ")", "{", "ClientList", "<", "Client", ">", "list", "=", "new", "ClientList", "<", "Client", ">", "(", ")", ";", "for", "(", "IClient", "c", ":", "clients", ".", "values", "(", ")", ")...
Returns a list of Clients.
[ "Returns", "a", "list", "of", "Clients", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/ClientRegistry.java#L117-L123
train
Red5/red5-server-common
src/main/java/org/red5/server/ClientRegistry.java
ClientRegistry.getClients
@SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { // avoid creating new Collection object if no clients exist. return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); }
java
@SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { // avoid creating new Collection object if no clients exist. return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "protected", "Collection", "<", "IClient", ">", "getClients", "(", ")", "{", "if", "(", "!", "hasClients", "(", ")", ")", "{", "// avoid creating new Collection object if no clients exist.\r", "return", "Collections"...
Return collection of clients @return Collection of clients
[ "Return", "collection", "of", "clients" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/ClientRegistry.java#L147-L154
train
Red5/red5-server-common
src/main/java/org/red5/server/ClientRegistry.java
ClientRegistry.newClient
public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { // derive client id from the connection params or use next String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; }
java
public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { // derive client id from the connection params or use next String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; }
[ "public", "IClient", "newClient", "(", "Object", "[", "]", "params", ")", "throws", "ClientNotFoundException", ",", "ClientRejectedException", "{", "// derive client id from the connection params or use next\r", "String", "id", "=", "nextId", "(", ")", ";", "IClient", "...
Return client from next id with given params @param params Client params @return Client object @throws ClientNotFoundException if client not found @throws ClientRejectedException if client rejected
[ "Return", "client", "from", "next", "id", "with", "given", "params" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/ClientRegistry.java#L195-L201
train
Red5/red5-server-common
src/main/java/org/red5/server/ClientRegistry.java
ClientRegistry.nextId
public String nextId() { String id = "-1"; do { // when we reach max int, reset to zero if (nextId.get() == Integer.MAX_VALUE) { nextId.set(0); } id = String.format("%d", nextId.getAndIncrement()); } while (hasClient(id)); ...
java
public String nextId() { String id = "-1"; do { // when we reach max int, reset to zero if (nextId.get() == Integer.MAX_VALUE) { nextId.set(0); } id = String.format("%d", nextId.getAndIncrement()); } while (hasClient(id)); ...
[ "public", "String", "nextId", "(", ")", "{", "String", "id", "=", "\"-1\"", ";", "do", "{", "// when we reach max int, reset to zero\r", "if", "(", "nextId", ".", "get", "(", ")", "==", "Integer", ".", "MAX_VALUE", ")", "{", "nextId", ".", "set", "(", "0...
Return next client id @return Next client id
[ "Return", "next", "client", "id" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/ClientRegistry.java#L208-L218
train
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObjectService.java
SharedObjectService.getStore
private IPersistenceStore getStore(IScope scope, boolean persistent) { IPersistenceStore store; if (!persistent) { // Use special store for non-persistent shared objects if (!scope.hasAttribute(SO_TRANSIENT_STORE)) { store = new RamPersistence(scope); ...
java
private IPersistenceStore getStore(IScope scope, boolean persistent) { IPersistenceStore store; if (!persistent) { // Use special store for non-persistent shared objects if (!scope.hasAttribute(SO_TRANSIENT_STORE)) { store = new RamPersistence(scope); ...
[ "private", "IPersistenceStore", "getStore", "(", "IScope", "scope", ",", "boolean", "persistent", ")", "{", "IPersistenceStore", "store", ";", "if", "(", "!", "persistent", ")", "{", "// Use special store for non-persistent shared objects\r", "if", "(", "!", "scope", ...
Return scope store @param scope Scope @param persistent Persistent store or not? @return Scope's store
[ "Return", "scope", "store" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObjectService.java#L112-L136
train
Red5/red5-server-common
src/main/java/org/red5/server/api/persistence/PersistenceUtils.java
PersistenceUtils.getPersistenceStoreConstructor
private static Constructor<?> getPersistenceStoreConstructor(Class<?> theClass, Class<?>[] interfaces) throws Exception { Constructor<?> constructor = null; for (Class<?> interfaceClass : interfaces) { try { constructor = theClass.getConstructor(new Class[] { interfaceCla...
java
private static Constructor<?> getPersistenceStoreConstructor(Class<?> theClass, Class<?>[] interfaces) throws Exception { Constructor<?> constructor = null; for (Class<?> interfaceClass : interfaces) { try { constructor = theClass.getConstructor(new Class[] { interfaceCla...
[ "private", "static", "Constructor", "<", "?", ">", "getPersistenceStoreConstructor", "(", "Class", "<", "?", ">", "theClass", ",", "Class", "<", "?", ">", "[", "]", "interfaces", ")", "throws", "Exception", "{", "Constructor", "<", "?", ">", "constructor", ...
Returns persistence store object class constructor @param theClass Persistence store class @param interfaces Interfaces that are being implemented by persistence store object class @return Constructor @throws Exception
[ "Returns", "persistence", "store", "object", "class", "constructor" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/api/persistence/PersistenceUtils.java#L43-L60
train
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/message/ChunkHeader.java
ChunkHeader.read
public static ChunkHeader read(IoBuffer in) { int remaining = in.remaining(); if (remaining > 0) { byte headerByte = in.get(); ChunkHeader h = new ChunkHeader(); // going to check highest 2 bits h.format = (byte) ((0b11000000 & headerByte) >> 6); ...
java
public static ChunkHeader read(IoBuffer in) { int remaining = in.remaining(); if (remaining > 0) { byte headerByte = in.get(); ChunkHeader h = new ChunkHeader(); // going to check highest 2 bits h.format = (byte) ((0b11000000 & headerByte) >> 6); ...
[ "public", "static", "ChunkHeader", "read", "(", "IoBuffer", "in", ")", "{", "int", "remaining", "=", "in", ".", "remaining", "(", ")", ";", "if", "(", "remaining", ">", "0", ")", "{", "byte", "headerByte", "=", "in", ".", "get", "(", ")", ";", "Chu...
Read chunk header from the buffer. @param in buffer @return ChunkHeader instance
[ "Read", "chunk", "header", "from", "the", "buffer", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/message/ChunkHeader.java#L121-L164
train
Red5/red5-server-common
src/main/java/org/red5/server/stream/consumer/SlicedFileConsumer.java
SlicedFileConsumer.acquireWriteFuture
private boolean acquireWriteFuture(int sliceLength) { if (sliceLength > 0) { Object writeResult = null; // determine a good timeout value based on the slice length to write int timeout = sliceLength * 500; // check for existing future if (writerF...
java
private boolean acquireWriteFuture(int sliceLength) { if (sliceLength > 0) { Object writeResult = null; // determine a good timeout value based on the slice length to write int timeout = sliceLength * 500; // check for existing future if (writerF...
[ "private", "boolean", "acquireWriteFuture", "(", "int", "sliceLength", ")", "{", "if", "(", "sliceLength", ">", "0", ")", "{", "Object", "writeResult", "=", "null", ";", "// determine a good timeout value based on the slice length to write\r", "int", "timeout", "=", "...
Get the WriteFuture with a timeout based on the length of the slice to write. @param sliceLength @return true if successful and false otherwise
[ "Get", "the", "WriteFuture", "with", "a", "timeout", "based", "on", "the", "length", "of", "the", "slice", "to", "write", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/consumer/SlicedFileConsumer.java#L376-L395
train
Red5/red5-server-common
src/main/java/org/red5/server/stream/consumer/SlicedFileConsumer.java
SlicedFileConsumer.uninit
public void uninit() { if (initialized.get()) { log.debug("Uninit"); if (writer != null) { if (writerFuture != null) { try { writerFuture.get(); } catch (Exception e) { log.war...
java
public void uninit() { if (initialized.get()) { log.debug("Uninit"); if (writer != null) { if (writerFuture != null) { try { writerFuture.get(); } catch (Exception e) { log.war...
[ "public", "void", "uninit", "(", ")", "{", "if", "(", "initialized", ".", "get", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Uninit\"", ")", ";", "if", "(", "writer", "!=", "null", ")", "{", "if", "(", "writerFuture", "!=", "null", ")", "{",...
Reset or uninitialize
[ "Reset", "or", "uninitialize" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/stream/consumer/SlicedFileConsumer.java#L499-L526
train