class EC2RaiderImpl implements EC2Raider {

    @Override
    public EC2Status getInstanceStatus(String name) {

        EC2Status ec2Status = null;
        Map instanceState = new HashMap();

        List tagNames = new ArrayList();
        tagNames.add(name);

        Filter filter1 = new Filter("tag:Name", tagNames);

        DescribeInstancesRequest request = new DescribeInstancesRequest();
        DescribeInstancesResult result = ec2Delegator.getEc2().describeInstances(request.withFilters(filter1));

        List<Reservation> reservations = result.getReservations();
        for (Reservation reservation : reservations) {
            List<Instance> instances = reservation.getInstances();

            for (Instance instance : instances) {
                instanceState.put(instance.getInstanceId(), instance.getState().getName());
            }
        }

        if (instanceState.isEmpty()) {
            throw new ResourceNotFoundException("Unable to find EC2 instances for tag: " + name);
        }

        ec2Status = new EC2Status();
        ec2Status.setStatus(instanceState);
        ec2Status.setTagName(name);

        return ec2Status;
    }

    public  EC2RaiderImpl();

}