|
YAACC - UPNP Client and Server
|
The part of a confirmed file share that talks to the provider and the registry, on a worker thread: it opens the file (or copies it), registers it for the CHOSEN receivers, waits for the local HTTP server and builds the item to play. More...

Classes | |
| interface | Addresses |
| What a share allows is decided before: the addresses of the receivers are fixed at confirm. More... | |
| class | Prepared |
| A registered share and the item that plays it. | |
Public Member Functions | |
| ShareService (Context appContext, UpnpClient upnpClient) | |
| Prepared | prepare (PendingShare.Data data, Set< String > receiverIds) |
| Worker thread only. | |
| Prepared | prepareFor (PendingShare.Data data, Set< String > allowedAddresses) |
| Same, with the allowed receiver addresses given (resolved once at the confirm, not at every later bind: a receiver that changed its address or left the registry must not change what its share allows). | |
Static Public Member Functions | |
| static boolean | hasAddress (String ip) |
| Whether there is an address a receiver could fetch from. | |
| static String | proxyUrl (String ip, String key) |
The URL a receiver fetches a share from: http://<ip>:<port>/proxy/<key>. | |
| static int | failureTextRes (boolean providerCallRefusedBusy, boolean copySlotBusy) |
| The message the user gets when a shared file or link could not be taken or opened. | |
The part of a confirmed file share that talks to the provider and the registry, on a worker thread: it opens the file (or copies it), registers it for the CHOSEN receivers, waits for the local HTTP server and builds the item to play.
Every failure closes the source, deletes the copy and removes the registry key before it returns null, so the caller has nothing to clean up.
Nothing here logs the URI, the name, the key or the proxy URL.
|
static |
The message the user gets when a shared file or link could not be taken or opened.
The messages are fixed texts: nothing the provider or the file said ever reaches them. "Busy" means the app turned the share away for lack of room (the provider already has a call outstanding, too many providers are busy, or another copy is running), which the user can understand and retry later; everything else stays the generic "could not play" message.
| providerCallRefusedBusy | the provider call was refused for lack of room (BoundedCall.Result#isRefusedBusy()) |
| copySlotBusy | the copy fallback was refused because another copy runs or too many stuck copies are left |
|
static |
Whether there is an address a receiver could fetch from.
Offline the phone has none; the check comes before anything is registered so that no URL with the text "null" in it exists.
| ip | this phone's address as text, null or blank when it is not known |
Referenced by de.yaacc.share.ShareService.proxyUrl().

| Prepared de.yaacc.share.ShareService.prepare | ( | PendingShare.Data | data, |
| Set< String > | receiverIds ) |
Worker thread only.
| data | the confirmed pending share |
| receiverIds | the receivers the user picked; the allowed addresses come from these, not from the stored selection |
Referenced by de.yaacc.share.ShareService.prepare(), and de.yaacc.share.ShareService.prepareFor().


|
static |
The URL a receiver fetches a share from: http://<ip>:<port>/proxy/<key>.
An IPv6 literal is put in brackets by URI; a zone id is kept.
| ip | this phone's address as text, surrounding blanks are ignored |
| key | the registry key |
