com.atlassian.bamboo.buildqueue
Class ImmutableRemoteAgentAuthentication

java.lang.Object
  extended by com.atlassian.bamboo.buildqueue.ImmutableRemoteAgentAuthentication
All Implemented Interfaces:
RemoteAgentAuthentication, java.lang.Comparable<RemoteAgentAuthentication>

public class ImmutableRemoteAgentAuthentication
extends java.lang.Object
implements java.lang.Comparable<RemoteAgentAuthentication>, RemoteAgentAuthentication

Immutable business object representing remote agent authentication request.

Since:
3.4

Constructor Summary
ImmutableRemoteAgentAuthentication(RemoteAgentAuthenticationEntity entity)
           
ImmutableRemoteAgentAuthentication(java.util.UUID uuid, java.lang.String ip)
           
ImmutableRemoteAgentAuthentication(java.util.UUID uuid, java.lang.String ip, boolean approved)
           
 
Method Summary
 int compareTo(RemoteAgentAuthentication other)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getIp()
          IP address of the agent requesting approval.
 java.util.Set<java.lang.String> getIpPatterns()
           
 java.util.UUID getUuid()
          UUID of this authentication request.
 int hashCode()
           
 boolean isApproved()
          Whether this request was approved, or is still pending approval
 boolean matches(java.lang.String ip)
          For authentication pending approval this must be full match (equals), otherwise wildcard match will be attempted.
 boolean matches(java.util.UUID uuid, java.lang.String ip)
          Check if matches given uuid and ip.
 RemoteAgentAuthenticationEntity toEntity()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableRemoteAgentAuthentication

public ImmutableRemoteAgentAuthentication(@NotNull
                                          java.util.UUID uuid,
                                          @NotNull
                                          java.lang.String ip)

ImmutableRemoteAgentAuthentication

public ImmutableRemoteAgentAuthentication(@NotNull
                                          java.util.UUID uuid,
                                          @NotNull
                                          java.lang.String ip,
                                          boolean approved)

ImmutableRemoteAgentAuthentication

public ImmutableRemoteAgentAuthentication(RemoteAgentAuthenticationEntity entity)
Method Detail

getUuid

public java.util.UUID getUuid()
Description copied from interface: RemoteAgentAuthentication
UUID of this authentication request.

Specified by:
getUuid in interface RemoteAgentAuthentication
Returns:
UUID

getIp

public java.lang.String getIp()
Description copied from interface: RemoteAgentAuthentication
IP address of the agent requesting approval. May contain multiple addresses (coma separated) if agent connects through proxy

Specified by:
getIp in interface RemoteAgentAuthentication
Returns:
IP address of the remote agent

isApproved

public boolean isApproved()
Description copied from interface: RemoteAgentAuthentication
Whether this request was approved, or is still pending approval

Specified by:
isApproved in interface RemoteAgentAuthentication
Returns:
true, if this authentication request has been approved

getIpPatterns

public java.util.Set<java.lang.String> getIpPatterns()
Specified by:
getIpPatterns in interface RemoteAgentAuthentication
Returns:
list of IP patterns matched for authentication

matches

public boolean matches(@NotNull
                       java.lang.String ip)
For authentication pending approval this must be full match (equals), otherwise wildcard match will be attempted.

Parameters:
ip - IP address to match
Returns:
true, if this authentication matches ip
See Also:
RemoteAgentAuthentications.matching(String)

matches

public boolean matches(java.util.UUID uuid,
                       java.lang.String ip)
Check if matches given uuid and ip. UUID must be exactly equal to this authentication's UUID and the ip must match as per matches(String).

Parameters:
uuid - UUID
ip - IP
Returns:
true, if this authentication matches given uuid and ip
See Also:
RemoteAgentAuthentications.matching(java.util.UUID, String)

toEntity

public RemoteAgentAuthenticationEntity toEntity()

compareTo

public int compareTo(RemoteAgentAuthentication other)
Specified by:
compareTo in interface java.lang.Comparable<RemoteAgentAuthentication>

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2012 Atlassian. All Rights Reserved.