com.evolution.player.core.media
Class EncryptingMusicProvider

java.lang.Object
  extended by com.evolution.player.core.media.MusicProvider
      extended by com.evolution.player.core.media.EncryptingMusicProvider

public abstract class EncryptingMusicProvider
extends MusicProvider

An encrypting music provider is a music provider which does share its providing music in encrypted form. The provider is asked to encrypt a media it can encrypt before the media is send to the network and it is asked to decript the encrypted media when the network receives an encrypted media which the music provider can decrypt.

Clients must implement

Since:
0.6

Constructor Summary
EncryptingMusicProvider()
           
 
Method Summary
abstract  boolean canDecrypt(EncriptedMedia media)
          Can this provider decrypt the given media?
abstract  boolean canEncrypt(LocalMediaInfo media)
          Can this provider encrypt the given media?
abstract  LocalMediaInfo decrypt(EncriptedMedia media, IProgressMonitor monitor)
          Decrypt the given media into a local media.
abstract  EncriptedMedia encrypt(LocalMediaInfo media)
          Encrypt the given media.
 
Methods inherited from class com.evolution.player.core.media.MusicProvider
canHandle, verify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptingMusicProvider

public EncryptingMusicProvider()
Method Detail

canDecrypt

public abstract boolean canDecrypt(EncriptedMedia media)
Can this provider decrypt the given media?

Parameters:
media - the media to inspect
Returns:
true if this can decrypt the given media

decrypt

public abstract LocalMediaInfo decrypt(EncriptedMedia media,
                                       IProgressMonitor monitor)
Decrypt the given media into a local media. This is only called if canDecrypt(EncriptedMedia) returns true for the same media.

Parameters:
media - the media to decrypt
monitor - a monitor to report progress to
Returns:
the decrypted media

canEncrypt

public abstract boolean canEncrypt(LocalMediaInfo media)
Can this provider encrypt the given media?

Parameters:
media - the media to inspect
Returns:
true if this can encrypt the given media

encrypt

public abstract EncriptedMedia encrypt(LocalMediaInfo media)
Encrypt the given media. This is only called if canEncrypt(LocalMediaInfo) is true for the same media.

Parameters:
media - the media to encrypt
Returns:
the encripted media