spark device class to contain the communcation with spark