org.n52.security.decision
Class Target

java.lang.Object
  extended by org.n52.security.decision.Target
All Implemented Interfaces:
java.io.Serializable

public class Target
extends java.lang.Object
implements java.io.Serializable

The target to clearly identify an issue, for which the rights should be retrieved.

Version:
$Revision: 1748 $
Author:
Bastian Schaeffer, Marko Reiprecht
See Also:
Serialized Form

Field Summary
static java.lang.String ACTION_ID
          the action id attribute key.
protected  Attributes m_actionAttributes
          Attributes of the action element.
protected  Attributes m_resourceAttributes
          Attributes of the resource element.
protected  javax.security.auth.Subject m_subject
          Subject information of target.
static java.lang.String RESOURCE_ID
          the resource id attribute key.
protected static java.lang.String RESOURCE_TYPE
          The resource type attribute key, this is only introduced for backwards compartibility, and will be removed in the next release.
static java.lang.String TYPE_UNKNOWN
          Deprecated. the type attribute is not longer supported and will be removed in the next release.
 
Constructor Summary
Target()
          Constructor creates a new empty target instance.
Target(java.lang.String resourceId, java.lang.String actionId)
          Constructor creates a new instance with the given resource and action id, but with an empty subject.
Target(javax.security.auth.Subject subject, java.lang.String resourceId, java.lang.String actionId)
           
Target(javax.security.auth.Subject subject, java.lang.String resource, java.lang.String action, java.lang.String type)
          Deprecated. the type attribute is no longer directly supported, please use an application specific "type" attriubte in the ressource or action attribute collections.
 
Method Summary
 boolean equals(java.lang.Object o)
          Method equals.
 java.lang.String getAction()
          Deprecated. use getActionId to get the id of the action.
 Attributes getActionAttributes()
          Method gets the action attributes.
 java.lang.String getActionId()
          Method gets the actionId.
 java.lang.String getResource()
          Deprecated. use getResourceId() to get the id of the resource
 Attributes getResourceAttributes()
          Method gets the resource attributes.
 java.lang.String getResourceId()
          Method gets the resourceId.
 javax.security.auth.Subject getSubject()
          Method gets the subject.
 java.lang.String getType()
          Deprecated. use a application specific type attribute.
 int hashCode()
          Method hashCode.
 void setActionId(java.lang.String actionId)
          Method sets the actionId.
 void setResourceId(java.lang.String resourceId)
          Method sets the resourceId.
 java.lang.String toString()
          Method toString.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_ID

public static final java.lang.String ACTION_ID
the action id attribute key.

See Also:
Constant Field Values

RESOURCE_ID

public static final java.lang.String RESOURCE_ID
the resource id attribute key.

See Also:
Constant Field Values

TYPE_UNKNOWN

public static final java.lang.String TYPE_UNKNOWN
Deprecated. the type attribute is not longer supported and will be removed in the next release.
See Also:
Constant Field Values

RESOURCE_TYPE

protected static final java.lang.String RESOURCE_TYPE
The resource type attribute key, this is only introduced for backwards compartibility, and will be removed in the next release.

See Also:
Constant Field Values

m_subject

protected final javax.security.auth.Subject m_subject
Subject information of target.


m_resourceAttributes

protected final Attributes m_resourceAttributes
Attributes of the resource element.


m_actionAttributes

protected final Attributes m_actionAttributes
Attributes of the action element.

Constructor Detail

Target

public Target()
Constructor creates a new empty target instance.


Target

public Target(java.lang.String resourceId,
              java.lang.String actionId)
       throws java.lang.NullPointerException
Constructor creates a new instance with the given resource and action id, but with an empty subject.

Parameters:
resourceId - the resourceId.
actionId - the actionId.
Throws:
java.lang.NullPointerException - if error occurs.

Target

public Target(javax.security.auth.Subject subject,
              java.lang.String resourceId,
              java.lang.String actionId)
       throws java.lang.IllegalArgumentException
Parameters:
subject - the user who requests
resourceId - the resource, e.g. a layer
actionId - the action, which should be performend. e.g. GetMap
Throws:
java.lang.IllegalArgumentException - if subject is null.

Target

public Target(javax.security.auth.Subject subject,
              java.lang.String resource,
              java.lang.String action,
              java.lang.String type)
       throws java.lang.IllegalArgumentException
Deprecated. the type attribute is no longer directly supported, please use an application specific "type" attriubte in the ressource or action attribute collections.

Parameters:
subject - the subject, who ask for a resource e.g. user
resource - the resource, which is asked for
action - the action, which should executed
type - a special type use TYPE_UNKNOWN for unknown types
Throws:
java.lang.IllegalArgumentException - if subject is null.
Method Detail

getAction

public java.lang.String getAction()
Deprecated. use getActionId to get the id of the action.

Method gets the action.

Returns:
String.

getActionAttributes

public Attributes getActionAttributes()
Method gets the action attributes.

Returns:
Attributes.

getActionId

public java.lang.String getActionId()
Method gets the actionId.

Returns:
String.

setActionId

public void setActionId(java.lang.String actionId)
Method sets the actionId.

Parameters:
actionId - the action id.

getResource

public java.lang.String getResource()
Deprecated. use getResourceId() to get the id of the resource

Method gets the resource.

Returns:
String.

getResourceAttributes

public Attributes getResourceAttributes()
Method gets the resource attributes.

Returns:
Attributes.

getResourceId

public java.lang.String getResourceId()
Method gets the resourceId.

Returns:
String.

setResourceId

public void setResourceId(java.lang.String resourceId)
Method sets the resourceId.

Parameters:
resourceId - the resourceId.

getSubject

public javax.security.auth.Subject getSubject()
Method gets the subject.

Returns:
Subject.

getType

public java.lang.String getType()
Deprecated. use a application specific type attribute.

Method gets the type.

Returns:
String.

equals

public boolean equals(java.lang.Object o)
Method equals.

Overrides:
equals in class java.lang.Object
Parameters:
o - the o.
Returns:
boolean.

hashCode

public int hashCode()
Method hashCode.

Overrides:
hashCode in class java.lang.Object
Returns:
int.

toString

public java.lang.String toString()
Method toString.

Overrides:
toString in class java.lang.Object
Returns:
String.


Copyright © 2004-2009 52north.org. All Rights Reserved.