Nitido Inc.

com.nitido.nimx.nuggets.wcap
Class AccessControlEntry

java.lang.Object
  extended by com.nitido.nimx.nuggets.wcap.AccessControlEntry

public class AccessControlEntry
extends java.lang.Object

The data object that encapsulate the data of Access Control Entry. This object is used by CalendarProperty in the getACL() and setACL(). (ACL = Access Control List)

The Access Control Entry is not described in any standard for Internet Calendaring. It is a pure iPlanet idea. For more details, please refer to the Programming Guide and Administration Guide of iPlanet Calendar Server.

An Access Control Entry is composed of the following fields.

  1. "Who" - represents the user this ACE is applying to. If the ACE is applying to an individual user, a domain, or a type of users.
  2. "Flag" - the scope of this ACE is applying to.
  3. "How" - which access mechanism privilege will be granted/denied.
  4. "Grant" - whether to grant or denied the mentioned privilege.
The iPlanet Calendar Server has declared specific syntax and special values for some of these fields. We recommend you to use the corresponding constants defined here instead of using the actual character or string. This can reduce your development effort because any typing mistakes will be caught by the compiler. Otherwise, this type of error will become very difficult to catch at run time.

Detail of "Who" Field

If the ACE is applying to an individual user or a domain, the string would be the corresponding user's id or the domain id. Otherwise, the ACE can be applied to the following four types of users.

Constant Name Original Value User Type
WHO_ALL_USERS "@" All users
WHO_PRIMARY "@@p" Primary owners of a calendar
WHO_OWNERS "@@o" Owners of a calendar
WHO_NON_OWNERS "@@n" Non-owners of a calendar

By default, primary owners are the people who create the calendar or the people who has the write to modify and access all events/todos and properties of the calendar. Owners can only modify the events and todos, but not the property. Non-owners have no access at all. However, this type of default setting can be altered easily by the

Detail of "Flag" Field

The flag field represents the scope that the ACE will apply to. The iPlanet Calendar Server support only three type of scopes. The valid values you would get are:

Constant Name Original Value Description
FLAG_FOR_ALL a the ACE applies to all components and properties within the current calendar.
FLAG_FOR_COMPONENTS c the ACE applies to the components only.
FLAG_FOR_PROPERTIES p the ACE applies to the calendar properties only.

Detail of "How" Field

The how field determines which access mechanism is described in this ACE. Unlike the flag field, this field can be composed of multiple values. Each character in the field string represents a access mechanism. A developer simply concatenate characters into a string. The sequence of the character is not considered by the server. (i.e. can be in whatever sequence you like) The supported mechanism characters are:

Constant Name Original Value iPlanet Description
HOW_ON_BEHALF_CANCEL c Grants the user act-on-behalf-of cancel access. With cancel access, a user has the right to cancel components to which attendees have been invited on behalf of the calendar's primary owner.
HOW_ON_BEHALF_REPLY e Grants the user act-on-behalf-of reply access. This grants a user the rights to accept or decline invitations on behalf of the calendar's primary owner.
HOW_ON_BEHALF_INVITE i Grants the user act-on-behalf-of invite access. This grants a user the right to create and modify components in which other attendees have been invited on behalf of the calendar's primary owner
HOW_DELETE d Grants the user delete access
HOW_FREE_BUSY f Grants the user the right to view the calendar's free/busy time slot.
HOW_READ r Grants the user read access.
HOW_SCHEDULE s Grants the user schedule access. This means that request can be made, replies will be accepted and other scheduling interactions will be honoured.
HOW_WRITE w Grants the user write access. This includes adding new items, deleting items, and modifying existing items.
For example, if you want to grant the read, write, delete access, you should invoke the code like:
 String howStr = ""                             // force String concatenation
               + AccessControlEntry.HOW_READ    // read access privilege
               + AccessControlEntry.HOW_WRITE   // write access privilege
               + AccessControlEntry.HOW_DELETE; // delete access privilege
 AccessControlEntry ace = new AccessControlEntry( "testuser", FLAG_FOR_ALL,
                              howStr, GRANT
 

Detail of "Grant" Field

"Grant" field describe whether this ACE grant or deny the specific privilege.


Field Summary
static char FLAG_FOR_ALL
           
static char FLAG_FOR_COMPONENTS
           
static char FLAG_FOR_PROPERTIES
           
static char HOW_DELETE
           
static char HOW_FREE_BUSY
           
static char HOW_ON_BEHALF_CANCEL
           
static char HOW_ON_BEHALF_INVITE
           
static char HOW_ON_BEHALF_REPLY
           
static char HOW_READ
           
static char HOW_SCHEDULE
           
static char HOW_WRITE
           
static java.lang.String WHO_ALL_USERS
           
static java.lang.String WHO_NON_OWNERS
           
static java.lang.String WHO_OWNERS
           
static java.lang.String WHO_PRIMARY
           
 
Constructor Summary
protected AccessControlEntry(java.lang.String entryStr)
          For internal use.
  AccessControlEntry(java.lang.String who, char flag, java.lang.String how, boolean grant)
          Default constructor.
 
Method Summary
 boolean equals(java.lang.Object inObj)
          Override the default java.lang.Object's equal command.
 boolean getGrant()
          Get whether this ACE grant or deny the access privilege.
 java.lang.String getHow()
          Get the access mechanism to be controlled by this ACE.
 char getScopeFlag()
          Get the scope of this access control entry.
 java.lang.String getWho()
          Get who is this ACE applying to.
 boolean isDelete()
          Check whether the how string contains the entry for delete access.
 boolean isFreeBusy()
          Check whether the how string contains the entry for free-busy access.
 boolean isOnBehalfCancel()
          Check whether the how string contains the entry for "act-on-behalf-of" cancel access.
 boolean isOnBehalfInvite()
          Check whether the how string contains the entry for "act-on-behalf-of" invite access.
 boolean isOnBehalfReply()
          Check whether the how string contains the entry for "act-on-behalf-of" reply access.
 boolean isRead()
          Check whether the how string contains the entry for read access.
 boolean isSchedule()
          Check whether the how string contains the entry for schedule access.
 boolean isWrite()
          Check whether the how string contains the entry for write access.
 void setGrant(boolean grant)
          Set whether this ACE grant or deny the access privilege.
 void setHow(java.lang.String how)
          Set the access mechanism to be controlled by this ACE.
 void setScopeFlag(char flag)
          Set the scope of this access control entry would affect.
 void setWho(java.lang.String who)
          Set who is this ACE applying to.
 java.lang.String toString()
          Convert the component into a string that is used for constructing a WCAP query.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WHO_ALL_USERS

public static final java.lang.String WHO_ALL_USERS
See Also:
Constant Field Values

WHO_PRIMARY

public static final java.lang.String WHO_PRIMARY
See Also:
Constant Field Values

WHO_OWNERS

public static final java.lang.String WHO_OWNERS
See Also:
Constant Field Values

WHO_NON_OWNERS

public static final java.lang.String WHO_NON_OWNERS
See Also:
Constant Field Values

FLAG_FOR_ALL

public static final char FLAG_FOR_ALL
See Also:
Constant Field Values

FLAG_FOR_COMPONENTS

public static final char FLAG_FOR_COMPONENTS
See Also:
Constant Field Values

FLAG_FOR_PROPERTIES

public static final char FLAG_FOR_PROPERTIES
See Also:
Constant Field Values

HOW_ON_BEHALF_CANCEL

public static final char HOW_ON_BEHALF_CANCEL
See Also:
Constant Field Values

HOW_ON_BEHALF_REPLY

public static final char HOW_ON_BEHALF_REPLY
See Also:
Constant Field Values

HOW_ON_BEHALF_INVITE

public static final char HOW_ON_BEHALF_INVITE
See Also:
Constant Field Values

HOW_DELETE

public static final char HOW_DELETE
See Also:
Constant Field Values

HOW_FREE_BUSY

public static final char HOW_FREE_BUSY
See Also:
Constant Field Values

HOW_READ

public static final char HOW_READ
See Also:
Constant Field Values

HOW_SCHEDULE

public static final char HOW_SCHEDULE
See Also:
Constant Field Values

HOW_WRITE

public static final char HOW_WRITE
See Also:
Constant Field Values
Constructor Detail

AccessControlEntry

public AccessControlEntry(java.lang.String who,
                          char flag,
                          java.lang.String how,
                          boolean grant)
Default constructor.


AccessControlEntry

protected AccessControlEntry(java.lang.String entryStr)
For internal use.

Method Detail

getWho

public java.lang.String getWho()
Get who is this ACE applying to.

The syntax of the field string is described in Detail of "Who" Field of the class description.


setWho

public void setWho(java.lang.String who)
Set who is this ACE applying to.

The syntax of the field string is described in Detail of "Who" Field of the class description.


getScopeFlag

public char getScopeFlag()
Get the scope of this access control entry.

The syntax of the field string is described in Detail of "Flag" Field of the class description.


setScopeFlag

public void setScopeFlag(char flag)
Set the scope of this access control entry would affect.

The syntax of the field string is described in Detail of "Flag" Field of the class description.


getHow

public java.lang.String getHow()
Get the access mechanism to be controlled by this ACE.

The syntax of the field string is described in Detail of "How" Field of the class description.


setHow

public void setHow(java.lang.String how)
Set the access mechanism to be controlled by this ACE.

The syntax of the field string is described in Detail of "How" Field of the class description.


getGrant

public boolean getGrant()
Get whether this ACE grant or deny the access privilege.

The syntax of the field string is described in Detail of "Grant" Field of the class description.

Returns:
true if the privileged is granted.

setGrant

public void setGrant(boolean grant)
Set whether this ACE grant or deny the access privilege.

The syntax of the field string is described in Detail of "Grant" Field of the class description.

Parameters:
grant - true if the privileged is granted.

toString

public java.lang.String toString()
Convert the component into a string that is used for constructing a WCAP query. This method is designed for internal use by the WcapNugget only.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object inObj)
Override the default java.lang.Object's equal command. This will compares the content of the fields. In case of a vector or array field, it will compare the content of the field.

Overrides:
equals in class java.lang.Object

isOnBehalfCancel

public boolean isOnBehalfCancel()
Check whether the how string contains the entry for "act-on-behalf-of" cancel access.

Returns:
true if the character HOW_ON_BEHALF_CANCEL exists in the How field.

isOnBehalfReply

public boolean isOnBehalfReply()
Check whether the how string contains the entry for "act-on-behalf-of" reply access.

Returns:
true if the character HOW_ON_BEHALF_REPLY exists in the How field.

isOnBehalfInvite

public boolean isOnBehalfInvite()
Check whether the how string contains the entry for "act-on-behalf-of" invite access.

Returns:
true if the character HOW_ON_BEHALF_INVITE exists in the How field.

isDelete

public boolean isDelete()
Check whether the how string contains the entry for delete access.

Returns:
true if the character HOW_DELETE exists in the How field.

isFreeBusy

public boolean isFreeBusy()
Check whether the how string contains the entry for free-busy access.

Returns:
true if the character HOW_FREE_BUSY exists in the How field.

isRead

public boolean isRead()
Check whether the how string contains the entry for read access.

Returns:
true if the character HOW_READ exists in the How field.

isSchedule

public boolean isSchedule()
Check whether the how string contains the entry for schedule access.

Returns:
true if the character HOW_SCHEDULE exists in the How field.

isWrite

public boolean isWrite()
Check whether the how string contains the entry for write access.

Returns:
true if the character HOW_WRITE exists in the How field.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.