Oracle Server E10293-02 Benutzerhandbuch

Seite von 108
Using the Presence Web Services Interfaces
6-6  Oracle Communication and Mobility Server Developer’s Guide
// should be used as device note.
other1.setName("ServiceNote");
other1.setValue(serviceName);
typeValueOther1.setOther(other1);
paOther1.setTypeAndValue(typeValueOther1);
// The note is not used. Can be anything.
paOther1.setNote("OracleExtension");
paOther1.setLastChange(dateTime);
//Unpublish Functionality Implemented by OCMS
//To perform an "Unpublish", set OtherValue to (Expires, 0)
//OtherValue other = new OtherValue();
//other.setName("Expires");
//other.setValue(0);
//typeValue.setOther (other);
//typeValue.setUnionElement(PresenceAttributeTypeOther);
paArray = new PresenceAttribute[]{paActivity,paOther,paOther1};
// Calling the publish method by passing the PresenceAttribute
// array containing the presence status, device note and service
// note.
publish(paArray);
Interface: PresenceSupplier, Operation: getOpenSubscriptions
This operation retrieves a list of new requests to be on your watcher list.
Code Example
SubscriptionRequest[] srArray = getOpenSubscriptions();
for (SubscriptionRequest sr:srArray) {
    System.out.println(sr.getWatcher() .toString());
}
Interface: PresenceSupplier, Operation: updateSubscriptionAuthorization
This operation allows you to place a watcher on either the block or allow list.
Code Example
 //You always pass in Activity
pp.set.PresenceAttribute(PresenceAttributeType.Activity);
updateSubscriptionAuthorization(new URI("sip:allow@test.example.com"),
new PresencePermission[]{pp});
PresencePermission pp = new PresencePermission();
pp.setDecision(true);
//Put the user on the allow list
Interface: PresenceSupplier, Operation: getMyWatchers
This operation retrieves the list of watchers in your allow list.
Code Example
 URI[] uris;
uris = getMyWatchers();
for (URI uri:uris)
    System.out.println(uri.toString());