Package net.shibboleth.idp.cas.service

# Class Service

java.lang.Object
net.shibboleth.idp.cas.service.Service

All Implemented Interfaces:
  `Principal`

public class Service extends Object implements Principal
Container for metadata about a CAS service (i.e. relying party).

## Field Summary

Fields
Modifier and Type
Field
Description
`private final boolean`
`authorizedToProxy`
Proxy authorization flag.
`private EntityDescriptor`
`entityDescriptor`
Source of service metadata based on SAML metadata.
`private RoleDescriptor`
`roleDescriptor`
Role for service in SAML metadata.
`private final String`
`serviceGroup`
Group to which service belongs.
`private final String`
`serviceURL`
Service URL.
`private final boolean`
`singleLogoutParticipant`
Indicates whether a service wants to receive SLO messages.

## Constructor Summary

Constructors
Constructor
Description
`Service(String url, String group, boolean proxy)`
Creates a new service that does not participate in SLO.
`Service(String url, String group, boolean proxy, boolean wantsSLO)`
Creates a new service that MAY participate in SLO.

## Method Summary

Modifier and Type
Method
Description
`EntityDescriptor`
`getEntityDescriptor()`
Gets the SAML entity that is the source of service metadata.
`String`
`getGroup()`
Get the group to which the service belongs.
`String`
`getName()`
Get the service URL.
`RoleDescriptor`
`getRoleDescriptor()`
Gets the role in the SAML metadata.
`boolean`
`isAuthorizedToProxy()`
Get whether proxying is authorized.
`boolean`
`isSingleLogoutParticipant()`
Get whether the service wants to receive SLO message.
`void`
`setEntityDescriptor(EntityDescriptor ed)`
Sets the SAML entity that is the source of service metadata.
`void`
`setRoleDescriptor(RoleDescriptor role)`
Sets the role in the SAML metadata.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.security.Principal

`equals, hashCode, implies`

## Field Details

### serviceURL

@Nonnull @NotEmpty private final String serviceURL
Service URL.

### serviceGroup

@Nullable private final String serviceGroup
Group to which service belongs.

### authorizedToProxy

private final boolean authorizedToProxy
Proxy authorization flag.

### singleLogoutParticipant

private final boolean singleLogoutParticipant
Indicates whether a service wants to receive SLO messages.

### entityDescriptor

@Nullable private transient EntityDescriptor entityDescriptor
Source of service metadata based on SAML metadata.

### roleDescriptor

@Nullable private transient RoleDescriptor roleDescriptor
Role for service in SAML metadata.

## Constructor Details

### Service

public Service(@Nonnull @NotEmpty String url, @Nullable @NotEmpty String group, boolean proxy)
Creates a new service that does not participate in SLO.

Parameters:
  `url` - CAS service URL.
  `group` - Group to which service belongs.
  `proxy` - True to authorize proxying, false otherwise.

### Service

public Service(@Nonnull @NotEmpty String url, @Nullable @NotEmpty String group, boolean proxy, boolean wantsSLO)
Creates a new service that MAY participate in SLO.

Parameters:
  `url` - CAS service URL.
  `group` - Group to which service belongs.
  `proxy` - True to authorize proxying, false otherwise.
  `wantsSLO` - True to indicate the service wants to receive SLO messages, false otherwise.

## Method Details

### getName

public String getName()
Get the service URL.

Specified by:
  `getName` in interface `Principal`

### getGroup

@Nullable public String getGroup()
Get the group to which the service belongs.

Returns:
  service group name

### isAuthorizedToProxy

public boolean isAuthorizedToProxy()
Get whether proxying is authorized.

Returns:
  true if proxying is authorized, false otherwise

### isSingleLogoutParticipant

public boolean isSingleLogoutParticipant()
Get whether the service wants to receive SLO message.

Returns:
  true to indicate the service wants to receive SLO messages, false otherwise

### getEntityDescriptor

@Nullable public EntityDescriptor getEntityDescriptor()
Gets the SAML entity that is the source of service metadata.

Returns:
  Entity descriptor for service defined in SAML metadata, otherwise null.

### setEntityDescriptor

public void setEntityDescriptor(@Nullable EntityDescriptor ed)
Sets the SAML entity that is the source of service metadata.

Parameters:
  `ed` - SAML entity descriptor.

### getRoleDescriptor

@Nullable public RoleDescriptor getRoleDescriptor()
Gets the role in the SAML metadata.

Returns:
  the role
Since:
  4.0.0

### setRoleDescriptor

public void setRoleDescriptor(@Nullable RoleDescriptor role)
Sets the role in the SAML metadata.

Parameters:
  `role` - the role
Since:
  4.0.0

### toString

public String toString()

Specified by:
  `toString` in interface `Principal`
Overrides:
  `toString` in class `Object`